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
This commit is contained in:
Kevin Bowling committed 2026-08-06 18:39:29 -07:00
1 parent a81f97aecb
commit caa08ed331
3 files changed
+17 -5

No files matched your search

+10 -1
View File
@@ -2396,6 +2396,10 @@ ixgbe_iov_vlan_rebuild(struct ixgbe_softc *sc, bool promisc)
vf = &sc->vfs[i];
if ((vf->flags & IXGBE_VF_ACTIVE) == 0)
continue;
if (vf->default_vlan == 0 &&
ixgbe_set_vfta(hw, 0, vf->pool, true, false) !=
IXGBE_SUCCESS)
failures++;
for (word = 0; word < IXGBE_VFTA_SIZE; word++) {
bits = vf->vlans[word];
while (bits != 0) {
@@ -2410,6 +2414,8 @@ ixgbe_iov_vlan_rebuild(struct ixgbe_softc *sc, bool promisc)
}
}
}
if (ixgbe_set_vfta(hw, 0, sc->pool, true, false) != IXGBE_SUCCESS)
failures++;
/* Add the PF to shared entries, or every entry in promiscuous mode. */
for (i = 1; i < IXGBE_VLVF_ENTRIES; i++) {
@@ -2428,7 +2434,7 @@ ixgbe_iov_vlan_rebuild(struct ixgbe_softc *sc, bool promisc)
IXGBE_WRITE_REG(hw, IXGBE_VFTA(i), vfta[i]);
if (failures != 0)
device_printf(sc->dev,
"VF VLAN restore failed for %d memberships\n", failures);
"VLAN pool restore failed for %d memberships\n", failures);
}
static void
@@ -2481,6 +2487,9 @@ ixgbe_setup_vlan_hw_support(if_ctx_t ctx)
ctrl &= ~IXGBE_VLNCTRL_VME;
}
/* Always admit priority-tagged frames. */
sc->shadow_vfta[0] |= 1U;
#ifdef PCI_IOV
if ((sc->feat_en & IXGBE_FEATURE_SRIOV) != 0) {
/*
+4 -2
View File
@@ -408,8 +408,10 @@ ixgbe_vf_reset_vlan(struct ixgbe_softc *sc, struct ixgbe_vf *vf,
s32 error;
ixgbe_vf_clear_vlans(sc, vf, clear_hw);
error = IXGBE_SUCCESS;
if (vf->default_vlan != 0) {
if (vf->default_vlan == 0) {
/* VLAN 0 membership is implicit and not VF-removable. */
error = ixgbe_vf_vlan_hw_update(sc, vf, 0, true);
} else {
error = ixgbe_vf_vlan_hw_update(sc, vf, vf->default_vlan, true);
if (error == IXGBE_SUCCESS)
ixgbe_vf_vlan_record(vf, vf->default_vlan, true);
+3 -2
View File
@@ -469,9 +469,10 @@ ixgbe_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri)
* A PF-assigned port VLAN is stripped before a VF receives the
* frame, but it is not one of the VLANs registered by the VF.
* Do not expose that administrative tag to the VF's network
* stack. Locally registered trunk VLANs retain M_VLANTAG.
* stack. Priority tags and locally registered trunk VLANs retain
* M_VLANTAG.
*/
if ((sc->feat_en & IXGBE_FEATURE_VF) == 0 ||
if ((sc->feat_en & IXGBE_FEATURE_VF) == 0 || vid == 0 ||
(sc->shadow_vfta[vid >> 5] &
(1U << (vid & 0x1f))) != 0) {
ri->iri_vtag = vtag;