MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ixgbe_vlan_hw_strip_config

Function ixgbe_vlan_hw_strip_config

dpdk/drivers/net/ixgbe/ixgbe_ethdev.c:2140–2184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2138}
2139
2140void
2141ixgbe_vlan_hw_strip_config(struct rte_eth_dev *dev)
2142{
2143 struct ixgbe_hw *hw =
2144 IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
2145 struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;
2146 uint32_t ctrl;
2147 uint16_t i;
2148 struct ixgbe_rx_queue *rxq;
2149 bool on;
2150
2151 PMD_INIT_FUNC_TRACE();
2152
2153 if (hw->mac.type == ixgbe_mac_82598EB) {
2154 if (rxmode->offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP) {
2155 ctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL);
2156 ctrl |= IXGBE_VLNCTRL_VME;
2157 IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, ctrl);
2158 } else {
2159 ctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL);
2160 ctrl &= ~IXGBE_VLNCTRL_VME;
2161 IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, ctrl);
2162 }
2163 } else {
2164 /*
2165 * Other 10G NIC, the VLAN strip can be setup
2166 * per queue in RXDCTL
2167 */
2168 for (i = 0; i < dev->data->nb_rx_queues; i++) {
2169 rxq = dev->data->rx_queues[i];
2170 ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxq->reg_idx));
2171 if (rxq->offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP) {
2172 ctrl |= IXGBE_RXDCTL_VME;
2173 on = TRUE;
2174 } else {
2175 ctrl &= ~IXGBE_RXDCTL_VME;
2176 on = FALSE;
2177 }
2178 IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(rxq->reg_idx), ctrl);
2179
2180 /* record those setting for HW strip per queue */
2181 ixgbe_vlan_hw_strip_bitmap_set(dev, i, on);
2182 }
2183 }
2184}
2185
2186static void
2187ixgbe_config_vlan_strip_on_all_queues(struct rte_eth_dev *dev, int mask)

Callers 2

set_rx_modeFunction · 0.85

Calls 1

Tested by

no test coverage detected