Skip to content

Commit

Permalink
ixv: Separate VFTA table for each ixv interface.
Browse files Browse the repository at this point in the history
The vlan setting is independent for each interface. Use VFTA table in
'struct ixgbe_softc' that is already defined.

Signed-off-by: Yuichiro NAITO <naito.yuichiro@gmail.com>
  • Loading branch information
yuichiro-naito committed Jun 10, 2023
1 parent 2a3493b commit f6c0dfb
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions sys/dev/ixgbe/if_ixv.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,6 @@ TUNABLE_INT("hw.ixv.flow_control", &ixv_flow_control);
static int ixv_header_split = false;
TUNABLE_INT("hw.ixv.hdr_split", &ixv_header_split);

/*
* Shadow VFTA table, this is needed because
* the real filter table gets cleared during
* a soft reset and we need to repopulate it.
*/
static u32 ixv_shadow_vfta[IXGBE_VFTA_SIZE];
extern struct if_txrx ixgbe_txrx;

static struct if_shared_ctx ixv_sctx_init = {
Expand Down Expand Up @@ -1541,9 +1535,9 @@ ixv_setup_vlan_support(if_ctx_t ctx)
* we need to repopulate it now.
*/
for (int i = 0; i < IXGBE_VFTA_SIZE; i++) {
if (ixv_shadow_vfta[i] == 0)
if (sc->shadow_vfta[i] == 0)
continue;
vfta = ixv_shadow_vfta[i];
vfta = sc->shadow_vfta[i];
/*
* Reconstruct the vlan id's
* based on the bits set in each
Expand Down Expand Up @@ -1579,7 +1573,7 @@ ixv_if_register_vlan(if_ctx_t ctx, u16 vtag)

index = (vtag >> 5) & 0x7F;
bit = vtag & 0x1F;
ixv_shadow_vfta[index] |= (1 << bit);
sc->shadow_vfta[index] |= (1 << bit);
++sc->num_vlans;
} /* ixv_if_register_vlan */

Expand All @@ -1597,7 +1591,7 @@ ixv_if_unregister_vlan(if_ctx_t ctx, u16 vtag)

index = (vtag >> 5) & 0x7F;
bit = vtag & 0x1F;
ixv_shadow_vfta[index] &= ~(1 << bit);
sc->shadow_vfta[index] &= ~(1 << bit);
--sc->num_vlans;
} /* ixv_if_unregister_vlan */

Expand Down

0 comments on commit f6c0dfb

Please sign in to comment.