Home | History | Annotate | Download | only in altq
History log of /src/sys/altq/altq_cdnr.c
RevisionDateAuthorComments
 1.23  08-Jan-2025  joe return: remove parenthesis from return statements
 1.22  21-Sep-2021  christos branches: 1.22.6;
Remove FreeBSD blocks that did not compile anyway, and use l->l_cred
consistently.
 1.21  10-Jun-2016  ozaki-r Avoid storing a pointer of an interface in a mbuf

Having a pointer of an interface in a mbuf isn't safe if we remove big
kernel locks; an interface object (ifnet) can be destroyed anytime in any
packet processing and accessing such object via a pointer is racy. Instead
we have to get an object from the interface collection (ifindex2ifnet) via
an interface index (if_index) that is stored to a mbuf instead of an
pointer.

The change provides two APIs: m_{get,put}_rcvif_psref that use psref(9)
for sleep-able critical sections and m_{get,put}_rcvif that use
pserialize(9) for other critical sections. The change also adds another
API called m_get_rcvif_NOMPSAFE, that is NOT MP-safe and for transition
moratorium, i.e., it is intended to be used for places where are not
planned to be MP-ified soon.

The change adds some overhead due to psref to performance sensitive paths,
however the overhead is not serious, 2% down at worst.

Proposed on tech-kern and tech-net.
 1.20  19-Nov-2011  tls branches: 1.20.8; 1.20.26;
First step of random number subsystem rework described in
<20111022023242.BA26F14A158@mail.netbsd.org>. This change includes
the following:

An initial cleanup and minor reorganization of the entropy pool
code in sys/dev/rnd.c and sys/dev/rndpool.c. Several bugs are
fixed. Some effort is made to accumulate entropy more quickly at
boot time.

A generic interface, "rndsink", is added, for stream generators to
request that they be re-keyed with good quality entropy from the pool
as soon as it is available.

The arc4random()/arc4randbytes() implementation in libkern is
adjusted to use the rndsink interface for rekeying, which helps
address the problem of low-quality keys at boot time.

An implementation of the FIPS 140-2 statistical tests for random
number generator quality is provided (libkern/rngtest.c). This
is based on Greg Rose's implementation from Qualcomm.

A new random stream generator, nist_ctr_drbg, is provided. It is
based on an implementation of the NIST SP800-90 CTR_DRBG by
Henric Jungheim. This generator users AES in a modified counter
mode to generate a backtracking-resistant random stream.

An abstraction layer, "cprng", is provided for in-kernel consumers
of randomness. The arc4random/arc4randbytes API is deprecated for
in-kernel use. It is replaced by "cprng_strong". The current
cprng_fast implementation wraps the existing arc4random
implementation. The current cprng_strong implementation wraps the
new CTR_DRBG implementation. Both interfaces are rekeyed from
the entropy pool automatically at intervals justifiable from best
current cryptographic practice.

In some quick tests, cprng_fast() is about the same speed as
the old arc4randbytes(), and cprng_strong() is about 20% faster
than rnd_extract_data(). Performance is expected to improve.

The AES code in src/crypto/rijndael is no longer an optional
kernel component, as it is required by cprng_strong, which is
not an optional kernel component.

The entropy pool output is subjected to the rngtest tests at
startup time; if it fails, the system will reboot. There is
approximately a 3/10000 chance of a false positive from these
tests. Entropy pool _input_ from hardware random numbers is
subjected to the rngtest tests at attach time, as well as the
FIPS continuous-output test, to detect bad or stuck hardware
RNGs; if any are detected, they are detached, but the system
continues to run.

A problem with rndctl(8) is fixed -- datastructures with
pointers in arrays are no longer passed to userspace (this
was not a security problem, but rather a major issue for
compat32). A new kernel will require a new rndctl.

The sysctl kern.arandom() and kern.urandom() nodes are hooked
up to the new generators, but the /dev/*random pseudodevices
are not, yet.

Manual pages for the new kernel interfaces are forthcoming.
 1.19  04-Mar-2007  christos branches: 1.19.76;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.18  16-Nov-2006  christos branches: 1.18.4;
__unused removal on arguments; approved by core.
 1.17  20-Oct-2006  elad Kill some KAUTH_GENERIC_ISSUSER.
 1.16  12-Oct-2006  peter Merge the peter-altq branch.

(sync with KAME & add support for using ALTQ with pf(4)).
 1.15  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.14  21-Jul-2006  ad branches: 1.14.4; 1.14.6;
- Use the LWP cached credentials where sane.
- Minor cosmetic changes.
 1.13  15-May-2006  christos kauth fallout
 1.12  14-May-2006  elad integrate kauth.
 1.11  23-Apr-2006  christos Use malloc/free instead of MALLOC/FREE and M_ZERO instead of memset.
 1.10  11-Dec-2005  christos branches: 1.10.4; 1.10.6; 1.10.8; 1.10.10; 1.10.12;
merge ktrace-lwp.
 1.9  26-Feb-2005  perry branches: 1.9.4;
nuke trailing whitespace
 1.8  13-Feb-2004  wiz branches: 1.8.8; 1.8.10;
Uppercase CPU, plural is CPUs.
 1.7  09-Nov-2003  christos - kill bzero/bcopy
- defopt stats and settings, removing their definitions from the files
- make code compile by eliminating multicharacter constants!?! and rearranging
variable declarations so they are defined before used!?!
- help gcc with uninitialized variables
 1.6  07-Oct-2003  mycroft There is NO reason to use arc4random() here, and it needlessly slows down the
forwarding path, so goodbye.
 1.5  05-Sep-2003  itojun use arc4random. sync w/ kame
 1.4  12-Nov-2001  lukem branches: 1.4.16;
add RCSIDs
 1.3  13-Apr-2001  thorpej branches: 1.3.2; 1.3.4;
Remove the use of splimp() from the NetBSD kernel. splnet()
and only splnet() is allowed for the protection of data structures
used by network devices.
 1.2  14-Dec-2000  thorpej branches: 1.2.2; 1.2.4;
Add NetBSD RCS IDs.
 1.1  14-Dec-2000  thorpej branches: 1.1.1;
Initial revision
 1.1.1.1  14-Dec-2000  thorpej Import ALTQ from KAME.
 1.2.4.2  14-Nov-2001  nathanw Catch up to -current.
 1.2.4.1  21-Jun-2001  nathanw Catch up to -current.
 1.2.2.3  21-Apr-2001  bouyer Sync with HEAD
 1.2.2.2  05-Jan-2001  bouyer Sync with HEAD
 1.2.2.1  14-Dec-2000  bouyer file altq_cdnr.c was added on branch thorpej_scsipi on 2001-01-05 17:39:36 +0000
 1.3.4.1  10-Oct-2001  fvdl Convert all remaining devices.
 1.3.2.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.16.5  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.4.16.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.16.3  18-Sep-2004  skrll Sync with HEAD.
 1.4.16.2  12-Aug-2004  skrll Adapt to new world order.
 1.4.16.1  03-Aug-2004  skrll Sync with HEAD
 1.8.10.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.8.8.1  29-Apr-2005  kent sync with -current
 1.9.4.3  03-Sep-2007  yamt sync with head.
 1.9.4.2  30-Dec-2006  yamt sync with head.
 1.9.4.1  21-Jun-2006  yamt sync with head.
 1.10.12.3  25-Sep-2006  peter sync with head.
 1.10.12.2  09-Jun-2006  peter Merge 2006-05-24 NetBSD-current into the peter-altq branch.
 1.10.12.1  18-Mar-2006  peter Sync with KAME.
 1.10.10.3  11-May-2006  elad sync with head
 1.10.10.2  10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.10.10.1  08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.10.8.2  11-Aug-2006  yamt sync with head
 1.10.8.1  24-May-2006  yamt sync with head.
 1.10.6.1  01-Jun-2006  kardel Sync with head.
 1.10.4.1  09-Sep-2006  rpaulo sync with head
 1.14.6.2  10-Dec-2006  yamt sync with head.
 1.14.6.1  22-Oct-2006  yamt sync with head
 1.14.4.1  18-Nov-2006  ad Sync with head.
 1.18.4.1  12-Mar-2007  rmind Sync with HEAD.
 1.19.76.1  17-Apr-2012  yamt sync with head
 1.20.26.1  09-Jul-2016  skrll Sync with HEAD
 1.20.8.1  03-Dec-2017  jdolecek update from HEAD
 1.22.6.1  11-Nov-2023  thorpej branches: 1.22.6.1.2;
Mostly de-tangle ifnet::if_snd from ifaltq, in a way that's minimally-
invasive to the ALTQ code itself.

The point of this is to lay the groundwork for future changes to ifqueue,
which among other benefits, will also hide the ALTQ ABI from drivers.
 1.22.6.1.2.1  15-Nov-2023  thorpej Protect the ALTQ state that's exposed to the ifqueue if the ifq->ifq_lock.
This requires exposing some implementation details to ALTQ, which is guarded
by an __IFQ_PRIVATE define.

RSS XML Feed