iflib: Fix mbufs leaked by 0 len packets emitted from the if driver
Some interface drivers, notably bnxt, can insert 0 length packets onto
their receive queues when certain conditions are met, such as discarding
packets in the case of bnxt.
When this packet gets processed by assemble_segments(), The solitary
mbuf on the queue that composes it consist of a single zero length
fragment. The loop in assemble_segments() doesn't seem to expect
that a 0 length fragment can exist in the iri_frags list without a
non-zero length header preceding it. In this situation, without filter
intervention rxd_frag_to_sd() returns a pointer to the corresponding
mbuf in the rxq, where it is matched as a zero-length fragment and
immediately discarded without freeing as mh has not yet been assigned.
This change corrects this behavior by falling through the mh == NULL
case and freeing m on the condition that it is not NULL before
continuing the loop.
[3 lines not shown]
mlx5en: guard against empty eth_proto_oper mask
eth_proto_oper is used to derive the active media mode, but an empty
mask leaves no valid bit for ilog2() to consume. Treat this as an
invalid carrier update, reset the active media state, and report the
unexpected PTYS value.
Reviewed by: kib
Tested by: Wafa Hamzah <wafah at nvidia.com>
MFC after: 1 week
Sponsored by: NVIDIA Networking
libmlx5: sync PCI device allowlist with mlx5_core_pci_table
Userspace mlx5_driver_init() only attached when vendor/device matched
hca_table, while the kernel already probed additional Mellanox PCI IDs
That mismatch prevented libibverbs from loading the mlx5 provider on
those HCAs.
Extend hca_table to mirror mlx5_core_pci_table and add cross-references
so future kernel ID additions are paired with a userspace update.
Reviewed by: kib
Tested by: Wafa Hamzah <wafah at nvidia.com>
Sponsored by: Nvidia networking
MFC after: 1 week
RDMA: Fix link active_speed size
According to the IB spec active_speed size should be u16 and not u8 as
before. Changing it to allow further extensions in offered speeds.
Linux commit:
376ceb31ff87 RDMA: Fix link active_speed size
Reviewed by: kib
Tested by: Wafa Hamzah <wafah at nvidia.com>
MFC after: 1 week
Sponsored by: NVIDIA Networking
Differential revision: https://reviews.freebsd.org/D57084
tcp.fastopen.client_enable: Fix documented default
The default value has been 1 since June 2018, but the docs were not
updated to reflect the change.
MFC after: 3 days
Reviewed by: ziaee
Fixes: af4da5865557 (Enable TCP_FASTOPEN by default)
Signed-off-by: Matteo Riondato <matteo at FreeBSD.org>
Closes: https://github.com/freebsd/freebsd-src/pull/2285
Update bsdconfig dot USAGE
Add gm prefix to convert command.
`convert` of ImageMagick is now available under `gm convert` where
`gm` is the main entry point for GraphicsMagick commands.
nvme: Use newbus to ask if a device is storage
As NVMe is in more places, it has a variety of attachments. On non PCI
busses, we assume we're a storage device. For PCI, we look at the
interface ID. Add newbus glue to make this happen.
Sponsored by: Netflix
Discussed with: jhb
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D56994
socket: Tag all socket option comments consistently
For all the socket options that have a fixed type, add the type of the
socket option arg to the comment. Most of them already had this, but a
few did not. The ones that don't have a tag use a variable length data
structure of some kind, and are beyond the scope of this
commit. Slightly expand the syntax to allow a comma separated list for
those sockopts that have multiple fixed-length versions.
Sponsored by: Netflix
Reviewed by: pouria, peter.lei_ieee.org, tuexen
Differential Revision: https://reviews.freebsd.org/D57545
est: gate "not recognized" message behind bootverbose
On modern Intel CPUs that use HWP (hwpstate_intel: /usr/src/sys/x86/cpufreq/hwpstate_intel.c) instead of EST,
this message prints unconditionally during probe even though it is
expected and harmless. Gated behind bootverbose to reduce console
noise on systems where EST is present but considered legacy.
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D57616
est: prevent divide-by-zero in est_msr_info
When hw.est.msr_info=1 is set, est_msr_info() extracts the bus clock
from MSR_PERF_STATUS upper bits. On secondary CPUs, the MSR may
contain zero in the frequency ratio field, causing a
divide-by-zero panic.
Observed in pre Skylake Intel cpu.
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D57614
tcp: cleanup resource handling in SYN handling
Handle cred, ipopts, and maclabel using the same pattern:
allocate at the beginning and set to NULL when the object is
transferred to a struct syncache. When exiting the function, free
these objects if not transferred or when transferred to the on-stack
struct syncache. This makes use of a new function syncache_release().
This fixes a use after free problem: ipopts should only be freed,
if the on-stack struct syncache is used and the pointer in this
structure still points to the allocated ipopts. If the ipopts
are moved from the struct syncache to the struct inpcb in
syncache_socket(), which is called by syncache_tfo_expand(),
the pointer in the struct syncache is set to NULL.
In a FreeBSD default setup this problem is mitigated by
1. TCP fast open support on the server side not being enabled
(the sysctl-variable net.inet.tcp.fastopen.server_enable is 0).
2. Incoming IP packet with source routing options are not being
[11 lines not shown]