The iteration over all pcbs is possible without the global list. The
newborn inpcbs are put on a global list of unconnected inpcbs, then after
connect(2) or bind(2) they move to respective hash slot list.
This adds a bit of complexity to inp_next(), but the storage scheme is
actually simplified.
One potential problem before this change was that a couple of pcbs fall
into the same hash slot and are linked A->B there, but they also sit next
to each other in the global list, linked as B->A. This can deadlock of
course. The problem was never observed in the wild, but I was able to
instrument it with lots of effort: just few pcbs in the system, hash size
reduced down to 2 and a lot of repetitive calls into two kinds of
iterators.
However the main motivation is not the above problem, but make a step
towards splitting the big hash lock into per-slot locks.
Differential Revision: https://reviews.freebsd.org/D55967
With the SMR locking of inpcbs the use of this lock reduced down to the
global list and generation number. It was used only on an inpcb creation
and destruction. Use the inpcbinfo hash lock for this purpose.
Reviewed by: pouria, rrs, markj
Differential Revision: https://reviews.freebsd.org/D55966
The protocols marked with PR_CONNREQUIRED can never go through pr_connect
after being disconnected. This is a tiny improvement of fdb987bebd.
While here push clearing of the addresses under the same condition.
Although this clearing originates from pre-FreeBSD times, it actually
makes sense only for protocols that can reconnect.
Reviewed by: pouria, markj
Differential Revision: https://reviews.freebsd.org/D55661
Before this change evdev interface sent only copy of data sent through
the sysmouse interface. It worked as /dev/wsp0 device node was
automatcaly opened by devd(8) with starting of moused(8).
Starting with 15.0 moused(8) does not open sysmouse interface by default
thus making wsp(4) device dysfunctional.
Fix it with adding extra checks of interfaces state.
MFC after: 1 week
These devices appeared to stop sending reports via mouse USB interface
after switching to RAW mode. Fix it with changing Usage of Top Level
Collection to one found in HID report descriptor of proper interface.
MFC after: 1 week
According to "HID Usage Tables FOR Universal Serial Bus (USB)"
Usage Page ID range 0x93-0xF1CF is "Reserved" and Usage Page ID range
0xFF00-0xFFFF is "Vendor-defined".
MFC after: 1 week
rather than on VID/PID. Later is not reliable for some types.
VID/PID identification can be restored by specifying of -p option.
Tested by: arrowd, wulf
PR: 290639
MFC after: 1 week
Functional change is that on destruction INVARIANTS checks will run. Also
the mask is no longer hardcoded, so makes it easier to make hash size a
tunable.
Reviewed by: ae
Differential Revision: https://reviews.freebsd.org/D56176
While here, slightly restyle ip_vnet_init() and use sparse initializer for
pfil_head_args. There is no functional change wrt to pfil(9) hook
registration.
Differential Revision: https://reviews.freebsd.org/D56175
While here remove ipi_lbgrouphashmask, as it is always has the same value
as ipi_porthashmask.
Differential Revision: https://reviews.freebsd.org/D56174
This is a more extendable version than traditional hashinit(9). It allows
different kinds of slot headers with optional locks.
Implement traditional hashinit()/hashdestroy() on top of it.
Reviewed by: pouria, gallatin
Differential Revision: https://reviews.freebsd.org/D55904
Focus on the MRQE field of the MRQC register, which is 4 bits wide,
and we use these 3 types of values.
- IXGBE_MRQC_RSSEN 0x1 (non VF mode)
- IXGBE_MRQC_VMDQRSS32EN 0xA (less than 33 VFs)
- IXGBE_MRQC_VMDQRSS64EN 0xB (less than 65 VFs)
If we always take a bitwise OR with IXGBE_MRQC_RSSEN,
IXGBE_MRQC_VMDQRSS32EN will never be chosen.
Select these 3 types of values for the proper case.
Signed-off-by: Yuichiro NAITO <naito.yuichiro@gmail.com>
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/2132
Commit 8b9775912c added support for an NFSv4 mounted
root file system. This patch documents how to set this
up. It also includes some minor updates and fixes
some formatting.
This is a content change.
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D56317
Fixes: 8b9775912c ("nfs_diskless: Add support for an NFSv4 root fs")
While here, remove a bogus const which has been there for years.
MFC after: 1 week
Reported by: ivy@
Fixes: 1b83e8a3f8 ("Constify string pointers.")
Fixes: 8244dd3262 ("tunefs: Better fix for arm64 alignment issues")
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D56343
Improve mfi_pd_inq_string() by
* Reusing buffer sizes from cam/cam.h according to SCSI specification + NULL byte
* Don't truncate vendor-specific information by escaping into a too small buffer
* Use cam_strvis() from libcam instead of old, outdated local copy
* Recaculate size of inq_string based on the reused buffer sizes and
format statements
PR: 294354
Reviewed by: imp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D56328
Both (U)EFI and BIOS are completely different things, be precise and don't use
them together.
Reviewed by: imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D56329
Added support for the f{maximum,minimum}_{mag,num} families, the new
C23 standard functions for maximum magnitude and number-preferring
maximum. This includes modifying fmax.3, on top of D56230, to
recommend the use of fmaximum_num and fminimum_num.
Reviewed by: fuz, kargl
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D56236
zstd's tracing API (zstd_trace.h) declares ZSTD_trace_compress_begin()
and friends as __attribute__((weak)) externals, gated on the
ZSTD_HAVE_WEAK_SYMBOLS compile-time probe. That probe has covered
x86_64 and i386 since at least zstd 1.5.6, and was extended to aarch64
and riscv in 1.5.7.
In a static kernel image there is no dynamic linker to patch the PLT GOT
entries at runtime. On amd64 the undefined weak symbols resolve directly
to NULL, so the "!= NULL" guard in the zstd source correctly suppresses
every call through the stubs. On aarch64 and riscv the ABI requires
GOT-based indirection for external calls: the PLT stub address is
non-NULL, the guard passes, and the call lands in an uninitialized GOT
slot. Because this happens before exception handlers are in place the
machine resets silently, making the kernel unbootable after the zstd
1.5.7 import.
The upstream-supported suppression is ZSTD_NO_TRACE (zstd_internal.h),
which skips inclusion of zstd_trace.h entirely and forces ZSTD_TRACE=0.
Add it to ZSTD_C alongside the existing ZSTD_* defines, and while here
group all three -DZSTD_* flags onto a single line in alphabetical order
with ${.IMPSRC} on its own line.
Reported by: many
Tested by: lwhsu
X-MFC-with: c0d9a07101
Linux /proc/partitions reports the major/minor pair, the device size in
1K blocks, and the device name. linprocfs still printed obsolete
statistics columns and reported the size in bytes.
Update linprocfs_dopartitions() to emit the Linux-style header and
report provider sizes in 1K blocks.
Signed-off-by: Shunchao Hu <ankohuu@gmail.com>
Reviewed by: des
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/2126
Closes: https://github.com/freebsd/freebsd-src/pull/2126
* migrate the MSM8916 (snapdragon 410) support to qcom_gcc
* add the full qcom_gcc / qcom_clk list to files.arm64, replacing
the MSM8916 stub in sys/arm64/qualcomm .
Differential Revision: https://reviews.freebsd.org/D49706
The draft-ietf-6man-ipv6only-flag has been obsoleted by RFC 8925.
Remove the EXPERIMENTAL compile option from the kernel and remove
DRAFT_IETF_6MAN_IPV6ONLY_FLAG from userland.
This compile option was not enabled by default.
Also regenerate src.conf.5.
Reviewed by: bz
Differential Revision: https://reviews.freebsd.org/D56228
hccontrol LE_Set_Advertising_Data does not currently allow construction
of manufacturer-specific type 0xFF AdvData. Fixed by a new data-entry
option -b "b1,b2,b3,...,bn" where b's are 8-bit byte strings (octets).
Signed-off-by: F. Duncanh <fduncanh@gmail.com>
Reviewed by: takawata, pouria
Pull Request: https://github.com/freebsd/freebsd-src/pull/2082
file_loadraw() can have a need to load unverified files
like "dtrace_dof". Allow severity_guess() to look at the filename
but if it returns less than VE_MUST check that the type is not
one we insist on verifying.
In vectx_open if severity < VE_MUST we can allow it to be unverified.
If passed VE_GUESS we call severity_guess().
Regardless, we record severity in ctx so it is available to vectx_close().
Sponsored by: Hewlett Packard Enterprise Development LP
Reviewed by: khng
Differential Revision: https://reviews.freebsd.org/D56297
Advertise IFCAP_WOL_MAGIC when PCI power management is available
and enable it by default. On suspend or shutdown, rge_setwol()
enables the WOL_MAGIC and WOL_LANWAKE bits in CFG3/CFG5, disables
the RXDV gate, and enables PM so the NIC stays powered to watch
for magic packets.
Move hardware-specific WOL register configuration into
rge_wol_config() in if_rge_hw.c to keep hardware-specific
functions in sync with OpenBSD.
Update rge.4 to document WoL support.
Tested on FreeBSD 16.0-CURRENT bare metal with Realtek RTL8125
on a Gigabyte B650 Gaming X AX motherboard.
Signed-off-by: Christos Longros <chris.longros@gmail.com>
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D56259
If a knote belongs to the list, there is no reason to check for the list
emptiness. On the other hand, if the knote does not belong to the list,
then checking for emptiness is not enough since there might be a
different knote there.
Reviewed bu: kevans, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D56341
We have a small buffer for pages on the stack, but if the user wants to
do an I/O larger than this we currently fail w/o a way for the user to
know the max size. It's not hard to allocate an array for the uncommon
case of very large I/Os, and the performance advantage of the array is
small in that case anyway. In addition, this allows firmware upgrades
using the full transfer size of the device as a happy accident too.
Sponsored by: Netflix
Reviewed by: chs, chuck
Differential Revision: https://reviews.freebsd.org/D55638
kobj.h just needs sys/types.h (because it uses u_int, it can't use
sys/_types.h). kobj.h isn't a standard thing, so we don't need to be
careful about namespace pollution.
Sponsored by: Netflix
This is part 3 of the support for the new Intel Ethernet E610
family of devices
The ix driver now enables firmware logging on Intel E610 devices
for debugging with Customer Support. Logs are enabled by default
and generated in binary format that requires decoding by support
teams. The collected data is firmware and hardware related for
debugging purposes only.
When the driver loads, it creates a fw_log sysctl node under the
debug section. Events are organized into categories (modules) for
targeted logging, and users can adjust verbosity levels as needed.
This adds sysctl support for the firmware logging feature and
updates the ix(4) manual page with documentation.
Signed-off-by: Yogesh Bhosale <yogesh.bhosale@intel.com>
Co-developed-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: ziaee, kbowling
Tested by: Mateusz Moga <mateusz.moga@intel.com>
MFC after: 1 weeks
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D53973
freebsd11_freebsd32_nstat() invoked copyout(2) when
freebsd11_cvtnstat32() failed and skipped copyout on success. This is
backwards.
Fix this to match freebsd11_freebsd32_nlstat() and freebsd11_nstat(),
and only copy the nstat32 result to userspace when conversion succeeds.
Signed-off-by: Weixie Cui <cuiweixie@gmail.com>
Reviewed by: mhorne
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/2109
Both fetch and op IBS sampling have the same problem where we need to
rewrite the control MSR to ensure sampling continues at the correct
rate. I also like this because it resets the counter reducing the
chances that we collect a sample inside the NMI handler.
Reported by: Aalok Agarwal
Reviewed by: mhorne
Sponsored by: Netflix
Fixes: e51ef8ae49 ("hwpmc: Initial support for AMD IBS")
Pull Request: https://github.com/freebsd/freebsd-src/pull/2130
In ibs_stop_pmc I accidently cleared the fetch max count value rather
than the op max count value, when stopping the op counter. This
mitigates a bug in early pre-zen processors, but breaks using both
counters simultaneously. I also found that the max op count mask needs
to be extended for recent zen processors.
Reported by: Andre Fernando da Silva
Reviewed by: mhorne
Sponsored by: Netflix
Fixes: e51ef8ae49 ("hwpmc: Initial support for AMD IBS")
Pull Request: https://github.com/freebsd/freebsd-src/pull/2120
Since libmd was added to the bootstrap, building main on stable/14
fails because of an incompatibility in its old md4.h. Fix this by
always including md4.h in the bootstrap headers, instead of only
doing so when building on a non-FreeBSD host.
Fixes: 50de0bf505 ("flua: Always build as a bootstrap tool")
Reported by: olce
Reviewed by: olce, kevans
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D56327
Commit c8c37141 ("virtio_blk: Use bus_dma for command/ack buffer
allocations") failed to update initialisation of the dedicated dump
request structure. This caused a panic on attempting to dump core to a
virtio_blk device.
Reviewed by: asomers
Sponsored by: Arm Ltd
Pull Request: https://reviews.freebsd.org/D56156