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

Message ID 20180517055205.58766-1-yanglong.wu@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Helin Zhang
Headers

Checks

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

Commit Message

Yanglong Wu May 17, 2018, 5:52 a.m. UTC
  VLAN-strip should be set by both per port and per queue

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

Comments

Qi Zhang May 17, 2018, 3:49 p.m. UTC | #1
Hi Yanglong:

> -----Original Message-----
> From: Wu, Yanglong
> Sent: Thursday, May 17, 2018 1:52 PM
> To: dev@dpdk.org
> Cc: Dai, Wei <wei.dai@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Wu,
> Yanglong <yanglong.wu@intel.com>
> Subject: [PATCH] net/ixgbe: fix VLAN strip setting fail for per port
> 
> VLAN-strip should be set by both per port and per queue
> 
> Fixes: 860a94d3c692 ("net/ixgbe: support VLAN strip per queue offloading in
> VF")
> Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> b/drivers/net/ixgbe/ixgbe_ethdev.c
> index f5006bc94..f27e777fe 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -5228,9 +5228,11 @@ ixgbevf_vlan_offload_set(struct rte_eth_dev *dev,
> int mask)
> 
>  	/* VF function only support hw strip feature, others are not support */
>  	if (mask & ETH_VLAN_STRIP_MASK) {
> +		on = !!(dev->data->dev_conf.rxmode.offloads &
> +				DEV_RX_OFFLOAD_VLAN_STRIP);

In ixgbe_rx_qeueu_setup, I saw rxq->offload is assigned by rx_conf->offloads | dev->data->dev_conf.rxmode.offloads;
So queue offload it already cover port offload, looks redundant here , could give more explain why this is necessary?

Regards
Qi

>  		for (i = 0; i < dev->data->nb_rx_queues; i++) {
>  			rxq = dev->data->rx_queues[i];
> -			on = !!(rxq->offloads &	DEV_RX_OFFLOAD_VLAN_STRIP);
> +			on |= !!(rxq->offloads & DEV_RX_OFFLOAD_VLAN_STRIP);


>  			ixgbevf_vlan_strip_queue_set(dev, i, on);
>  		}
>  	}
> --
> 2.11.0
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index f5006bc94..f27e777fe 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -5228,9 +5228,11 @@  ixgbevf_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 
 	/* VF function only support hw strip feature, others are not support */
 	if (mask & ETH_VLAN_STRIP_MASK) {
+		on = !!(dev->data->dev_conf.rxmode.offloads &
+				DEV_RX_OFFLOAD_VLAN_STRIP);
 		for (i = 0; i < dev->data->nb_rx_queues; i++) {
 			rxq = dev->data->rx_queues[i];
-			on = !!(rxq->offloads &	DEV_RX_OFFLOAD_VLAN_STRIP);
+			on |= !!(rxq->offloads & DEV_RX_OFFLOAD_VLAN_STRIP);
 			ixgbevf_vlan_strip_queue_set(dev, i, on);
 		}
 	}