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
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
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]
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
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
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]
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
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
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")
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")
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")
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")
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")
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
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
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
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
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)
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)
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
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