[dpdk-dev] net/ixgbe: fix VLAN strip setting fail for per port

Message ID 20180518071600.26798-1-yanglong.wu@intel.com (mailing list archive)
State Superseded, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Yanglong Wu May 18, 2018, 7:16 a.m. UTC
  rxq->offload should synchronize with dev_conf

Fixes: 860a94d3c692 ("net/ixgbe: support VLAN strip per queue offloading in VF")
Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
---
V2:
rework as comments
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index f5006bc94..94d28878a 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2114,6 +2114,14 @@  ixgbe_vlan_hw_strip_config(struct rte_eth_dev *dev)
 		for (i = 0; i < dev->data->nb_rx_queues; i++) {
 			rxq = dev->data->rx_queues[i];
 			ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxq->reg_idx));
+
+			/* rxq->offload should synchronize with dev_conf*/
+			if (dev->data->dev_conf.rxmode.offloads &
+					DEV_RX_OFFLOAD_VLAN_STRIP)
+				rxq->offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
+			else
+				rxq->offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP;
+
 			if (rxq->offloads & DEV_RX_OFFLOAD_VLAN_STRIP) {
 				ctrl |= IXGBE_RXDCTL_VME;
 				on = TRUE;
@@ -5230,6 +5238,14 @@  ixgbevf_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 	if (mask & ETH_VLAN_STRIP_MASK) {
 		for (i = 0; i < dev->data->nb_rx_queues; i++) {
 			rxq = dev->data->rx_queues[i];
+
+			/* rxq->offload should synchronize with dev_conf*/
+			if (dev->data->dev_conf.rxmode.offloads &
+						DEV_RX_OFFLOAD_VLAN_STRIP)
+				rxq->offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
+			else
+				rxq->offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP;
+
 			on = !!(rxq->offloads &	DEV_RX_OFFLOAD_VLAN_STRIP);
 			ixgbevf_vlan_strip_queue_set(dev, i, on);
 		}