Commit Graph

11835 Commits

Author SHA1 Message Date
Marko Zec
bd36872867 Driver for 4x10Gb Ethernet reference NIC FPGA design for NetFPGA SUME
development board.

Submitted by:	Denis Salopek <denis.salopek AT fer.hr>
Reported by:	zec, bz (src); rgrimes, bcr (manpages)
MFC after:	7 days
Sponsored by:	Google Summer of Code 2020
Differential Revision:	https://reviews.freebsd.org/D26074
2020-08-30 07:34:32 +00:00
Vladimir Kondratyev
5d4bf0578f LinuxKPI: Implement ksize() function.
In Linux, ksize() gets the actual amount of memory allocated for a given
object. This commit adds malloc_usable_size() to FreeBSD KPI which does
the same. It also maps LinuxKPI ksize() to newly created function.

ksize() function is used by drm-kmod.

Reviewed by:	hselasky, kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D26215
2020-08-29 19:26:31 +00:00
Warner Losh
513575d446 Make sbuf_setpos match the implementation.
sbuf_setpos can only be used to truncate the buffer, never to make it
longer. Update the documentation to reflect this.

Reviewed By: allanjude, phk
Differential Revision: https://reviews.freebsd.org/D26198
2020-08-26 17:06:16 +00:00
Alan Somers
e6f6d0c9bc crypto(9): add CRYPTO_BUF_VMPAGE
crypto(9) functions can now be used on buffers composed of an array of
vm_page_t structures, such as those stored in an unmapped struct bio.  It
requires the running to kernel to support the direct memory map, so not all
architectures can use it.

Reviewed by:	markj, kib, jhb, mjg, mat, bcr (manpages)
MFC after:	1 week
Sponsored by:	Axcient
Differential Revision:	https://reviews.freebsd.org/D25671
2020-08-26 02:37:42 +00:00
D Scott Phillips
f878200180 bitset: add BIT_FFS_AT() for finding the first bit set greater than a start bit
Reviewed by:	kib
Approved by:	scottl (implicit)
MFC after:	1 week
Sponsored by:	Ampere Computing, Inc.
Differential Revision:	https://reviews.freebsd.org/D26128
2020-08-26 02:07:46 +00:00
Mark Johnston
e38788f06c sdhci(4): Recognize the Texas Instruments PCIxx12 card reader.
PR:		248650
Submitted by:	Lars Herschke <lhersch@dssgmbh.de>
MFC after:	1 week
2020-08-25 18:32:43 +00:00
Alex Richardson
6b3a148c52 style.Makefile: list CSTD between WARNS and CFLAGS
This was suggested by emaste in https://reviews.freebsd.org/D25928 and
matches most uses in the tree.
2020-08-25 13:30:29 +00:00
Hans Petter Selasky
d141d1cc5f Add mlx5en(4) to the list of supported netdump network drivers.
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-08-25 13:21:49 +00:00
Mateusz Piotrowski
e378129ea6 Reference spi(8) from spigen.4
MFC after:	2 weeks
2020-08-21 09:50:03 +00:00
Gordon Bergling
cb9cbce235 gre(4): Mention sysctl for nesting gre tunnels
PR:		228465
Submitted by:	Sergey Akhmatov <sergey at akhmatov dot ru>
Reviewed by:	bcr
Approved by:	bcr
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D26097
2020-08-21 07:03:54 +00:00
Warner Losh
422809e1b1 Remove ufm.4 from the Makefile 2020-08-20 18:31:50 +00:00
Warner Losh
209d3fb41f Remove the long obsolete ufm driver.
It was a driver for a USB FM tuner that was available in the market in 2002. I
wrote the driver in 2003. I've not used it since 2005 or so, so it's time to
retire this driver. No userland code ever interfaced to the special device it
created. There's no user base: the last bug I received on this driver was in
2004.

Relnotes: Yes
2020-08-20 17:35:47 +00:00
Warner Losh
e0d14216c1 Tag pccard drivers with gone in 13.
MFC After: 3 days
Reviewed by: emaste, brooks, adrian (on twitter)
Differential Revision: https://reviews.freebsd.org/D26095
2020-08-20 17:19:40 +00:00
Warner Losh
a418d47b79 Fix function name in zone.9
uma_zone_prealloc -> uma_prealloc. There's no uma_zone_prealloc defined and the
docs for it describe uma_prealloc exactly.
2020-08-20 16:52:34 +00:00
Mark Johnston
7d604fb5f3 Add a KCOV man page.
Reviewed by:	andrew, gbe, tuexen
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26108
2020-08-19 18:52:22 +00:00
Ed Maste
697718b9b6 ipfirewall(4): remove Cuseeme from supported list
Submitted by:	Dries Michiels
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D26075
2020-08-19 17:52:06 +00:00
Mateusz Piotrowski
0dfb59ab75 Cross-reference development.7 and tests.7
MFC after:	7 days
2020-08-19 13:09:31 +00:00
Marko Zec
502305f04a Fix ber parameter description. 2020-08-18 22:15:51 +00:00
Gordon Bergling
30a85ff3c0 pf.conf(5): Assorted fixes
- new sentence new line
- blank lines in fill mode
2020-08-18 17:30:51 +00:00
Warner Losh
0c8e22687c bt(4) has already been removed. Add a deprecation notice.
MFC After: 1 day
2020-08-18 17:29:01 +00:00
Mateusz Piotrowski
09f515da61 Use complete OIDs to avoid confusion
Submitted by:	otis_sk.freebsd.org
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D26098
2020-08-18 10:30:55 +00:00
Warner Losh
c9234752b0 Document that PC Card will likely be removed before 13.
This was discussed in arch@ a while ago. Most of the 16-bit drivers that it
relied on have been removed. There's only a few other drivers remaining that
support it, and those are very rare the days (even the once ubiquitious wi(1)
is now quite rare).

Indvidual drivers will be handled separately before pccard itself is removed.
2020-08-18 06:18:18 +00:00
Conrad Meyer
8a0edc914f Add prng(9) API
Add prng(9) as a replacement for random(9) in the kernel.

There are two major differences from random(9) and random(3):

- General prng(9) APIs (prng32(9), etc) do not guarantee an
  implementation or particular sequence; they should not be used for
  repeatable simulations.

- However, specific named API families are also exposed (for now: PCG),
  and those are expected to be repeatable (when so-guaranteed by the named
  algorithm).

Some minor differences from random(3) and earlier random(9):

- PRNG state for the general prng(9) APIs is per-CPU; this eliminates
  contention on PRNG state in SMP workloads.  Each PCPU generator in an
  SMP system produces a unique sequence.

- Better statistical properties than the Park-Miller ("minstd") PRNG
  (longer period, uniform distribution in all bits, passes
  BigCrush/PractRand analysis).

- Faster than Park-Miller ("minstd") PRNG -- no division is required to
  step PCG-family PRNGs.

For now, random(9) becomes a thin shim around prng32().  Eventually I
would like to mechanically switch consumers over to the explicit API.

Reviewed by:	kib, markj (previous version both)
Discussed with:	markm
Differential Revision:	https://reviews.freebsd.org/D25916
2020-08-13 20:48:14 +00:00
Andriy Gapon
a089fa298d hook cp2112.4 to the build
Reported by:	0mp
MFC after:	1 week
X-MFC with:	r364144
2020-08-12 11:37:28 +00:00
Andriy Gapon
758fac8f87 hook gpiokeys.4 to the build
Reported by:	0mp
MFC after:	3 days
X-MFC with:	r363905
2020-08-12 11:36:09 +00:00
Andriy Gapon
470d07d417 add a manual page for cp2112
MFC after:	1 week
2020-08-12 09:42:05 +00:00
Mateusz Guzik
51ea7bea91 vfs: add VOP_STAT
The current scheme of calling VOP_GETATTR adds avoidable overhead.

An example with tmpfs doing fstat (ops/s):
before: 7488958
after:  7913833

Reviewed by:	kib (previous version)
Differential Revision:	https://reviews.freebsd.org/D25910
2020-08-07 23:06:40 +00:00
Bjoern A. Zeeb
7d1d4407f5 net80211/ifconfig: print hardware device name for wlan interfaces
Add IEEE80211_IOC_IC_NAME to query the ic_name field and in ifconfig
to print the parent interface again. This functionality was lost
around r287197. It helps in case of multiple wlan interfaces and
multiple underlying hardware devices to keep track which wlan
interface belongs to which physical device.

Sponsored by:	Rubicon Communications, LLC (d/b/a "Netgate")
Reviewed by:	adrian, Idwer Vollering
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D25832
2020-08-07 12:24:23 +00:00
Li-Wen Hsu
da34299940 Add a .Pp to separate description and sample code for readability. 2020-08-07 08:57:31 +00:00
Gordon Bergling
6d34415f67 environ(7): Update the description and include some more environment variables
- Add a better introduction to the DESCRIPTION section
- Add a description for MANPATH and POSIXLY_CORRECT
- Asorted improvements for the usage of some macros

PR:		43823
Submitted by:	Lyndon Nerenberg <lyndon at orthanc dot ab dot ca>
Reviewed by:	0mp, bcr
Approved by:	0mp, bcr
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25912
2020-08-05 11:41:41 +00:00
Andriy Gapon
75050aa9af gpiokeys: add a basic manual page
Reviewed by:	manu, bjk, 0mp
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D25939
2020-08-05 11:38:33 +00:00
Mateusz Piotrowski
b9615c3c00 Do not describe portsnap(8) as a way to manage /usr/ports 2020-08-05 11:26:14 +00:00
Mark Johnston
96ad26eefb Remove free_domain() and uma_zfree_domain().
These functions were introduced before UMA started ensuring that freed
memory gets placed in domain-local caches.  They no longer serve any
purpose since UMA now provides their functionality by default.  Remove
them to simplyify the kernel memory allocator interfaces a bit.

Reviewed by:	cem, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D25937
2020-08-04 13:58:36 +00:00
Konstantin Belousov
6e0c8e1ae2 Add SOL_LOCAL symbolic constant for unix socket option level.
The constant seems to exists on MacOS X >= 10.8.

Requested by:	swills
Reviewed by:	allanjude, kevans
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D25933
2020-08-03 22:13:02 +00:00
Mateusz Piotrowski
8c72577900 Do not mention portsnap(8) in ports.7
As we are moving away from portsnap,
let's not recommend it in the manual page.

Reviewed by:	bcr (manpages), mat (portmgr)
Differential Revision:	https://reviews.freebsd.org/D25847
2020-08-03 13:12:07 +00:00
Mateusz Piotrowski
c7b00f0071 core(5) appeared in Version 1 AT&T UNIX
Based on the scans of manual pages available at
https://www.bell-labs.com/usr/dmr/www/man51.pdf,
which are a part of the following collection:
https://www.bell-labs.com/usr/dmr/www/1stEdman.html.

Obtained from:	NetBSD
Differential Revision:	https://reviews.freebsd.org/D25849
2020-08-02 16:59:14 +00:00
Mateusz Piotrowski
0b87619ffe Point to rc(8) for more details about the autoboot variable
Reviewed by:	bcr, imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25904
2020-07-31 14:13:26 +00:00
Mark Johnston
370b7cc904 ng_iface(4): Remove unsupported protocols.
Update the ng_iface documentation and hooks to reflect the fact that the
node currently only supports IPv4 and v6 packets.

Reviewed by:	Lutz Donnerhacke
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25862
2020-07-31 14:08:54 +00:00
John-Mark Gurney
aa6ea9b6ce remove some long abandonded serial drivers (cy, rc, rp) since 2008
Reviewed by:	phk (earlier version)
Reviewed by:	emaste (earlier version)
Reviewed by:	bcr (earlier version)
Reviewed by:	zeising (earlier version)
Differential Revision:	https://reviews.freebsd.org/D25874
2020-07-30 00:53:56 +00:00
John-Mark Gurney
40326c1718 add link to crypto(7) page, and drop a link to unrelated crypt(3) page.. 2020-07-29 21:15:06 +00:00
John Baldwin
b027b6637a Add further clarification on si_addr and si_trapno.
- In the initial description of si_addr, do not claim that it is
  always the faulting instruction.

- For si_addr, document that it is generally set to the PC for
  synchronous signals, but that it can be set to the the address of
  the faulting memory reference for some signals including SIGSEGV and
  SIGBUS.  In particular, while SIGSEGV generally sets si_addr to the
  faulting memory reference, SIGBUS can vary.  On some platforms, some
  SIGBUS signals set si_addr to the PC and other SIGBUS signals set
  si_addr to the faulting address depending on the specific hardware
  exception.

- For si_trapno, synchronous signals should set this to some value.

Reviewed by:	kib
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D25777
2020-07-28 17:09:15 +00:00
Mateusz Piotrowski
58f5de0d8a tree.3: Bump date after 363450 (WAVL)
While here:
- Address whitespace warnings.
- Start sentences on a new line.
2020-07-27 11:42:22 +00:00
Alexander Motin
aba10e131f Allow swi_sched() to be called from NMI context.
For purposes of handling hardware error reported via NMIs I need a way to
escape NMI context, being too restrictive to do something significant.

To do it this change introduces new swi_sched() flag SWI_FROMNMI, making
it careful about used KPIs.  On platforms allowing IPI sending from NMI
context (x86 for now) it immediately wakes clk_intr_event via new IPI_SWI,
otherwise it works just like SWI_DELAY.  To handle the delayed SWIs this
patch calls clk_intr_event on every hardclock() tick.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D25754
2020-07-25 15:19:38 +00:00
Mateusz Piotrowski
d6dade0002 Fix grammar issues and typos
Reported by:	ian
MFC after:	1 week
2020-07-24 15:04:34 +00:00
Mateusz Piotrowski
5ccb7079f8 Document that force_depend() supports only /etc/rc.d scripts
Currently, force_depend() from rc.subr(8) does not support depending on
scripts outside of /etc/rc.d (like /usr/local/etc/rc.d). The /etc/rc.d path
is hard-coded into force_depend().

MFC after:	1 week
2020-07-24 14:17:37 +00:00
John-Mark Gurney
b6dd8b71d1 fix up docs for m_getjcl as well.. 2020-07-24 00:47:14 +00:00
John-Mark Gurney
92b56ebaf7 document that m_get2 only accepts up to MJUMPAGESIZE.. 2020-07-24 00:35:21 +00:00
John Baldwin
3c0e568505 Add support for KTLS RX via software decryption.
Allow TLS records to be decrypted in the kernel after being received
by a NIC.  At a high level this is somewhat similar to software KTLS
for the transmit path except in reverse.  Protocols enqueue mbufs
containing encrypted TLS records (or portions of records) into the
tail of a socket buffer and the KTLS layer decrypts those records
before returning them to userland applications.  However, there is an
important difference:

- In the transmit case, the socket buffer is always a single "record"
  holding a chain of mbufs.  Not-yet-encrypted mbufs are marked not
  ready (M_NOTREADY) and released to protocols for transmit by marking
  mbufs ready once their data is encrypted.

- In the receive case, incoming (encrypted) data appended to the
  socket buffer is still a single stream of data from the protocol,
  but decrypted TLS records are stored as separate records in the
  socket buffer and read individually via recvmsg().

Initially I tried to make this work by marking incoming mbufs as
M_NOTREADY, but there didn't seemed to be a non-gross way to deal with
picking a portion of the mbuf chain and turning it into a new record
in the socket buffer after decrypting the TLS record it contained
(along with prepending a control message).  Also, such mbufs would
also need to be "pinned" in some way while they are being decrypted
such that a concurrent sbcut() wouldn't free them out from under the
thread performing decryption.

As such, I settled on the following solution:

- Socket buffers now contain an additional chain of mbufs (sb_mtls,
  sb_mtlstail, and sb_tlscc) containing encrypted mbufs appended by
  the protocol layer.  These mbufs are still marked M_NOTREADY, but
  soreceive*() generally don't know about them (except that they will
  block waiting for data to be decrypted for a blocking read).

- Each time a new mbuf is appended to this TLS mbuf chain, the socket
  buffer peeks at the TLS record header at the head of the chain to
  determine the encrypted record's length.  If enough data is queued
  for the TLS record, the socket is placed on a per-CPU TLS workqueue
  (reusing the existing KTLS workqueues and worker threads).

- The worker thread loops over the TLS mbuf chain decrypting records
  until it runs out of data.  Each record is detached from the TLS
  mbuf chain while it is being decrypted to keep the mbufs "pinned".
  However, a new sb_dtlscc field tracks the character count of the
  detached record and sbcut()/sbdrop() is updated to account for the
  detached record.  After the record is decrypted, the worker thread
  first checks to see if sbcut() dropped the record.  If so, it is
  freed (can happen when a socket is closed with pending data).
  Otherwise, the header and trailer are stripped from the original
  mbufs, a control message is created holding the decrypted TLS
  header, and the decrypted TLS record is appended to the "normal"
  socket buffer chain.

(Side note: the SBCHECK() infrastucture was very useful as I was
 able to add assertions there about the TLS chain that caught several
 bugs during development.)

Tested by:	rmacklem (various versions)
Relnotes:	yes
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D24628
2020-07-23 23:48:18 +00:00
Doug Moore
e605dcc939 Rank balanced (RB) trees are a class of balanced trees that includes
AVL trees, red-black trees, and others. Weak AVL (wavl) trees are a
recently discovered member of that class. This change replaces
red-black rebalancing with weak AVL rebalancing in the RB tree macros.

Wavl trees sit between AVL and red-black trees in terms of how
strictly balance is enforced. They have the stricter balance of AVL
trees as the tree is built - a wavl tree is an AVL tree until the
first deletion. Once removals start, wavl trees are lazier about
rebalancing than AVL trees, so that removals can be fast, but the
balance of the tree can decay to that of a red-black tree. Subsequent
insertions can push balance back toward the stricter AVL conditions.

Removing a node from a wavl tree never requires more than two
rotations, which is better than either red-black or AVL
trees. Inserting a node into a wavl tree never requires more than two
rotations, which matches red-black and AVL trees. The only
disadvantage of wavl trees to red-black trees is that more insertions
are likely to adjust the tree a bit. That's the cost of keeping the
tree more balanced.

Testing has shown that for the cases where red-black trees do worst,
wavl trees better balance leads to faster lookups, so that if lookups
outnumber insertions by a nontrivial amount, lookup time saved exceeds
the extra cost of balancing.

Reviewed by:	alc, gbe, markj
Tested by:	pho
Discussed with:	emaste
Differential Revision:	https://reviews.freebsd.org/D25480
2020-07-23 17:16:20 +00:00
Edward Tomasz Napierala
55ec696d42 Add missing bitset(9) MLINKS.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D25713
2020-07-19 12:22:32 +00:00