Commit Graph

2585 Commits

Author SHA1 Message Date
Fabien Thomas
39bbca6ffd crypto(9) is called from ipsec in CRYPTO_F_CBIFSYNC mode. This is working
fine when a lot of different flows to be ciphered/deciphered are involved.

However, when a software crypto driver is used, there are
situations where we could benefit from making crypto(9) multi threaded:
- a single flow is to be ciphered: only one thread is used to cipher it,
- a single ESP flow is to be deciphered: only one thread is used to
decipher it.

The idea here is to call crypto(9) using a new mode (CRYPTO_F_ASYNC) to
dispatch the crypto jobs on multiple threads, if the underlying crypto
driver is working in synchronous mode.

Another flag is added (CRYPTO_F_ASYNC_KEEPORDER) to make crypto(9)
dispatch the crypto jobs in the order they are received (an additional
queue/thread is used), so that the packets are reinjected in the network
using the same order they were posted.

A new sysctl net.inet.ipsec.async_crypto can be used to activate
this new behavior (disabled by default).

Submitted by:	Emeric Poupon <emeric.poupon@stormshield.eu>
Reviewed by:	ae, jmg, jhb
Differential Revision:    https://reviews.freebsd.org/D10680
Sponsored by:	Stormshield
2017-11-03 10:27:22 +00:00
Eitan Adler
a2aef24aa3 Update several more URLs
- Primarily http -> https
- Primarily FreeBSD project URLs
2017-10-29 08:17:03 +00:00
Mariusz Zaborski
23c5a51e92 Introduce cnvlist_name() and cnvlist_type() functions.
Those function can be used when we are iterating over nvlist to reduce
amount of extra variables we need to declare.

MFC after:	1 month
2017-10-26 20:44:42 +00:00
Konstantin Belousov
c9b6b5826c Expand explanation of atomicity.
Mention per-location total order, out of thin air, and torn writes
guarantees.  Mention C11 standard' memory model and one most important
FreeBSD additional requirement, that is aligned ordinary loads and
stores are atomic on processors.

The text is introductional and informal.  Reference the C11 and
C++1{1,4,7} standards for authorative description.

In collaboration with:	alc
Sponsored by:	The FreeBSD Foundation (kib)
MFC after:	1 week
2017-10-23 16:14:55 +00:00
Brooks Davis
39ed7f250a Remove mbpool(9) now that it has no consumers.
mbpool existed to support NICs with memory interfaces and all remaining
comsumers were removed earlier this year with NATM.

Reviewed by:	jhb
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D10513
2017-10-18 00:18:03 +00:00
Matt Joras
333dcaa498 Add clearing function for unr(9).
Previously before you could call unrhdr_delete you needed to
individually free every allocated unit. It is useful to be able to tear
down the unr without having to go through this process, as it is
significantly faster than freeing the individual units.

Reviewed by:	cem, lidl
Approved by:	rstone (mentor)
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D12591
2017-10-11 21:53:50 +00:00
Ed Maste
e312709278 sysctl.9: document CTLFLAG_CAPRD and CTLFLAG_CAPWR
Reported by:	Shawn Webb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2017-10-10 23:54:25 +00:00
Gleb Smirnoff
e8fd18f306 Shorten list of arguments to mbuf external storage freeing function.
All of these arguments are stored in m_ext, so there is no reason
to pass them in the argument list.  Not all functions need the second
argument, some don't even need the first one.  The second argument
lives in next cache line, so not dereferencing it is a performance
gain.  This was discovered in sendfile(2), which will be covered by
next commits.

The second goal of this commit is to bring even more flexibility
to m_ext mbufs, allowing to create more fields in m_ext, opaque to
the generic mbuf code, and potentially set and dereferenced by
subsystems.

Reviewed by:	gallatin, kbowling
Differential Revision:	https://reviews.freebsd.org/D12615
2017-10-09 20:35:31 +00:00
Ian Lepore
fc09164658 Restore the ability to deregister an eventhandler from within the callback.
When the EVENTHANDLER(9) subsystem was created, it was a documented feature
that an eventhandler callback function could safely deregister itself. In
r200652 that feature was inadvertantly broken by adding drain-wait logic to
eventhandler_deregister(), so that it would be safe to unload a module upon
return from deregistering its event handlers.

There are now 145 callers of EVENTHANDLER_DEREGISTER(), and it's likely many
of them are depending on the drain-wait logic that has been in place for 8
years. So instead of creating a separate eventhandler_drain() and adding it
to some or all of those 145 call sites, this creates a separate
eventhandler_drain_nowait() function for the specific purpose of
deregistering a callback from within the running callback.

Differential Revision:	https://reviews.freebsd.org/D12561
2017-10-08 17:21:16 +00:00
Mark Johnston
f38c0c46c5 Let stack_create(9) take a malloc flags argument.
Reviewed by:	cem
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D12614
2017-10-06 21:52:28 +00:00
Mateusz Guzik
0da36218ad Remove manpage entries about crshared(9)
The function itself was removed years ago in r272546

Submitted by:	Paulm <paulm tetrardus.net>
MFC after:	2 weeks
2017-09-27 01:12:47 +00:00
Mariusz Zaborski
c8ada1920c Add missing links to the nv man page.
MFC after:	1 week
2017-09-16 17:52:25 +00:00
Mariusz Zaborski
a1b5ae3326 Fix names of the array functions in the nv man page.
Submitted by:	def@
MFC after:	1 week
2017-09-16 17:50:24 +00:00
Lawrence Stewart
a8ec96af28 Implement simple record boundary tracking in sbuf(9) to avoid record splitting
during drain operations. When an sbuf is configured to use this feature by way
of the SBUF_DRAINTOEOR sbuf_new() flag, top-level sections started with
sbuf_start_section() create a record boundary marker that is used to avoid
flushing partial records.

Reviewed by:	cem,imp,wblock
MFC after:	2 weeks
Sponsored by:	Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D8536
2017-08-17 07:20:09 +00:00
Ian Lepore
2db14f97de Add config_intrhook_oneshot(): schedule an intrhook function and unregister
it automatically after it runs.

The config_intrhook mechanism allows a driver to stall the boot process
until device(s) required for booting are available, by not allowing system
inits to proceed until all intrhook functions have been unregistered.
Virtually all existing code simply unregisters from within the hook function
when it gets called.

This new function makes that common usage more convenient. Instead of
allocating and filling in a struct, passing it to a function that might (in
theory) fail, and checking the return code, now a driver can simply call
this cannot-fail routine, passing just the intrhook function and its arg.

Differential Revision:	https://reviews.freebsd.org/D11963
2017-08-13 18:10:24 +00:00
Warner Losh
d3517d306c Expose API to allow disks to ask for alias names in devfs.
Implement disk_add_alias to allow aliases to be added to disks. All
disk have a primary name (say "foo") can also have secondary names
(say "bar") such that all instances of "foo" also have a "bar"
alias. So if you have foo0, foo0p1, foo1, foo1s1 and foo1s1a nodes
created by the foo driver and gpart, device nodes bar0, bar0p1, bar1,
bar1s1 and bar1s1a will appear as symlinks back to the original nodes.
This generalizes to multiple aliases. However, since the unit number
follows the primary name, multiple device drivers can't create the
same aliases unless those drives coorinate the unit number space (eg
you couldn't add an alias 'disk' to both 'da' and 'ada' because it's
possible to have da0 and ada0, because 'disk0' is ambiguous).

Differential Revision: https://reviews.freebsd.org/D11873
2017-08-07 21:12:38 +00:00
Ian Lepore
f37b7fc2d4 Add taskqueue_enqueue_timeout_sbt(), because sometimes you want more control
over the scheduling precision than 'ticks' can offer, and because sometimes
you're already working with sbintime_t units and it's dumb to convert them
to ticks just so they can get converted back to sbintime_t under the hood.
2017-07-31 00:54:50 +00:00
Konstantin Belousov
e967aa2682 Improve BIT_FLS() documentation.
Submitted by:	Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after:	6 days
2017-07-07 05:43:44 +00:00
Konstantin Belousov
1550c62236 Add BIT_FLS() analogous to BIT_FFS().
The benefit of BIT_FLS() is that ffsl() can be implemented with a
count leading zeros instruction which is more widespread available.

Submitted by:	Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after:	1 week
2017-07-06 21:47:17 +00:00
Eric van Gyzen
58771f908d copy(9): clarify that copystr() does not return EFAULT
The previous wording implied that copystr() could return EFAULT.

MFC after:	6 weeks
Sponsored by:	Dell EMC
2017-06-15 21:34:43 +00:00
Jonathan T. Looney
dc6a41b936 Add the infrastructure to support loading multiple versions of TCP
stack modules.

It adds support for mangling symbols exported by a module by prepending
a string to them. (This avoids overlapping symbols in the kernel linker.)

It allows the use of a macro as the module name in the DECLARE_MACRO()
and MACRO_VERSION() macros.

It allows the code to register stack aliases (e.g. both a generic name
["default"] and version-specific name ["default_10_3p1"]).

With these changes, it is trivial to compile TCP stack modules with
the name defined in the Makefile and to load multiple versions of the
same stack simultaneously. This functionality can be used to enable
side-by-side testing of an old and new version of the same TCP stack.
It also could support upgrading the TCP stack without a reboot.

Reviewed by:	gnn, sjg (makefiles only)
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D11086
2017-06-08 20:41:28 +00:00
Eric van Gyzen
c8de781de7 getenv(9): rename to "kern_getenv", etc.
Update the documentation to catch up with r273174, which renamed
      getenv -> kern_getenv
      setenv -> kern_setenv
    unsetenv -> kern_unsetenv

Leave the old links in place to support finger memory.

MFC after:	3 days
Sponsored by:	Dell EMC
2017-06-01 21:07:25 +00:00
Glen Barber
9a7af23f46 Update the "first appeared in" version in several manual pages.
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2017-05-24 17:47:49 +00:00
Konstantin Belousov
e058e1c43c Add BIT_OR2(), BIT_AND2(), BIT_NAND2(), BIT_XOR() and BIT_XOR2().
Submitted by:	Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after:	2 weeks
2017-05-24 10:09:54 +00:00
Kevin Lo
7e9a9bd4a0 Add missing MLINKS for functions decribed in iflibdd(9), iflibdi(9), and
iflibtxrx(9).
2017-05-24 01:03:30 +00:00
Kevin Lo
74d1f4c86f Remove duplicate definition of iflib_led_create(). 2017-05-24 01:01:43 +00:00
John Baldwin
00f6cd3f56 Add sglist_append_sglist().
This function permits a range of one scatter/gather list to be appended to
another sglist.  This can be used to construct a scatter/gather list that
reorders or duplicates ranges from one or more existing scatter/gather
lists.

Sponsored by:	Chelsio Communications
2017-05-16 23:31:52 +00:00
Benjamin Kaduk
853e9ff25c Bring VOP_GETPAGES.9 more up-to-date
Attempt to catch up to the KPI changes from r292373, and perform
some other tidying while in the area.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D10579
2017-05-07 19:01:08 +00:00
Brooks Davis
0607c830b3 More ATM and NATM removal
Submitted by:	ak
Reviewed by:	ngie
Differential Revision:	https://reviews.freebsd.org/D10511
2017-04-27 16:05:12 +00:00
Gleb Smirnoff
9dc2c43254 UMA_ZONE_REFCNT was removed.
PR:		209715
Submitted by:	Fabian Keil <fk fabiankeil.de>
MFC after:	3 days
2017-04-26 17:55:43 +00:00
Enji Cooper
128668745b sbuf(9): add MLINKS for sbuf_{clear,get,set}_flags(9)
These functions were added in r279992.

MFC after:	2 months
Sponsored by:	Dell EMC Isilon
2017-04-06 05:02:03 +00:00
Enji Cooper
e90ede1cc8 sbuf(9): clarify kernel-only APIs
- move sbuf_bcopyin(9) and sbuf_copyin(9) near sbuf_new_for_sysctl(9), as
  all three functions are kernel-only APIs.
- add #ifdef _KERNEL around sbuf_*copyin and sbuf_new_for_sysctl(9) to
  make it visually clear that they are kernel-only APIs.

MFC after:	2 months
Sponsored by:	Dell EMC Isilon
2017-04-06 02:46:09 +00:00
Enji Cooper
a6848fd560 sbuf(9): convert SYNOPSIS section from .Fn entries to .Fo/.Fa/.Fc entries
This shortens the column count on many lines considerably.

While here, add "(void)" to sbuf_new_auto(3) for consistency with style(9)
recommendations.

MFC after:	2 months
Sponsored by:	Dell EMC Isilon
2017-04-06 02:40:52 +00:00
Enji Cooper
7beb104d30 Add sys/types.h #include to EXAMPLE to provide a complete functional
standalone example program

MFC after:	2 months
Sponsored by:	Dell EMC Isilon
2017-04-06 02:03:35 +00:00
Edward Tomasz Napierala
b5111c4612 Document EVENTHANDLER_DEFINE(9).
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-03-27 20:32:12 +00:00
Edward Tomasz Napierala
d6f255f26a The cn_consume was removed in r296716.
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-03-27 20:28:56 +00:00
Sergey Kandaurov
aceea44d31 Fix pfil_add_hook() and pfil_remove_hook() type. 2017-03-27 14:32:34 +00:00
Robert Watson
2cb4684480 Slightly improve consistency of "fooint" vs "foo_int" in DPCPU(9) examples.
MFC after:	3 days
2017-03-26 20:24:27 +00:00
Robert Watson
8509f6321a Add a man page for the kernel's dynamic per-CPU memory allocator.
MFC after: 3 days
2017-03-26 20:15:08 +00:00
Enji Cooper
fa5045467b Try polishing up iflib manpages a bit (basically all the low hanging fruit)
igor:
- Fix typos.
- Delete trailing whitespace.

manlint:
- Use .Fo/.Fc/.Fa when describing functions.
- Use .Xr.
- Fill in SEE ALSO section.
- Fix .Dt use: the section was specified incorrectly and the name
  had a lowercase character.
- Continue new sentences on new lines.

Miscellaneous:
- Remove unnecessary quotes around "SEE ALSO" section headers.
- Sprinkle .Dv use in spots with constants.

Reported by:	igor, make manlint
Sponsored by:	Dell EMC Isilon
2017-03-23 07:36:38 +00:00
Enji Cooper
2958b3a40c PCI_IOV_*INIT(9): fix make manlint warnings
Add missing section number when referring to PCI_IOV_*INIT(9) with .Xr
from the other corresponding manpage.

MFC after:	1 week
Reported by:	make manlint
Sponsored by:	Dell EMC Isilon
2017-03-23 06:11:31 +00:00
Enji Cooper
02e7c2cbab memguard(9): fix igor/manlint warnings
- Expand a contraction [1].
- Add a missing section number when referring to uma(9) with .Xr .

MFC after:	1 week
Reported by:	igor [1], make manlint [2]
Sponsored by:	Dell EMC Isilon
2017-03-23 06:08:01 +00:00
Enji Cooper
114af3cd74 ifnet(9): fix some igor/manlint warnings
- Fix typos (queueing -> queuing) [1].
- Add missing section number for polling .Xr reference [2].

MFC after:	1 week
Reported by:	igor [1], make manlint [2]
Sponsored by:	Dell EMC Isilon
2017-03-23 06:02:23 +00:00
Enji Cooper
054cb42fff dnv(9): fix use of commas with .Nm in NAME section
MFC after:	1 week
Reported by:	make manlint
Sponsored by:	Dell EMC Isilon
2017-03-23 05:54:07 +00:00
Enji Cooper
640ca09ddb counter(9): fix igor/manlint warnings
- Reword description of `counter_enter` slightly to fix
  wordiness [1].
- Expand "isn't" as "is not" [1].
- Add missing section number with .Xr sysctl calls [2].

MFC after:	1 week
Reported by:	igor [1], make manlint [2]
Sponsored by:	Dell EMC Isilon
2017-03-23 05:51:54 +00:00
Enji Cooper
70284f8553 DB_COMMAND(9): fix mandoc markup
Start new sentences on new lines.

MFC after:	1 week
Reported by:	make manlint
Sponsored by:	Dell EMC Isilon
2017-03-23 05:44:18 +00:00
Enji Cooper
df3d220fc5 buf_ring(9): fix mandoc markup
Remove spurious trailing comma after `buf_ring_peek` in the NAME
section.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-23 05:41:56 +00:00
Enji Cooper
7eadf51252 bus_alloc_resource(9): fix mandoc markup
Add missing comma after `.Nm bus_alloc_resource_any` in NAME section.

MFC after:	1 week
Reported by:	make manlint
Sponsored by:	Dell EMC Isilon
2017-03-23 05:38:57 +00:00
Enji Cooper
445deb63de alq(9): fix mandoc markup
Start new sentence on a new line.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-23 05:37:04 +00:00
Mark Johnston
3d6732549d Add support for 8- and 16-bit atomic_(f)cmpset to x86.
Reviewed by:	kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D10068
2017-03-22 17:29:04 +00:00