dounmount(9): temporarily enable recursion for the covered vnode lock
For some complex nullfs mount configurations, it is possible to get the
covered vnode lock for the mount shared with some inside-mount vnode
lock. Then at unmount time, vflush() would recurse on the covered vnode
lock when reclaiming the vnode.
Work around it, by temprorarily allowing recursion on the covered vnode
lock. Disable recursion after the unmount if it was not enabled before.
PR: 297174
Reviewed by: jah
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D58567
ixgbe: Validate SR-IOV before restarting the PF
A deterministic IOV configuration error currently reaches the driver
only after iflib has stopped the PF. The required cleanup restart then
causes an avoidable carrier flap.
Follow the igb pattern and validate the request in the PCI IOV method
before entering the restart transaction. Reject queue layouts wider
than the selected virtualization pool before they can alias unrelated
82599 registers.
MFC after: 2 weeks
ixgbe: restart iflib around SR-IOV reconfiguration
The IOV callback changes the PF pool, virtualization mode, and hardware
queue indices while iflib still considers the old queue layout live.
Teardown likewise leaves the software pool and mode at their SR-IOV
values.
Use iflib stop/mutate/restart transactions for both transitions.
Disable VF DMA and PCI VF Enable before queue reuse, let outstanding
transactions drain, and restore the non-IOV pool and queue indices on
teardown.
Remove the redundant driver-local pci_iov_detach() wrapper; iflib
already performs that check centrally before the driver detach
callback.
It may be possible to avoid some restart in the future on this hardware
pausing DMA and remapping rings but not pursued yet.
MFC after: 2 weeks
iflib: Permit SR-IOV configuration on a down interface
Drivers which remap PF queues need a stop/mutate/restart transaction
only when the interface has live queues. Permit their IOV
initialization callback while the interface is administratively down
and leave it down afterward.
This restores the standard boot-time iovctl.conf workflow for igb and
lets other opt-in drivers configure VFs before netif brings the PF up.
MFC after: 1 week
pci: Permit function-level reset of 82599 VFs
Intel 82599 supports FLR on VFs but reports FLR support only in the PF
Device Capabilities register. The VF register therefore leaves the FLR
Capable bit clear, and pcie_flr() rejects the reset.
Intel documents the zeroed VF PCIe capability structure as erratum 35
in the 82599 Specification Update (B0=Yes; NoFix).
Add a positive FLR quirk for the 82599 VF. Keep the capability check
for every other function, so an unknown nonconforming VF cannot make
pcie_flr() report success when its reset request was ignored.
SR-IOV requires VFs to support FLR, but a clear capability bit cannot
distinguish the 82599's misadvertisement from a VF that fails to
implement it.
MFC after: 1 week
pci: Optionally disable endpoints with unsafe MPS
Keep warn-only behavior as the default. Add an opt-in policy that
clears endpoint decoding and bus mastering when a newly discovered
function cannot match its active path, while never disabling bridge
functions and their subtrees.
MFC after: 2 weeks
pci: Add a hierarchy-wide MPS limit
Add a boot-time ceiling for MPS reconciliation. Apply it only while an
entire cold-enumerated link can be configured consistently, and leave
an established active path unchanged.
MFC after: 2 weeks
pci: Reconcile MPS before attaching PCIe devices
Reconcile each newly enumerated link as a unit before child drivers
attach. Firmware may leave Bus Master Enable set after handoff, so use
the bus attachment state rather than that bit to identify the cold
phase.
Preserve an established hierarchy during rescan and hot-add. Refuse a
reduction below a switch because recursive enumeration may already have
made a sibling subtree live; lowering only the local port or Root Port
would produce an inconsistent path. Report capability and active-use
conflicts distinctly.
Handle OFW PCI buses that clone the generic enumeration path.
MFC after: 2 weeks
pci: Preserve adjusted PCIe control state
The PCI bus changes live capability registers after the initial
configuration snapshot has been saved. A later driver reprobe restores
that snapshot and can silently undo the adjustment.
Update the cached Device Control and Root Control bits together with
pcie_adjust_config() writes. Route the persistent Maximum Read Request
setter and the bus-owned AER control changes through that helper as
well, so they share the same restore semantics as MPS reconciliation.
Document the persistent-write contract. Merge only explicitly adjusted
bits into the saved image so unrelated or transient bits observed during
the hardware read-modify-write cannot become persistent.
MFC after: 2 weeks
pci: Ignore SR-IOV VFs when tuning MPS
The VF Device Control MPS and MRRS fields are reserved and preserved.
VF transactions use the PF MPS, so a hardwired VF value must not be
used to retune the shared PCIe hierarchy.
Document the previously undocumented tuning knob and clarify why a VF
may continue to display its reserved hardwired value.
This fixes an instant crash/reboot on my Zen3 system with 82599 VFs.
MFC after: 1 week
ixv: reconcile VLAN filters through the mailbox
VLAN registration callbacks only update the software shadow, leaving
the PF unaware until a later full initialization. Initialization then
retries each failed request in a tight loop, while skipping replay
entirely when local hardware filtering is disabled.
Send additions and removals as soon as the desired state changes,
independent of the VF local-filter capability. Replay the desired
memberships after reset and retry a bounded batch per timer tick. Stop
after the first failure so a silent PF can consume only one mailbox
timeout per pass, while a responsive PF can drain several requests.
Treat the retry window as a no-progress deadline: advance it when
pending work succeeds so a large backlog can drain, but leave entries
dormant after a sustained failure.
A successful mailbox request wakes a dormant backlog. Dispatch
timer-driven retries only while iflib marks the VF running, so a stale
timer tick cannot restore PF VLAN state after the stop path resets the
[14 lines not shown]
powerpc/pmap: Support booke64 kernel pmap growing
In preparation of increasing the KVA on powerpc64 to 2TB to mirror
amd64's, rework the 64-bit Book-E pmap to not allocate all page table
pages at boot time, since that would be a waste of a lot of memory.
Instead, allocate all page table pages for the higher levels, leaving
the leaves (page directories) for dynamic allocation. This cuts the
boot-time page table size down from ~64MB to ~8MB with the current 32GB
KVA size, and bumping to 2TB KVA the boot-time page table is still ~8MB
instead of ballooning to ~4GB of mostly wasted space.
prometheus_sysctl_exporter: don't abort on bad labels
We can probaby consider these kernel bugs, in which case asserting is
not the most helpful thing we can do. Let's emit the necessary details
to stderr and exit non-zero to aid debugging these without completely
blocking the ability to export all of the well-formed metrics.
Reviewed by: rew
Differential Revision: https://reviews.freebsd.org/D57983
ixgbe: implement VF secondary MAC filters
The PF advertises the legacy SET_MACVLAN mailbox request but always
rejects it. The request installs secondary unicast addresses.
Allocate an owned RAR pool for VF secondary addresses, reserve low
entries for PF filters, and place VF-primary addresses at the top of
the usable RAR range. Reject address collisions and cap each VF at
three secondary filters so one guest cannot exhaust the shared table.
Clear secondary filters on VF or PF reset and on SR-IOV teardown. This
hardware can anti-spoof only the VF primary source address. Reject
secondary filters while MAC anti-spoofing is configured, so installing
them requires an explicit administrative policy choice. Report optional
filter-table allocation failure without disabling SR-IOV.
Adapt the owned-RAR allocation and reset-cleanup model from igb(4) in
a2ed165f0049 to DPDK's ixgbe SET_MACVLAN mailbox semantics.
[2 lines not shown]
ixgbe: enforce VF promiscuity and multicast policy
The allow-promisc IOV property is advertised but ignored, and the PF
rejects the xcast request used by modern VFs. Negotiate mailbox APIs
1.2 and 1.3, implement pool-scoped xcast modes, and require
allow-promisc for requested all-multicast or unicast-promiscuous modes.
The VF mailbox can carry only 30 multicast hashes. When ixv has a
larger list, request the API 1.2 all-multicast xcast mode instead of
extending the legacy SET_MULTICAST message. The PF grants that fallback
only to VFs configured with allow-promisc; otherwise ixv reports that
only the first 30 addresses are active.
Reset xcast state with the VF and have ixv replay the mode implied by
its interface flags after multicast updates.
Follow DPDK's ixgbe API 1.2/1.3 xcast contract, with allow-promisc
policy adapted from igb(4) in a2ed165f0049.
[2 lines not shown]
ixgbe: Preserve priority-tagged traffic with SR-IOV
VID 0 carries only 802.1p priority and does not identify VLAN
membership. Keep VFTA bit zero in the persistent PF shadow table so
reset and SR-IOV replay admit priority-tagged frames while VLAN
filtering is enabled.
In virtualization mode, also reserve VLVF slot zero and restore PF and
eligible VF pool memberships. A VFTA hit alone admits the tag globally
but does not deliver it to the correct pools.
This matches the priority-tag treatment in em/igb.
MFC after: 1 week
ixgbe: preserve VLAN ownership with SR-IOV
The VF VLAN capability is checked but never granted, and no SR-IOV
configuration property exposes the existing default-VLAN support. PF
VLAN updates also replace VFTA registers from a PF-only shadow, erasing
live VF filters.
Expose access VLAN and trunk policy through the IOV schema. Track each
VF VLAN as desired state, restore the administrative VLAN after reset,
and use the native VLVF helper for incremental PF and VF ownership
changes.
Keep VLAN filtering enabled while SR-IOV is active. When PF hardware
filtering is disabled, admit every VLAN to the PF without bypassing
per-pool VF isolation. Reconstruct VLVF and the shared VFTA from PF and
VF desired state after reset or a filtering-mode transition, and
restore PF-only state on teardown.
When the last VF leaves a VLAN still owned by the PF, free its VLVF
[14 lines not shown]
ixgbe: enforce configured VF anti-spoofing
The SR-IOV schema advertises MAC anti-spoofing and enables it by
default, but the VF configuration was never consumed and the hardware
policy remained disabled.
Record the configured policy and apply MAC and VLAN anti-spoofing
throughout VF initialization and reset. On X550-family devices, also
protect the LLDP and flow-control Ethertypes and enable per-VF
spoof-event accounting. Remove the driver-owned state during SR-IOV
teardown.
Adapt the anti-spoof configuration lifecycle used by igb(4) in
a2ed165f0049 to the ixgbe hardware controls.
MFC after: 1 week
Relnotes: yes
14.5: create releng/14.5 branch
Update from PRERELEASE to BETA1
Switch pkg(8) configuration to use the quarterly repositories
Bump __FreeBSD_version to 1405000
Approved by: re (implicit)
Sponsored by: OpenSats Initiative
evdev: add devnum sysctl
Add a sysctl entry for the evdev device number (devnum) to allow
libudev-devd to populate the corresponding device information
fields (MAJOR and MINOR) when running in a jail with no input devices
exposed through devfs.
Signed-off-by: Quentin Thébault <quentin.thebault at defenso.fr>
Reviewed by: wulf
Sponsored by: Defenso
(cherry picked from commit 746c374aa94b46712e6defb3ab56dd2d6ad8db64)
bsdinstall: add a hardening knob for unprivileged kenv access
It makes sense.
Reviewed by: zleei
Differental Revision: https://reviews.freebsd.org/D57755
stdio: *memstream: grow the buffer by 1.5x on write
This improves performance by reducing the number of allocations as we
write into the memstream, both in the fully buffered case with larger
memstreams and also more trivially in the line- and un-buffered case as
they flush back to the underlying buffer more often.
The inspiration for this was taken from Apple's implementation in
https://github.com/apple-oss-distributions/libc, but expanded to include
wmemstream for consistency. I've added a test for the bug that I hit in
libder that caused me to notice this in the first place, and fixed that
bug in this version.
Reviewed by: des, jhb (both slightly previous version)
Sponsored by: Klara, Inc.
(cherry picked from commit a3a884c0d43ab02187022be9ae9084e6c725ba68)
stdio: *memstream: decouple the buffer size from the stream length
It's useful to be able to track both facts with a single variable, but
it also makes it more difficult to change how the buffer size scales.
As an example, Apple's implementation seems to scale the buffer size by
1.5x on growth, presumably in an attempt to reduce trips into realloc().
This might be questionable in the face of stdio buffering, but avoiding
serious churn in the line- or un-buffered case is a net positive if
doing so isn't incredibly invasive.
Reviewed by: des, jhb, obiwac
Sponsored by: Klara, Inc.
(cherry picked from commit 781defc7eb061a82b1e3e8dbc6b34993f23e79a6)