net/ice: enable VLAN filter offloads support
authorWei Zhao <wei.zhao1@intel.com>
Wed, 13 Feb 2019 03:49:48 +0000 (11:49 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 19 Feb 2019 09:35:00 +0000 (10:35 +0100)
VLAN filter is required to be configured during dev_start according to
dev_conf.rxmod.offloads setting, so ice_vlan_offload_set is called to
handle this.

Fixes: 690175ee51bf ("net/ice: support getting device information")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/ice/ice_ethdev.c

index 6b0113b..a23c63a 100644 (file)
@@ -1714,7 +1714,7 @@ ice_dev_start(struct rte_eth_dev *dev)
        struct ice_vsi *vsi = pf->main_vsi;
        uint16_t nb_rxq = 0;
        uint16_t nb_txq, i;
-       int ret;
+       int mask, ret;
 
        /* program Tx queues' context in hardware */
        for (nb_txq = 0; nb_txq < data->nb_tx_queues; nb_txq++) {
@@ -1742,6 +1742,14 @@ ice_dev_start(struct rte_eth_dev *dev)
 
        ice_set_rx_function(dev);
 
+       mask = ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK |
+                       ETH_VLAN_EXTEND_MASK;
+       ret = ice_vlan_offload_set(dev, mask);
+       if (ret) {
+               PMD_INIT_LOG(ERR, "Unable to set VLAN offload");
+               goto rx_err;
+       }
+
        /* enable Rx interrput and mapping Rx queue to interrupt vector */
        if (ice_rxq_intr_setup(dev))
                return -EIO;