net/ice: enable VLAN filter offloads support

Message ID 1548662003-7339-1-git-send-email-wei.zhao1@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series net/ice: enable VLAN filter offloads support |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply issues

Commit Message

Zhao1, Wei Jan. 28, 2019, 7:53 a.m. UTC
  There is need to check whether dev_conf.rxmode.offloads is
set when start ice device, if one of the vlan related bits
is set, for example DEV_RX_OFFLOAD_VLAN_FILTER and so on,
sevice start process to enable this offloads request.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
  

Patch

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index b145d9c..94bdad3 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -1711,7 +1711,7 @@  ice_dev_start(struct rte_eth_dev *dev)
 	struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 	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++) {
@@ -1739,6 +1739,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;