witness: add tunables debug.witness.lock_order_{data_count,hash_size}
Add tunable debug.witness.lock_order_data_count to allow adjusting the
number of witness lock order data entries (stacks) without recompiling
the kernel. This may help to display stacks when a lock order reversal
is reported but the number of entries is exhausted before recording the
first lock order, by allowing the user to reboot with an adjusted
tunable and try again.
Tunable debug.witness.lock_order_hash_size is also provided to allow the
hash table load factor to be managed, though that is not required.
Also tweak witness_lock_order_add to avoid computing a hash when it
won't be needed because the lock order data entries are exhausted.
Reviewed by: kib, markj
Sponsored by: Dell Inc.
Differential Revision: https://reviews.freebsd.org/D57600
witness: actually set read-only tunables in time for witness_startup
SYSCTL_XXX with CTLFLAG_RDTUN and without CTLFLAG_NOFETCH should not be
used for values that are needed before SI_SUB_KLD. Otherwise they are
tuned after they are needed. Set CTLFLAG_RDTUN | CTLFLAG_NOFETCH for
the debug.witness.witness_count and debug.witness.skipspin sysctls and
add separate tunables for them, which run at SI_SUB_TUNABLES time, i.e.,
in time for witness_startup.
Reviewed by: kib, markj
Sponsored by: Dell Inc.
Differential Revision: https://reviews.freebsd.org/D57613
nfs_clvnops.c: Fix the case where va_flags are being cleared
Commits c5d72d2 and 3b6d4c6 broke the case where the
archive/hidden/system attributes are being set false
(UF_ARCHIVE, UF_HIDDEN or UF_SYSTEM bits being cleared.)
and the NFS server does not support those attributes.
These patches only checked for support if the
archive/hidden/system attributes were non-zero.
This patch fixes the problem.
PR: 296088
Tested by: Joshua Kinard <freebsd at kumba.dev>
MFC after: 1 week
Fixes: c5d72d29fe0e ("nfsv4: Add support for the NFSv4 hidden and system attributes")
build: provide a FORTIFY_SOURCE.<src file> override
For native files we can do more minimal fixes to avoid this large of a
hammer, but for third party files it may not be worth the effort to try
and patch them. NetBSD has the original _FORTIFY_SOURCE implementation
that ours is based on, for instance, but tests sourced from there can't
do an __ssp_real(foo) without being certain that `foo` actually has a
fortified definition.
This change does always define _FORTIFY_SOURCE as a result, so gate it
on CFLAGS not already containing _FORTIFY_SOURCE definitions.
This re-applies c46a0b59071614, but without re-defining _FORTIFY_SOURCE
needlessly.
PR: 294881
Reviewed by: markj, sjg (both previous version)
Differential Revision: https://reviews.freebsd.org/D57356
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