FreeBSD/src 52e7958sys/net iflib.c

iflib: ignore reclaim coalescing when low on tx descriptors

If we are low on TX descriptors, bypass iflib_txq_can_reclaim()
and force a reclaim. This is intended to reduce the number of
output drops under heavy load when using simple transmit.

Differential Revision: https://reviews.freebsd.org/D56339
Sponsored by: Netflix
DeltaFile
+16-1sys/net/iflib.c
+16-11 files

FreeBSD/src 3fade68sys/net iflib.c

iflib: accurately count bytes/segments for TSO

When using software based ifnet counters, iflib has not factored
TSO into account when reporting the segments and bytes sent.
So it will underreport NIC bandwidth by a small percent,
and will undercount sent segments by a large factor.
Fix this by calculating the number of added segments the NIC
will send, and add header size multiplied by that number
to arrive at a correct accounting of segments and bytes sent.
This makes these software counters directly comparable to
hardware counters.

Doing this requires moving the calculation into iflib_encap() where
we have already parsed the packet and know the header size, MSS, etc.

Differential Revision: https://reviews.freebsd.org/D56338
Sponsored by: Netflix
DeltaFile
+20-8sys/net/iflib.c
+20-81 files

FreeBSD/src f46d75csys/dev/ixgbe ixgbe_x540.c ixgbe_common.c

ixgbe: improve MDIO performance by reducing semaphore/IPC delays

Each MDIO transfer takes 8ms, and all of that is spent in a set
of DELAY() calls, which is consuming a LOT of CPU.

* Change the timeout in ixgbe_hic_unlocked() - doing IPC to the
  on-chip firmware - to a 1uS delay and bump timeout appropriately.
  This seems to finish in a couple of microseconds on my local
  test devices.

* Change the 2ms sleep in ixgbe_release_swfw_sync_X540() to 2ms
  for EEPROM/flash, and 10uS otherwise.  10uS seems to work fine
  on my local testing, but the config EEPROM doesn't read right
  without this extra delay.

The first change shouldn't change the driver behaviour, but the
latter change is more intrusive and needs some wider testing.
(My guess here is that there SHOULD have been some completion
check somewhere in the EEPROM/flash IO path, and these sleeps

    [8 lines not shown]
DeltaFile
+15-1sys/dev/ixgbe/ixgbe_x540.c
+2-2sys/dev/ixgbe/ixgbe_common.c
+17-32 files

FreeBSD/src cfec995sys/conf files, sys/dev/ixgbe if_ix_mdio_hw.c if_ix_mdio.c

ixgbe: add MDIO bus support

This works enough to let me see the marvell switch on the MDIO bus.

It uses clause 22, which ixgbe's existing MDIO code doesn't currently
support, so it's implemented in a new source file.

Since mdio(4) is now required, add it where appropriate to GENERIC kernels.

Reviewed by:    kbowling
Differential Revision:  https://reviews.freebsd.org/D50128
DeltaFile
+181-0sys/dev/ixgbe/if_ix_mdio_hw.c
+158-0sys/dev/ixgbe/if_ix_mdio.c
+34-0sys/dev/ixgbe/if_ix_mdio.h
+33-0sys/dev/ixgbe/if_ix_mdio_hw.h
+14-1sys/dev/ixgbe/if_ix.c
+4-0sys/conf/files
+424-13 files not shown
+432-29 files

FreeBSD/src eb02795stand/powerpc/boot1.chrp boot1.c

boot1.chrp: Improve comment for the SLOF hack

Since this original comment was written, the actual issue in SLOF
was diagnosed and documented in commit 424089a0fc, which fixed it
for loader(8).  Update the comment in boot1 to be more informative
to future readers.

MFC after:      3 days
Reviewed by:    jhibbits, adrian
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56470
DeltaFile
+5-8stand/powerpc/boot1.chrp/boot1.c
+5-81 files

FreeBSD/src 49e9b30sys/cddl/compat/opensolaris/kern opensolaris_cmn_err.c

dtrace: Improve dmesg kernel message prefix

Provide intuitive log search keywords and increased system consistency.

MFC after:              2 weeks
Reported by:            mav
Reviewed by:            0mp, dteske
OpenZFS change:         d45c8d648 (Improve dmesg kernel message prefix)
Differential Revision:  https://reviews.freebsd.org/D55765
DeltaFile
+7-7sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c
+7-71 files

FreeBSD/src b2aea7ashare/man/man4 e6000sw.4

e6000sw.4: Mention MV88E6171

Fixes:  680e6e30c020 (etherswitch: Add minimal support for mv88e6170)
Reviewed by:            jhibbits
Differential Revision:  https://reviews.freebsd.org/D56455
DeltaFile
+3-1share/man/man4/e6000sw.4
+3-11 files

FreeBSD/src a154d72sys/netinet sctp_structs.h

sctp(4): Fix a typo in a source code comment

- s/initited/initiated/

Obtained from:  NetBSD
MFC after:      3 days
DeltaFile
+1-1sys/netinet/sctp_structs.h
+1-11 files

FreeBSD/src ab1d659stand/efi/loader/arch/arm exec.c, stand/efi/loader/arch/arm64 exec.c

loader.efi: Defer efi_translate(e_entry) until after bi_load

bi_load itself loads various things into the staging area which can
cause it to grow, which may result in the staging area moving, including
the kernel. Therefore the address we get for the kernel entry point
prior to bi_load may not be correct afterwards when we actually call it,
and so we must defer the translation.

On arm and riscv (but not arm64, which predates both of them in
loader.efi and did not gain a copy of arm's added printf when arm
support was added) we also printf this entry point to the console, which
we can no longer do since bi_load calls ExitBootServices, so remove this
printf that, in practice, seems to not be so useful, given nobody ever
felt the need to add it to arm64. If anyone really feels this is an
important printf to have then bi_load will need to be split so we can
call printf after all the loading and potential reallocation of the
staging area, but before ExitBootServices is called.

We may also want to make this code more uniform and shared between the

    [10 lines not shown]
DeltaFile
+2-3stand/efi/loader/arch/arm/exec.c
+2-3stand/efi/loader/arch/riscv/exec.c
+2-1stand/efi/loader/arch/arm64/exec.c
+6-73 files

FreeBSD/src 8e08080libexec/rc rc.conf

rc.conf: Fix typo in comment

The correct path is /etc/defaults/rc.conf (defaults in plural).

Reviewed by:    netchild
Fixes:          cc4eb1ea1040 ("Add support for a /etc/defaults/vendor.conf override file")
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D56456
DeltaFile
+1-1libexec/rc/rc.conf
+1-11 files

FreeBSD/src 9f6041ftests/sys/netinet socket_afinet.c

tests/socket_afinet: Remove a conditional skip

The test runs without any unexpected results when mac_portacl is loaded.

PR:             238781
MFC after:      1 week
DeltaFile
+0-3tests/sys/netinet/socket_afinet.c
+0-31 files

FreeBSD/src c1b514csys/netinet in_mcast.c

in_mcast: Avoid calling sysctl_wire_old_buffer() in an epoch section

Wiring a virtual address range may require the thread to sleep, and this
is not permitted in an epoch section.

MFC after:      1 week
DeltaFile
+5-7sys/netinet/in_mcast.c
+5-71 files

FreeBSD/src 3c9cd6esys/netpfil/pf pf_table.c

pf: use correct address family in pfr_pool_get()

pfr_pool_get() in call to pfr_prepare_network()must use af
instead of hardcoded AF_INET

Issues reported and patch submitted by:
    Renaud Allard <renaud () allard ! it>

OK sashan@

Obtained from:  OpenBSD, sashan <sashan at openbsd.org>, 8e156a5ebe
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+1-1sys/netpfil/pf/pf_table.c
+1-11 files

FreeBSD/src 05ac101sys/netpfil/pf pf_ioctl.c

pf: fix error handling in pf_sourcelim_add()

There are two issues in pf_sourcelim_add() error path:
  - stale pointers are left in pf_sourcelim_id_tree_inactive when
    duplicate source limiter instance is found in pf_sourcelim_nm_tree

  - overload table may leak when insertion of new source limiter instance
    fails.

Both issues reported and patch submitted by:
    Renaud Allard <renaud () allard ! it>

OK sashan@

Obtained from:  OpenBSD, sashan <sashan at openbsd.org>, 32063577ec
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+3-1sys/netpfil/pf/pf_ioctl.c
+3-11 files

FreeBSD/src 5b71922sys/netpfil/pf pf_norm.c

pf: pf_frag_compare() should not be using subtraction to compare fragment IDs

Issues reported and patch submitted by:
    Renaud Allard <renaud () allard ! it>

OK sashan@

Obtained from:  OpenBSD, sashan <sashan at openbsd.org>, 747740863c
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+4-4sys/netpfil/pf/pf_norm.c
+4-41 files

FreeBSD/src 95fe1batests/sys/netpfil/pf limiters.sh

pf tests: test having multiple state limiters

Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+51-0tests/sys/netpfil/pf/limiters.sh
+51-01 files

FreeBSD/src 13b4a14lib/libpfctl libpfctl.c

libpfctl: fix add state/source limiter

When processing the return data from these calls pass the limiter
pointer, not the limiter pointer pointer.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+2-2lib/libpfctl/libpfctl.c
+2-21 files

FreeBSD/src 6f8ea66sbin/pfctl pfctl.c pfctl_parser.h

pfctl: fix how source and state limiters are wired into rbtrees

i messed up when we added support for names on these things. the
id and names are each supposed to be unique, which is checked by
putting the one limiter into an rb tree based on their id and another
based on their name. unfortunately i used the same RBT_ENTRY fields
for both trees, which meant using both trees on the same limiter
corrupted the topology, which goes badly when you want to use
multiple limiters.

found by, tested, and ok dgl@ (who is not me, this is not a typo)
ok jmatthew@

Obtained from:  OpenBSD, dlg <dlg at openbsd.org>, f951d642cc
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+12-9sbin/pfctl/pfctl.c
+4-2sbin/pfctl/pfctl_parser.h
+16-112 files

FreeBSD/src 3b373d4share/vt/keymaps Makefile

us.intl.acc.kbd: add it to Makefile

This keyboard was implemented but wasn't actually installed to the
system.

Fixes: a049678039e40bdf523230852f78887a12435def
Discussed with: imp
MFC after: 1 day
Relnotes: yes
DeltaFile
+1-0share/vt/keymaps/Makefile
+1-01 files

FreeBSD/src cef2490share/man/man4 ciss.4

ciss.4: List all devices supported by ciss(4)

PR:             285744
Reviewed by:    ziaee
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D56285

(cherry picked from commit 54f5d20492d231b5c2ddc6f1d94dbffa1707d820)
DeltaFile
+47-1share/man/man4/ciss.4
+47-11 files

FreeBSD/src 131a3e9share/man/man4 ciss.4

ciss.4: List all devices supported by ciss(4)

PR:             285744
Reviewed by:    ziaee
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D56285

(cherry picked from commit 54f5d20492d231b5c2ddc6f1d94dbffa1707d820)
DeltaFile
+45-1share/man/man4/ciss.4
+45-11 files

FreeBSD/src d31fa76share/man/man4 ciss.4

ciss.4: List all devices supported by ciss(4)

PR:             285744
Reviewed by:    ziaee
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D56285

(cherry picked from commit 54f5d20492d231b5c2ddc6f1d94dbffa1707d820)
DeltaFile
+45-1share/man/man4/ciss.4
+45-11 files

FreeBSD/src cd34d8dsys/compat/linux linux_socket.c

linux: Translate IPv6 hoplimit ancillary data for recvmsg

Signed-off-by:  Ricardo Branco <rbranco at suse.de>
Reviewed by:    pouria
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2138
DeltaFile
+18-0sys/compat/linux/linux_socket.c
+18-01 files

FreeBSD/src caaa7a0sys/compat/linux linux_socket.c

linux: Support IPPROTO_RAW socket option translation

Handle Linux IPPROTO_RAW socket options in the Linuxulator for both
getsockopt(2) and setsockopt(2). Detect the socket family and remap
the level to IPPROTO_IPV6 for AF_INET6, reusing the existing option
translators.

This fixes IPV6_CHECKSUM for IPv6 raw sockets, which Linux programs
set at level IPPROTO_RAW rather than IPPROTO_IPV6.

Signed-off-by:  Ricardo Branco <rbranco at suse.de>
PR:             294434
Reviewed by:    pouria
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2138
DeltaFile
+41-0sys/compat/linux/linux_socket.c
+41-01 files

FreeBSD/src 64e2715sys/compat/linux linux_socket.c linux_socket.h

linux: Support ICMP6_FILTER socket option translation

Handle Linux IPPROTO_ICMPV6 socket options in the Linuxulator and map
ICMP6_FILTER for both getsockopt(2) and setsockopt(2).

Linux and FreeBSD use inverted bit semantics for struct icmp6_filter, so
invert the filter contents before/after calling setsockopt/getsockopt.

Signed-off-by:  Ricardo Branco <rbranco at suse.de>
PR:             294434
Reviewed by:    pouria
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2138
DeltaFile
+67-0sys/compat/linux/linux_socket.c
+2-0sys/compat/linux/linux_socket.h
+69-02 files

FreeBSD/src 3a54aa3sys/netinet tcp_timewait.c

tcp: use RFC 6191 for connection recycling in TIME-WAIT

Implement the criteria specified in RFC 6191 for recycling TCP
connections in TIME-WAIT.

Reviewed by:            rscheff, Marius Halden
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D56321
DeltaFile
+8-3sys/netinet/tcp_timewait.c
+8-31 files

FreeBSD/src 67a7c5fsys/net/route nhop_ctl.c

routing: Fix use-after-free in finalize_nhop

FIB_NH_LOG calls the `nhop_get_upper_family(nh)` to read
`nh->nh_priv->nh_upper_family` for failure logging.
Call FIB_NH_LOG before freeing nh so failures are logged
without causing a panic.

MFC after: 3 days

(cherry picked from commit 7d38eb720a8d8345949986d779e785984ae19ae0)
DeltaFile
+2-2sys/net/route/nhop_ctl.c
+2-21 files

FreeBSD/src c775ed2sys/net/route nhop_ctl.c

routing: Fix use-after-free in finalize_nhop

FIB_NH_LOG calls the `nhop_get_upper_family(nh)` to read
`nh->nh_priv->nh_upper_family` for failure logging.
Call FIB_NH_LOG before freeing nh so failures are logged
without causing a panic.

MFC after: 3 days

(cherry picked from commit 7d38eb720a8d8345949986d779e785984ae19ae0)
DeltaFile
+2-2sys/net/route/nhop_ctl.c
+2-21 files

FreeBSD/src b3b23f2sys/tools/syscalls/scripts syscall_json.lua

syscall: Create a script to export the data as json

Create a script to export the parsed data as json. Include the
annotations for the system call arguments, since they are helpful to
downstream uses.

Sponsored by:           Netflix
Reviewed by:            brooks
Differential Revision:  https://reviews.freebsd.org/D56408
DeltaFile
+126-0sys/tools/syscalls/scripts/syscall_json.lua
+126-01 files

FreeBSD/src 2a1745dsys/tools/syscalls/core scarg.lua

syscalls: Preserve the attributes of the args

Lightly parse and preserve the attributes of the args as attributes.

Sponsored by:           Netflix
Reviewed by:            brooks
Differential Revision:  https://reviews.freebsd.org/D56407
DeltaFile
+19-0sys/tools/syscalls/core/scarg.lua
+19-01 files