FreeBSD/src fd74d1esys/dev/oce oce_mbox.c

oce: Use the common RSS key

Fill the RSS configuration request with the common 40-byte key instead
of fresh random bytes.  Preserve the mailbox representation, hash
selection, and indirection table.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59797
DeltaFile
+4-1sys/dev/oce/oce_mbox.c
+4-11 files

FreeBSD/src 9b374adsys/dev/bxe bxe.c

bxe: Program the common RSS key in searcher byte order

Use the common RSS key instead of generating private random words.
Reverse the bytes before passing the key to the shared code, which copies
the supplied bytes directly into the firmware request.  The searcher
consumes this array in reverse order; a raw copy of the common key would
not produce matching Toeplitz hashes.

The hardware ordering is documented by Linux commit
d682d2bdc30650a5c7ce9908ab83ab674b658744 ("bnx2x: byte swap rss_key to
comply to Toeplitz specs").  Keep the conversion in the FreeBSD caller
rather than changing the shared-code interface.

Preserve the config_hash gate, including the PMF-only key programming
on 57710/57711, and leave hash types and indirection policy unchanged.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59796
DeltaFile
+10-5sys/dev/bxe/bxe.c
+10-51 files

FreeBSD/src e94de94sys/dev/axgbe if_axgbe_pci.c

axgbe: Use the common RSS key without options RSS

Fetch the common key in the PCI iflib frontend regardless of options RSS
and make the key API declaration available in both configurations.
Retain the existing hash-field selection and queue-placement branches.
The independent ARM frontend is unchanged.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59794
DeltaFile
+6-4sys/dev/axgbe/if_axgbe_pci.c
+6-41 files

FreeBSD/src 772994dsys/dev/aq aq_main.c

aq: Use the common RSS key without options RSS

Fetch the common RSS key independently of options RSS instead of
generating a private key in non-RSS kernels.  Keep the existing
software-RSS or round-robin indirection policy and hardware key
serialization unchanged.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59793
DeltaFile
+3-2sys/dev/aq/aq_main.c
+3-21 files

FreeBSD/src a666f15sys/dev/e1000 if_em.h if_em.c

e1000: Use the common RSS key for 82574

Use rss_getkey() in the older em multi-queue RSS path, which is reached
by 82574 with two receive queues.  This replaces a private key generated
on each initialization and matches the common-key policy already used
by the igb path.

Decode each register word with le32dec() and remove the private assembly
macro, avoiding signed integer shifts while preserving the register byte
order.  Leave the redirection table and hash fields unchanged.  This does
not change single-queue em devices or PF-owned igb VF RSS settings.

Reviewed by:    erj, gallatin
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59792
DeltaFile
+4-2sys/dev/e1000/if_em.c
+0-5sys/dev/e1000/if_em.h
+4-72 files

FreeBSD/src 58031cbsys/netpfil/ipfw ip_fw_log.c dn_sched_qfq.c

ipfw: cleanup !FreeBSD and !_KERNEL code

These are leftovers from last import from Luigi Rizzo in 2013, that were
never compiled checked since and lots of changes have had happened since
and more changes to come.  Let's not pretend ipfw is buildable on
something else than FreeBSD nor it can be compiled for userland.

Reviewed by:            lytboris_gmail.com
Differential Revision:  https://reviews.freebsd.org/D59427
DeltaFile
+0-39sys/netpfil/ipfw/ip_fw2.c
+0-28sys/netpfil/ipfw/ip_dn_private.h
+0-28sys/netpfil/ipfw/ip_dn_io.c
+0-20sys/netpfil/ipfw/dn_sched_qfq.c
+0-5sys/netpfil/ipfw/ip_fw_log.c
+0-1205 files

FreeBSD/src 08f0a1bsys/netpfil/ipfw ip_fw2.c

ipfw: use typed pointers to access network protocols headers where possible

The 'void *ulp' is still in action, but where possible prefer a typed
pointer.  Get rid of associated pre-processor macros.

Differential Revision:  https://reviews.freebsd.org/D59435
DeltaFile
+128-107sys/netpfil/ipfw/ip_fw2.c
+128-1071 files

FreeBSD/src 5f81426sys/netpfil/ipfw ip_fw2.c

ipfw: refactor macros around m_pullup()

In the prologue, where we check if the argument is a memory or an mbuf
chain, do not set 'struct ip *ip' pointer.  However, set the 'struct
ether_header *eh' pointer there and set Etherner header length in 'ehlen'.
Side effect of this refactor is that now Layer 2 hooks may send mbufs with
ETHERTYPE_VLAN frames.  However, current network stack doesn't do that.

Write a new PULLUP() macro that would take type of the argument to
determine how much to pull.  Unlike PULLUP_TO() this macro can take typed
pointer.  This will allow to get rid of 'void *ulp' and bunch of casting
macros in the next change.  Use local bool variable to see if we need to
unlock upon jump to pullup_failed.  Embed pointer update into the branch
of the macro, where pointers indeed need an update.

Use new PULLUP() macro to pullup initial 'struct ip *ip' and 'struct
ip6_hdr *ip6'.  This removes max_protohdr sized pullup, that previously
tried to pull more than an unmapped mbuf could yield, fixing a bug covered
by the testcase sys/netpfil/ipfw/unmapped.

    [3 lines not shown]
DeltaFile
+77-103sys/netpfil/ipfw/ip_fw2.c
+77-1031 files

FreeBSD/src 0f7bdeasys/dev/ixl ixl.h ixl_pf_main.c

ixl: Initialize the extended RSS key

Zero the complete 52-byte RSS key buffer before fetching the common
40-byte key.  Both the X722 AdminQ path and the register path consume all
52 bytes; the trailing extended-key bytes must not come from uninitialized
stack storage.  This matches the zero padding already used by iavf and ice.

Remove the unused driver-default key helper and its declaration.  Keep
the standard key, hash selections, and indirection policy unchanged.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59791
DeltaFile
+0-17sys/dev/ixl/ixl_txrx.c
+1-1sys/dev/ixl/ixl_pf_main.c
+0-1sys/dev/ixl/ixl.h
+1-193 files

FreeBSD/src 7f1e93bsys/dev/iavf iavf_lib.h iavf_iflib.h

iavf: Use the common RSS key without options RSS

Use rss_getkey() when programming the RSS key through virtchnl regardless
of options RSS, matching the register-programming path.  The common key
is available independently of RSS queue placement; the driver-specific
default otherwise makes the chosen key depend on the PF's configuration
interface.

Remove the unused default-key helper and its declarations.  Preserve the
negotiated key length, zero padding, hash selections, and indirection-table
policy.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59790
DeltaFile
+0-23sys/dev/iavf/iavf_lib.c
+0-4sys/dev/iavf/iavf_vc_common.c
+0-1sys/dev/iavf/iavf_lib.h
+0-1sys/dev/iavf/iavf_iflib.h
+0-294 files

FreeBSD/src 8aab44csys/netinet in_var.h ip_var.h, sys/netinet6 in6_var.h ip6_var.h

netinet6?: move struct ip6?_moptions definition to in6?_var.h

Rest of multicast related kernel structures live in in6?_var.h and this
piece of ip6?_var.h was anyway requiring in6?_var.h to be included before.

Differential Revision:  https://reviews.freebsd.org/D55963
DeltaFile
+1-18sys/netinet/ip_var.h
+1-15sys/netinet6/ip6_var.h
+11-3sys/netinet/in_var.h
+9-3sys/netinet6/in6_var.h
+22-394 files

FreeBSD/src 599c3d7sys/net bpf_ifnet.c

bpf: assert that calculated header length fits in sockaddr

Differential Revision:  https://reviews.freebsd.org/D59140
DeltaFile
+1-0sys/net/bpf_ifnet.c
+1-01 files

FreeBSD/src 32b8381sys/dev/ixgbe ixgbe.h if_ixv.c

ixv: Report the programmed VF RSS configuration

Provide the iflib RSS query methods for X550 and newer VFs, whose RSS key
and hash types are programmed by the VF.  Cache those values and answer
queries under the context lock, without register reads or mailbox
transactions.  Invalidate the snapshot at init, stop, and when an admin
check requests recovery after losing the PF mailbox or detecting reset.
Reject queries while the snapshot or mailbox is unavailable.

Program the common RSS key and cache the values written to the registers.
The key remains stable across resets, including live MTU and capability
changes for which hn(4) can retain its copy without another VF handoff.

Serialize the key in register byte order and report the six supported
IPv4/IPv6 TCP/UDP hash selections from the programmed MRQC, rather than
claiming that every globally requested hash type is enabled.  A single
receive queue still performs Toeplitz hashing.  Older VFs retain
EOPNOTSUPP because their PF-owned RSS settings are not available here.
This allows hn(4) to synchronize synthetic RSS with the actual VF

    [6 lines not shown]
DeltaFile
+75-4sys/dev/ixgbe/if_ixv.c
+3-0sys/dev/ixgbe/ixgbe.h
+78-42 files

FreeBSD/src 709d7cfsys/dev/ixgbe if_ixv.c if_ix.c

ixgbe: Use the common RSS key without options RSS

Use rss_getkey() for PF and VF RSS programming even when options RSS is
not configured.  The common key is available independently of RSS queue
placement and is also used by software hashing.  Generating a private key
on each initialization defeats that agreement and changes receive hashes
across resets.

Leave hash-field selection and indirection-table placement unchanged.
82599 and X540 VFs retain their PF-owned RSS configuration.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59789
DeltaFile
+1-7sys/dev/ixgbe/if_ixv.c
+1-7sys/dev/ixgbe/if_ix.c
+2-142 files

FreeBSD/src 001332bsys/dev/hyperv/netvsc if_hn.c

hn: Handle unavailable VF RSS configuration

Treat unsupported RSS queries and RSS_FUNC_NONE as normal reasons to
suppress synthetic receive hash metadata.  Keep diagnostics for other
errors and invalid configurations.  Also suppress hash metadata when
reconfiguring synthetic RSS fails, since the VF and synthetic settings
cannot then be assumed to agree.  Correct the hash-query diagnostic name.

MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59691
DeltaFile
+12-6sys/dev/hyperv/netvsc/if_hn.c
+12-61 files

FreeBSD/src a3880afsys/net iflib.c ifdi_if.m

iflib: Add optional RSS configuration queries

Dispatch SIOCGIFRSSKEY and SIOCGIFRSSHASH through typed get_rss_key and
get_rss_hash methods under the context lock.  Drivers can report their
programmed key and hash selections.  The default methods return EOPNOTSUPP.

The common RSS key does not describe which hash selections a particular
device actually programs.  hn(4) needs the effective VF configuration when
synchronizing RSS between its synthetic and VF receive paths.

Reviewed by:    iflib (gallatin)
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59691
DeltaFile
+26-0sys/net/ifdi_if.m
+10-0sys/net/iflib.c
+36-02 files

FreeBSD/src 597798asys/netinet tcp_subr.c

tcp: use sparse initializer for host cache metrics

Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D59453
DeltaFile
+8-11sys/netinet/tcp_subr.c
+8-111 files

FreeBSD/src 587c6c1sys/netinet tcp_subr.c

tcp: turn on TCP hostcache for socket buffer sizes

The code has been there since introduction of the TCP hostcache
in 97d8d152c28bb in 2003, but was turned off.

Reviewed by:            tuexen, cc
Differential Revision:  https://reviews.freebsd.org/D59452
DeltaFile
+2-2sys/netinet/tcp_subr.c
+2-21 files

FreeBSD/src f8f05fesys/netinet tcp_hostcache.c in_kdtrace.h, usr.bin/netstat inet.c

tcp: collect and report more statistics on the TCP host cache

Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D59451
DeltaFile
+33-16usr.bin/netstat/inet.c
+10-3sys/netinet/tcp_var.h
+8-4sys/netinet/tcp_hostcache.c
+9-3sys/netinet/in_kdtrace.h
+9-3sys/netinet/in_kdtrace.c
+69-295 files

FreeBSD/src 8a37f8cshare/man/man9 buf_ring.9, sys/dev/cxgb cxgb_sge.c cxgb_main.c

buf_ring: use counter(9) for drops

If a buffer ring experiences drops, then system is definitely starving in
CPU resources.  Having an extra cache miss on a racy shared variable
increment doesn't help.

Reviewed by:            gallatin
Differential Revision:  https://reviews.freebsd.org/D59495
DeltaFile
+18-3sys/sys/buf_ring.h
+10-1share/man/man9/buf_ring.9
+7-0sys/kern/subr_bufring.c
+1-1sys/dev/mxge/if_mxge.c
+1-1sys/dev/cxgb/cxgb_sge.c
+1-1sys/dev/cxgb/cxgb_main.c
+38-76 files

FreeBSD/src 3b498d5share/man/man9 buf_ring.9, sys/kern subr_bufring.c

buf_ring: support different lock classes

And enable locking assertions for INVARIANTS kernel.

Reviewed by:            gallatin, kib, markj
Differential Revision:  https://reviews.freebsd.org/D59457
DeltaFile
+19-19sys/sys/buf_ring.h
+8-3share/man/man9/buf_ring.9
+3-4sys/kern/subr_bufring.c
+2-1sys/netinet/ip_mroute.c
+1-1sys/net/if_ovpn.c
+33-285 files

FreeBSD/src 11d26e3share/man/man9 callout.9, sys/sys callout.h

callout: provide callout_init_lock()

This is type agnostic locked callout initializer.  The callout_init_mtx()
and etc remain for compatibility.

Reviewed by:            kib, markj
Differential Revision:  https://reviews.freebsd.org/D59456
DeltaFile
+24-27share/man/man9/callout.9
+9-6sys/sys/callout.h
+33-332 files

FreeBSD/src 0e7c7cfsys/sys lock.h

locks: provide a macro to extract lock_object from various lock types

To be used in _Generic() KPIs that accept different lock types.

Reviewed by:            kib
Differential Revision:  https://reviews.freebsd.org/D59455
DeltaFile
+10-0sys/sys/lock.h
+10-01 files

FreeBSD/src 17af098usr.sbin/virtual_oss/virtual_oss main.c

Revert "virtual_oss(8): Fix cuse.ko check"

parse_options() was moved above cuse_init(), which makes every single
regular virtual_oss invocation which uses cuse_dev_create() fail.

This reverts commit f014795ec3bd5efb88dfc249599e9665dc10a59e.
DeltaFile
+5-11usr.sbin/virtual_oss/virtual_oss/main.c
+5-111 files

FreeBSD/src 73ce582sys/netpfil/pf pf_nl.c

pf: table_addr_parser parses to struct nl_parsed_table_addrs

Not to struct pfioc_table.

MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+5-5sys/netpfil/pf/pf_nl.c
+5-51 files

FreeBSD/src 47cf9dcsys/dev/sound/pcm mixer.c

sound: Lock around mixer_set*() in mixer_init() for consistency

Sponsored by:   The FreeBSD Foundation
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D59110
DeltaFile
+5-0sys/dev/sound/pcm/mixer.c
+5-01 files

FreeBSD/src 044ef29sys/dev/sound/pcm mixer.c

sound: Remove unncessary locking in sysctl_hw_snd_hwvol_mixer()

The locking around strlcpy() was because of m->hwvol_mixer, but this is
just an int, so we don't need to lock in this case. Instead lock only
when m->hwvol_mixer is written.

While here, add parentheses around the returns.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D59109
DeltaFile
+6-12sys/dev/sound/pcm/mixer.c
+6-121 files

FreeBSD/src db62d78sys/dev/sound/pcm mixer.c

sound: Improve some mixer return values and their handling

Sponsored by:   The FreeBSD Foundation
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D59078
DeltaFile
+10-10sys/dev/sound/pcm/mixer.c
+10-101 files

FreeBSD/src 6c73547sys/dev/sound/pcm mixer.c

sound: Reuse mixer_delete() in mixer_uninit()

Sponsored by:   The FreeBSD Foundation
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D59077
DeltaFile
+1-7sys/dev/sound/pcm/mixer.c
+1-71 files

FreeBSD/src 03b59d2sys/dev/sound/pcm mixer.c

sound: Do not set a recording source in mixer_uninit()

We currently set the recording source to SOUND_MIXER_MIC during mixer
deletion. Apart from the fact that this control might not be present on
all devices, it is unnecessary to do that, plus we already set all the
volumes to 0 in the mixer_set() call above.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D59076
DeltaFile
+0-2sys/dev/sound/pcm/mixer.c
+0-21 files