Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/ixgbe/if_ixv.c
Show First 20 Lines • Show All 1,464 Lines • ▼ Show 20 Lines | |||||
} /* ixv_initialize_receive_units */ | } /* ixv_initialize_receive_units */ | ||||
/************************************************************************ | /************************************************************************ | ||||
* ixv_setup_vlan_support | * ixv_setup_vlan_support | ||||
************************************************************************/ | ************************************************************************/ | ||||
static void | static void | ||||
ixv_setup_vlan_support(if_ctx_t ctx) | ixv_setup_vlan_support(if_ctx_t ctx) | ||||
{ | { | ||||
struct ifnet *ifp = iflib_get_ifp(ctx); | |||||
struct adapter *adapter = iflib_get_softc(ctx); | struct adapter *adapter = iflib_get_softc(ctx); | ||||
struct ixgbe_hw *hw = &adapter->hw; | struct ixgbe_hw *hw = &adapter->hw; | ||||
u32 ctrl, vid, vfta, retry; | u32 ctrl, vid, vfta, retry; | ||||
/* | /* | ||||
* We get here thru if_init, meaning | * We get here thru if_init, meaning | ||||
* a soft reset, this has already cleared | * a soft reset, this has already cleared | ||||
* the VFTA and other state, so if there | * the VFTA and other state, so if there | ||||
* have been no vlan's registered do nothing. | * have been no vlan's registered do nothing. | ||||
*/ | */ | ||||
if (adapter->num_vlans == 0) | if (adapter->num_vlans == 0) | ||||
return; | return; | ||||
if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) { | |||||
/* Enable the queues */ | /* Enable the queues */ | ||||
for (int i = 0; i < adapter->num_rx_queues; i++) { | for (int i = 0; i < adapter->num_rx_queues; i++) { | ||||
ctrl = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(i)); | ctrl = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(i)); | ||||
ctrl |= IXGBE_RXDCTL_VME; | ctrl |= IXGBE_RXDCTL_VME; | ||||
IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(i), ctrl); | IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(i), ctrl); | ||||
/* | /* | ||||
* Let Rx path know that it needs to store VLAN tag | * Let Rx path know that it needs to store VLAN tag | ||||
* as part of extra mbuf info. | * as part of extra mbuf info. | ||||
*/ | */ | ||||
adapter->rx_queues[i].rxr.vtag_strip = TRUE; | adapter->rx_queues[i].rxr.vtag_strip = TRUE; | ||||
} | } | ||||
} | |||||
/* | |||||
* If filtering VLAN tags is disabled, | |||||
* there is no need to fill VLAN Filter Table Array (VFTA). | |||||
*/ | |||||
if ((ifp->if_capenable & IFCAP_VLAN_HWFILTER) == 0) | |||||
return; | |||||
/* | /* | ||||
* A soft reset zero's out the VFTA, so | * A soft reset zero's out the VFTA, so | ||||
* we need to repopulate it now. | * we need to repopulate it now. | ||||
*/ | */ | ||||
for (int i = 0; i < IXGBE_VFTA_SIZE; i++) { | for (int i = 0; i < IXGBE_VFTA_SIZE; i++) { | ||||
if (ixv_shadow_vfta[i] == 0) | if (ixv_shadow_vfta[i] == 0) | ||||
continue; | continue; | ||||
▲ Show 20 Lines • Show All 417 Lines • Show Last 20 Lines |