git: 4c03feacd171 - main - ixv: reconcile the PF-approved MAC address
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 06 Aug 2026 11:26:25 UTC
The branch main has been updated by kbowling:
URL: https://cgit.FreeBSD.org/src/commit/?id=4c03feacd17199a4d8689e4415992111c99e6220
commit 4c03feacd17199a4d8689e4415992111c99e6220
Author: Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2026-07-31 12:59:24 +0000
Commit: Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-08-06 11:25:39 +0000
ixv: reconcile the PF-approved MAC address
The shared VF set-RAR helper restores hw.mac.addr when the PF rejects a
requested address, but ixv ignores the error and leaves the interface
link-layer address unchanged. Subsequent initialization repeats the
rejected request while the interface appears to use an address the PF
will not deliver.
Refresh the permanent address returned by the PF after every successful
reset handshake. Copy the resulting PF-approved address back to the
interface and emit the normal link-layer address notification without
re-entering the driver initialization path. This also recovers from a
prior mailbox transport failure or a PF-side reassignment.
Adapt the igb VF address reconciliation added in a6bb3850e7c6.
MFC after: 1 week
---
sys/dev/ixgbe/if_ixv.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c
index f5e505308aa7..f5af6a53da49 100644
--- a/sys/dev/ixgbe/if_ixv.c
+++ b/sys/dev/ixgbe/if_ixv.c
@@ -99,6 +99,7 @@ static void ixv_if_update_admin_status(if_ctx_t);
static int ixv_if_msix_intr_assign(if_ctx_t, int);
static int ixv_if_mtu_set(if_ctx_t, uint32_t);
+static void ixv_reconcile_mac(struct ixgbe_softc *, if_t);
static void ixv_if_init(if_ctx_t);
static void ixv_if_local_timer(if_ctx_t, uint16_t);
static void ixv_if_stop(if_ctx_t);
@@ -591,6 +592,29 @@ ixv_if_mtu_set(if_ctx_t ctx, uint32_t mtu)
return error;
} /* ixv_if_mtu_set */
+static void
+ixv_reconcile_mac(struct ixgbe_softc *sc, if_t ifp)
+{
+ uint8_t *lladdr;
+
+ if (ixgbe_validate_mac_addr(sc->hw.mac.addr) != IXGBE_SUCCESS)
+ return;
+ lladdr = (uint8_t *)if_getlladdr(ifp);
+ if (bcmp(lladdr, sc->hw.mac.addr, ETHER_ADDR_LEN) == 0)
+ return;
+
+ device_printf(sc->dev,
+ "PF rejected or replaced the requested MAC; using %6D\n",
+ sc->hw.mac.addr, ":");
+ /*
+ * Initialization holds the context lock; avoid re-entering the driver.
+ */
+ bcopy(sc->hw.mac.addr, lladdr, ETHER_ADDR_LEN);
+ CURVNET_SET_QUIET(if_getvnet(ifp));
+ EVENTHANDLER_INVOKE(iflladdr_event, ifp);
+ CURVNET_RESTORE();
+} /* ixv_reconcile_mac */
+
/************************************************************************
* ixv_if_init - Init entry point
*
@@ -624,6 +648,8 @@ ixv_if_init(if_ctx_t ctx)
/* Reset VF and renegotiate mailbox API version */
hw->mac.ops.reset_hw(hw);
hw->mac.ops.start_hw(hw);
+ hw->mac.ops.get_mac_addr(hw, hw->mac.addr);
+ ixv_reconcile_mac(sc, ifp);
error = ixv_negotiate_api(sc);
if (error) {
device_printf(dev,