> -----Original Message----- > From: Wei Hu (Xavier) <xavier.hu...@huawei.com> > Sent: Monday, June 22, 2020 11:47 AM > To: tho...@monjalon.net; ferruh.yi...@intel.com; > arybche...@solarflare.com; anatoly.bura...@intel.com; > hemant.agra...@nxp.com; sachin.sax...@nxp.com; John Daley (johndale) > <johnd...@cisco.com>; Hyong Youb Kim (hyonkim) <hyon...@cisco.com>; > qi.z.zh...@intel.com; xiao.w.w...@intel.com; xuanziya...@huawei.com; > cloud.wangxiao...@huawei.com; zhouguoy...@huawei.com; > beilei.x...@intel.com; jia....@intel.com; heinrich.k...@netronome.com; > hka...@marvell.com; jer...@marvell.com; ndabilpu...@marvell.com; > kirankum...@marvell.com; rm...@marvell.com; shsha...@marvell.com > Cc: dev@dpdk.org; xavier.hu...@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: sta...@dpdk.org > > Signed-off-by: Chengchang Tang <tangchengch...@huawei.com> > Signed-off-by: Wei Hu (Xavier) <xavier.hu...@huawei.com> > Acked-by: Andrew Rybchenko <arybche...@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 <hyon...@cisco.com> Thanks. -Hyong