[dpdk-dev] [PATCH v3 2/2] ethdev: fix VLAN offloads set if no relative capabilities

Hyong Youb Kim (hyonkim) hyonkim at cisco.com
Mon Jun 22 05:05:17 CEST 2020


> -----Original Message-----
> From: Wei Hu (Xavier) <xavier.huwei at huawei.com>
> Sent: Monday, June 22, 2020 11:47 AM
> To: thomas at monjalon.net; ferruh.yigit at intel.com;
> arybchenko at solarflare.com; anatoly.burakov at intel.com;
> hemant.agrawal at nxp.com; sachin.saxena at nxp.com; John Daley (johndale)
> <johndale at cisco.com>; Hyong Youb Kim (hyonkim) <hyonkim at cisco.com>;
> qi.z.zhang at intel.com; xiao.w.wang at intel.com; xuanziyang2 at huawei.com;
> cloud.wangxiaoyun at huawei.com; zhouguoyang at huawei.com;
> beilei.xing at intel.com; jia.guo at intel.com; heinrich.kuhn at netronome.com;
> hkalra at marvell.com; jerinj at marvell.com; ndabilpuram at marvell.com;
> kirankumark at marvell.com; rmody at marvell.com; shshaikh at marvell.com
> Cc: dev at dpdk.org; xavier.huwei at huawei.com
> Subject: [PATCH v3 2/2] ethdev: fix VLAN offloads set if no relative
> capabilities
> 
> Currently, there is a potential problem that calling the API function
> rte_eth_dev_set_vlan_offload to start VLAN hardware offloads which the
> driver does not support. If the PMD driver does not support certain VLAN
> hardware offloads and does not check for it, the hardware setting will
> not change, but the VLAN offloads in dev->data->dev_conf.rxmode.offloads
> will be turned on.
> 
> It is supposed to check the hardware capabilities to decide whether the
> relative callback needs to be called just like the behavior in the API
> function named rte_eth_dev_configure. And it is also needed to cleanup
> duplicated checks which are done in some PMDs. Also, note that it is
> behaviour change for some PMDs which simply ignore (with error/warning
> log
> message) unsupported VLAN offloads, but now it will fail.
> 
> Fixes: a4996bd89c42 ("ethdev: new Rx/Tx offloads API")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Chengchang Tang <tangchengchang at huawei.com>
> Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>
> Acked-by: Andrew Rybchenko <arybchenko at solarflare.com>
> ---
> v2 -> v3: Add __rte_unused to avoid unused parameter 'dev' and 'mask'
> 	  warning.
> v1 -> v2: cleanup duplicated checks which are done in some PMDs.
> ---
>  drivers/net/dpaa2/dpaa2_ethdev.c           |  5 -----
>  drivers/net/enic/enic_ethdev.c             | 12 ------------
>  drivers/net/fm10k/fm10k_ethdev.c           | 23 ++---------------------
>  drivers/net/hinic/hinic_pmd_ethdev.c       |  6 ------
>  drivers/net/i40e/i40e_ethdev.c             |  5 -----
>  drivers/net/nfp/nfp_net.c                  |  5 -----
>  drivers/net/octeontx/octeontx_ethdev_ops.c | 10 ----------
>  drivers/net/octeontx2/otx2_vlan.c          |  5 -----
>  drivers/net/qede/qede_ethdev.c             |  3 ---
>  lib/librte_ethdev/rte_ethdev.c             | 21 +++++++++++++++++++++
>  10 files changed, 23 insertions(+), 72 deletions(-)
> 
[...]
> diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
> index 32d5397..ef8900d 100644
> --- a/drivers/net/enic/enic_ethdev.c
> +++ b/drivers/net/enic/enic_ethdev.c
> @@ -374,18 +374,6 @@ static int enicpmd_vlan_offload_set(struct
> rte_eth_dev *eth_dev, int mask)
>  			enic->ig_vlan_strip_en = 0;
>  	}
> 
> -	if ((mask & ETH_VLAN_FILTER_MASK) &&
> -	    (offloads & DEV_RX_OFFLOAD_VLAN_FILTER)) {
> -		dev_warning(enic,
> -			"Configuration of VLAN filter is not supported\n");
> -	}
> -
> -	if ((mask & ETH_VLAN_EXTEND_MASK) &&
> -	    (offloads & DEV_RX_OFFLOAD_VLAN_EXTEND)) {
> -		dev_warning(enic,
> -			"Configuration of extended VLAN is not
> supported\n");
> -	}
> -
>  	return enic_set_vlan_strip(enic);
>  }
> 

For enic,

Acked-by: Hyong Youb Kim <hyonkim at cisco.com>

Thanks.
-Hyong



More information about the dev mailing list