[PATCH net-next v3 0/6] enic: add V2 VF receive control over MBOX

From: Satish Kharat

Date: Wed Nov 18 2026 - 18:34:10 EST


An ENIC V2 VF cannot program its station address or receive filters
directly. The PF owns those resources and provides mailbox operations for
the VF to request changes. Add VF support for station-address,
address-list and packet-filter configuration.

The mailbox transport remains asynchronous. Serialize VF request/reply
transactions because each VF stores one expected reply and completion.
Receive dispatch continues processing unsolicited PF notifications, with
their acknowledgments deferred off the RX path. PF request processing is
unchanged.

Patch 1 adds netif_rx_mode_schedule_update(): cancel an old retry, reset
its backoff and schedule an immediate update while preserving address-list
synchronization state. Callers which lose device state unsynchronize the
affected lists before scheduling the update. Patch 2 serializes VF requests.

Patch 3 reconnects the VF after a lost or invalid reply. If sending a
request times out, the driver keeps its DMA buffer until both admin queues
stop. If they do not stop, the admin channel remains unusable. Failed
registration or recovery also keeps VF receive traffic blocked.

This series builds on two fixes already in net-next: one prevents premature
freeing of admin-channel DMA buffers, and the other gives V2 VFs the correct
mailbox source ID. The series also records whether the datapath is open, so
failed recovery cannot stop it twice or change a MAC on a closed VF. It does
not add generic datapath DMA quarantine or resolve stuck-queue DMA lifetime.

The remaining patches validate configuration replies, manage station and
administrative MAC changes, and program address lists and receive mode
through the sleepable path. An incomplete station replacement requires
fresh registration instead of guessing which changes the PF applied. The
deployed PF counts the station in its 32-entry UC table: reserve 31
secondary exact entries and use broad-mode fallback at 32 secondary
addresses.

This series implements VF receive control. It does not register
.sriov_configure; the in-tree V2 PF path remains dormant. A later PF
activation series must implement the mailbox operations and VF
policy/cleanup contracts before registering that callback.

The two prerequisite fixes from net v7 are now in net-next:
- b3ae89a2e167 ("enic: retain admin-channel DMA until queues stop")
- 65230b3ffd75 ("enic: require DEVCMD2 and set the V2 VF mailbox source")

The net-next base includes both prerequisite fixes.

Link: https://lore.kernel.org/netdev/20261109-b4-enic-dma-vf-index-net-generic-first-v1-20261010-v7-0-30ca6f467673@xxxxxxxxx/

AI assistance:

LLM tools assisted implementation, design/source review, drafting, test
automation and review triage. Sashiko was also used during earlier review.
The author is responsible for the submitted changes.

Validation:

- W=1 builds and Sparse checks found no new diagnostics at any of the six
patch boundaries. The net-core change also compiled.
- A VF built from these six patches passed its supported controls and
traffic tests. Three PF/VF pairings passed functional tests. Existing
locking warnings outside this series limited lockdep coverage in two
pairings. One PF rejected the VF's selected MAC as an administrative MAC;
a distinct address worked.
- With later development and test patches, the full PF/VF stack passed
VFIO, MAC, receive-filter, reload, ring-resize, VF-recreation and traffic
tests at MTU 1500 and 9000 with lockdep enabled. Full PF/VF testing also
passed bidirectional ICMP, TCP and UDP, administrative-MAC notification
and jumbo traffic.
- Fault injection exercised mailbox recovery, failed open/stop handling,
administrative-MAC refresh and late-open CQ cleanup. A test-only
QP_DISABLE error with both queues stopped allowed VF reopen and traffic.

Signed-off-by: Satish Kharat <satishkh@xxxxxxxxx>
---
Changes in v3:
- Rebase onto net-next d6816d9a93b6, which includes the two net v7
admin-DMA and VF-source fixes. Generic datapath DMA quarantine remains
outside this series.
- After an admin send timeout, retain its mapped buffer until admin close
observes both queues stopped. Do not reopen a quarantined channel.
- Track successful datapath opens and stops consistently, refuse reuse
after a failed stop, and use actual open state for MAC handling.
- Use hardware CQ sender metadata to identify PF messages received by a
V2 VF.
- On a late open failure after CMD_ENABLE, clean old data CQs only if all
generic WQs and RQs report stopped. Generic stuck-queue DMA lifetime
remains separate work.
- Allow reconnect after a QP_DISABLE error when both admin queues have
stopped and the channel is DOWN.
- Clear local VF registration if administrative-MAC refresh fails after
re-registration, and clarify the broad-mode ordering comment.
- Link to v2: https://patch.msgid.link/20260929-b4-enic-sriov-v2-vf-receive-control-v2-0-5962c10061b2@xxxxxxxxx

Changes in v2:
- Stop a failed registration-recovery handshake from requeueing its own
reset worker indefinitely.
- Keep coherent generic MAC-operation failures as ordinary errors;
reconnect only after explicit registration loss or an indeterminate reply.
- Enforce a cached fixed administrative MAC while the VF is down and repair
an actual device-address mismatch during registration.
- Preserve compatibility with deployed async PFs at 32 secondary unicast
addresses and exclude the station address from both secondary lists.
- Complete receive-mode transitions in one callback so concurrent list
changes converge and synchronous operations return with filters
installed.
- Link to v1: https://patch.msgid.link/20260921-b4-enic-sriov-v2-vf-receive-control-v1-0-67a0a6e08d43@xxxxxxxxx

---
Satish Kharat (6):
net: add netif_rx_mode_schedule_update()
enic: serialize V2 VF mailbox requests
enic: recover V2 VF mailbox after request failure
enic: validate V2 VF configuration replies
enic: manage V2 VF station and administrative MAC
enic: configure V2 VF receive mode over mailbox

drivers/net/ethernet/cisco/enic/enic.h | 55 +
drivers/net/ethernet/cisco/enic/enic_admin.c | 39 +-
drivers/net/ethernet/cisco/enic/enic_dev.c | 11 +
drivers/net/ethernet/cisco/enic/enic_dev.h | 1 +
drivers/net/ethernet/cisco/enic/enic_ethtool.c | 5 +
drivers/net/ethernet/cisco/enic/enic_main.c | 1619 ++++++++++++++++++++++--
drivers/net/ethernet/cisco/enic/enic_mbox.c | 751 ++++++++++-
drivers/net/ethernet/cisco/enic/enic_mbox.h | 84 ++
drivers/net/ethernet/cisco/enic/enic_rq.c | 11 +-
drivers/net/ethernet/cisco/enic/vnic_dev.c | 21 +-
drivers/net/ethernet/cisco/enic/vnic_dev.h | 2 +
include/linux/netdevice.h | 1 +
net/core/dev_addr_lists.c | 21 +
13 files changed, 2488 insertions(+), 133 deletions(-)
---
base-commit: d6816d9a93b66a12bf01e10037e377f3333ad6cc
change-id: 20260916-b4-enic-sriov-v2-vf-receive-control-b5c40bdae5b9

Best regards,
--
Satish Kharat <satishkh@xxxxxxxxx>