net/e1000: fix filter control return value

Message ID 20210317091544.53957-1-benhaz1024@gmail.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series net/e1000: fix filter control return value |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/travis-robot success travis build: passed
ci/github-robot success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-testing warning Testing issues
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Xiaozhen Ban March 17, 2021, 9:15 a.m. UTC
  If filter_type not supported, eth_igb_filter_ctrl() will return
incorrect value.

Fixes: dd5c2dd7e5e5 ("igb: use generic filter control for ethertype filter")
Cc: stable@dpdk.org
Signed-off-by: Xiaozhen Ban <benhaz1024@gmail.com>
---
 drivers/net/e1000/igb_ethdev.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Wang, Haiyue March 17, 2021, 11:23 a.m. UTC | #1
> -----Original Message-----
> From: Xiaozhen Ban <benhaz1024@gmail.com>
> Sent: Wednesday, March 17, 2021 17:16
> To: Guo, Jia <jia.guo@intel.com>; Wang, Haiyue <haiyue.wang@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH] net/e1000: fix filter control return value
> 
> If filter_type not supported, eth_igb_filter_ctrl() will return
> incorrect value.
> 
> Fixes: dd5c2dd7e5e5 ("igb: use generic filter control for ethertype filter")
> Cc: stable@dpdk.org
> Signed-off-by: Xiaozhen Ban <benhaz1024@gmail.com>
> ---
>  drivers/net/e1000/igb_ethdev.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
> index 1716d6b90..325461247 100644
> --- a/drivers/net/e1000/igb_ethdev.c
> +++ b/drivers/net/e1000/igb_ethdev.c
> @@ -4599,6 +4599,7 @@ eth_igb_filter_ctrl(struct rte_eth_dev *dev __rte_unused,
>  	default:
>  		PMD_DRV_LOG(WARNING, "Filter type (%d) not supported",
>  							filter_type);
> +		ret = -EINVAL;
>  		break;
>  	}
> 

New design will be applied:

https://patchwork.dpdk.org/project/dpdk/patch/20210312174645.162801-2-thomas@monjalon.net/


> --
> 2.25.1
  
Xiaozhen Ban March 18, 2021, 11:44 a.m. UTC | #2
OK, but I think this bug affects all stable release about 6 years before today.
  
Wang, Haiyue March 18, 2021, 3:28 p.m. UTC | #3
> -----Original Message-----
> From: Xiaozhen Ban <benhaz1024@gmail.com>
> Sent: Thursday, March 18, 2021 19:44
> To: Guo, Jia <jia.guo@intel.com>; Wang, Haiyue <haiyue.wang@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: RE: RE: [PATCH] net/e1000: fix filter control return value
> 
> OK, but I think this bug affects all stable release about 6 years before today.

I don't think so, since it is PMD internal ops, the real API 'rte_flow_ops_get'
always use RTE_ETH_FILTER_GENERIC. ;-)
  
Xiaozhen Ban March 19, 2021, 4:08 a.m. UTC | #4
> > -----Original Message-----
> > From: Xiaozhen Ban <benhaz1024 at gmail.com>
> > Sent: Thursday, March 18, 2021 19:44
> > To: Guo, Jia <jia.guo at intel.com>; Wang, Haiyue <haiyue.wang at intel.com>
> > Cc: dev at dpdk.org; stable at dpdk.org
> > Subject: RE: RE: [PATCH] net/e1000: fix filter control return value
> > 
> > OK, but I think this bug affects all stable release about 6 years before today.

> I don't think so, since it is PMD internal ops, the real API 'rte_flow_ops_get'
> always use RTE_ETH_FILTER_GENERIC. ;-)

eth_igb_filter_ctrl() called by rte_eth_dev_filter_ctrl(), if application
developer know how to use the parameter filter_type correctly, it's OK. 
otherwise he will get rte_eth_dev_filter_ctrl() return value is success
but actually is failed.
  
Qi Zhang March 25, 2021, 8:46 a.m. UTC | #5
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Xiaozhen Ban
> Sent: Friday, March 19, 2021 12:08 PM
> To: Guo, Jia <jia.guo@intel.com>; Wang, Haiyue <haiyue.wang@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] net/e1000: fix filter control return value
> 
> > > -----Original Message-----
> > > From: Xiaozhen Ban <benhaz1024 at gmail.com>
> > > Sent: Thursday, March 18, 2021 19:44
> > > To: Guo, Jia <jia.guo at intel.com>; Wang, Haiyue <haiyue.wang at
> > > intel.com>
> > > Cc: dev at dpdk.org; stable at dpdk.org
> > > Subject: RE: RE: [PATCH] net/e1000: fix filter control return value
> > >
> > > OK, but I think this bug affects all stable release about 6 years before today.
> 
> > I don't think so, since it is PMD internal ops, the real API 'rte_flow_ops_get'
> > always use RTE_ETH_FILTER_GENERIC. ;-)
> 
> eth_igb_filter_ctrl() called by rte_eth_dev_filter_ctrl(), if application developer
> know how to use the parameter filter_type correctly, it's OK.
> otherwise he will get rte_eth_dev_filter_ctrl() return value is success but
> actually is failed.

After check with Haiyue, we think the patch is still needed for LTS <= 19.11, so

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
  
Ferruh Yigit April 20, 2021, 8:08 a.m. UTC | #6
On 3/25/2021 8:46 AM, Zhang, Qi Z wrote:
> 
> 
>> -----Original Message-----
>> From: dev <dev-bounces@dpdk.org> On Behalf Of Xiaozhen Ban
>> Sent: Friday, March 19, 2021 12:08 PM
>> To: Guo, Jia <jia.guo@intel.com>; Wang, Haiyue <haiyue.wang@intel.com>
>> Cc: dev@dpdk.org; stable@dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH] net/e1000: fix filter control return value
>>
>>>> -----Original Message-----
>>>> From: Xiaozhen Ban <benhaz1024 at gmail.com>
>>>> Sent: Thursday, March 18, 2021 19:44
>>>> To: Guo, Jia <jia.guo at intel.com>; Wang, Haiyue <haiyue.wang at
>>>> intel.com>
>>>> Cc: dev at dpdk.org; stable at dpdk.org
>>>> Subject: RE: RE: [PATCH] net/e1000: fix filter control return value
>>>>
>>>> OK, but I think this bug affects all stable release about 6 years before today.
>>
>>> I don't think so, since it is PMD internal ops, the real API 'rte_flow_ops_get'
>>> always use RTE_ETH_FILTER_GENERIC. ;-)
>>
>> eth_igb_filter_ctrl() called by rte_eth_dev_filter_ctrl(), if application developer
>> know how to use the parameter filter_type correctly, it's OK.
>> otherwise he will get rte_eth_dev_filter_ctrl() return value is success but
>> actually is failed.
> 
> After check with Haiyue, we think the patch is still needed for LTS <= 19.11, so
> 
> Acked-by: Qi Zhang <qi.z.zhang@intel.com>
> 
> Applied to dpdk-next-net-intel.
> 

What is the status of this patch?
It seems it did not applied, and the status in the patchwork is "Superseded".
  
Qi Zhang April 20, 2021, 9:54 a.m. UTC | #7
> -----Original Message-----
> From: Yigit, Ferruh <ferruh.yigit@intel.com>
> Sent: Tuesday, April 20, 2021 4:09 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Xiaozhen Ban
> <benhaz1024@gmail.com>; Guo, Jia <jia.guo@intel.com>; Wang, Haiyue
> <haiyue.wang@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] net/e1000: fix filter control
> return value
> 
> On 3/25/2021 8:46 AM, Zhang, Qi Z wrote:
> >
> >
> >> -----Original Message-----
> >> From: dev <dev-bounces@dpdk.org> On Behalf Of Xiaozhen Ban
> >> Sent: Friday, March 19, 2021 12:08 PM
> >> To: Guo, Jia <jia.guo@intel.com>; Wang, Haiyue
> >> <haiyue.wang@intel.com>
> >> Cc: dev@dpdk.org; stable@dpdk.org
> >> Subject: Re: [dpdk-dev] [PATCH] net/e1000: fix filter control return
> >> value
> >>
> >>>> -----Original Message-----
> >>>> From: Xiaozhen Ban <benhaz1024 at gmail.com>
> >>>> Sent: Thursday, March 18, 2021 19:44
> >>>> To: Guo, Jia <jia.guo at intel.com>; Wang, Haiyue <haiyue.wang at
> >>>> intel.com>
> >>>> Cc: dev at dpdk.org; stable at dpdk.org
> >>>> Subject: RE: RE: [PATCH] net/e1000: fix filter control return value
> >>>>
> >>>> OK, but I think this bug affects all stable release about 6 years before
> today.
> >>
> >>> I don't think so, since it is PMD internal ops, the real API
> 'rte_flow_ops_get'
> >>> always use RTE_ETH_FILTER_GENERIC. ;-)
> >>
> >> eth_igb_filter_ctrl() called by rte_eth_dev_filter_ctrl(), if
> >> application developer know how to use the parameter filter_type correctly,
> it's OK.
> >> otherwise he will get rte_eth_dev_filter_ctrl() return value is
> >> success but actually is failed.
> >
> > After check with Haiyue, we think the patch is still needed for LTS <=
> > 19.11, so
> >
> > Acked-by: Qi Zhang <qi.z.zhang@intel.com>
> >
> > Applied to dpdk-next-net-intel.
> >
> 
> What is the status of this patch?
> It seems it did not applied, and the status in the patchwork is "Superseded".

The patch is dropped during rebase, as the function eth_igb_filter_ctrl is removed at below code refectory 
http://patchwork.dpdk.org/project/dpdk/patch/20210321090002.595744-2-thomas@monjalon.net/

this is a mistake as we still need this to be captured in LTS
unfortunately, its too late to capture it as the refectory code is already applied to main tree.

@Luca Boccassi
Could you capture this patch as an LTS only one?

Thanks
Qi
  
Luca Boccassi April 20, 2021, 2:33 p.m. UTC | #8
On Tue, 2021-04-20 at 09:54 +0000, Zhang, Qi Z wrote:
> > -----Original Message-----
> > From: Yigit, Ferruh <ferruh.yigit@intel.com>
> > Sent: Tuesday, April 20, 2021 4:09 PM
> > To: Zhang, Qi Z <qi.z.zhang@intel.com>; Xiaozhen Ban
> > <benhaz1024@gmail.com>; Guo, Jia <jia.guo@intel.com>; Wang, Haiyue
> > <haiyue.wang@intel.com>
> > Cc: dev@dpdk.org; stable@dpdk.org
> > Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] net/e1000: fix filter control
> > return value
> > 
> > On 3/25/2021 8:46 AM, Zhang, Qi Z wrote:
> > > 
> > > > -----Original Message-----
> > > > From: dev <dev-bounces@dpdk.org> On Behalf Of Xiaozhen Ban
> > > > Sent: Friday, March 19, 2021 12:08 PM
> > > > To: Guo, Jia <jia.guo@intel.com>; Wang, Haiyue
> > > > <haiyue.wang@intel.com>
> > > > Cc: dev@dpdk.org; stable@dpdk.org
> > > > Subject: Re: [dpdk-dev] [PATCH] net/e1000: fix filter control return
> > > > value
> > > > 
> > > > > > -----Original Message-----
> > > > > > From: Xiaozhen Ban <benhaz1024 at gmail.com>
> > > > > > Sent: Thursday, March 18, 2021 19:44
> > > > > > To: Guo, Jia <jia.guo at intel.com>; Wang, Haiyue <haiyue.wang at
> > > > > > intel.com>
> > > > > > Cc: dev at dpdk.org; stable at dpdk.org
> > > > > > Subject: RE: RE: [PATCH] net/e1000: fix filter control return value
> > > > > > 
> > > > > > OK, but I think this bug affects all stable release about 6 years before
> > today.
> > > > > I don't think so, since it is PMD internal ops, the real API
> > 'rte_flow_ops_get'
> > > > > always use RTE_ETH_FILTER_GENERIC. ;-)
> > > > 
> > > > eth_igb_filter_ctrl() called by rte_eth_dev_filter_ctrl(), if
> > > > application developer know how to use the parameter filter_type correctly,
> > it's OK.
> > > > otherwise he will get rte_eth_dev_filter_ctrl() return value is
> > > > success but actually is failed.
> > > 
> > > After check with Haiyue, we think the patch is still needed for LTS <=
> > > 19.11, so
> > > 
> > > Acked-by: Qi Zhang <qi.z.zhang@intel.com>
> > > 
> > > Applied to dpdk-next-net-intel.
> > > 
> > 
> > What is the status of this patch?
> > It seems it did not applied, and the status in the patchwork is "Superseded".
> 
> The patch is dropped during rebase, as the function eth_igb_filter_ctrl is removed at below code refectory 
> http://patchwork.dpdk.org/project/dpdk/patch/20210321090002.595744-2-thomas@monjalon.net/
> 
> this is a mistake as we still need this to be captured in LTS
> unfortunately, its too late to capture it as the refectory code is already applied to main tree.
> 
> @Luca Boccassi
> Could you capture this patch as an LTS only one?
> 
> Thanks
> Qi

Please rebase it on 20.11 and test it, and if it works send it to 
stable@dpdk.org with --subject-prefix='PATCH 20.11'
  

Patch

diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 1716d6b90..325461247 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -4599,6 +4599,7 @@  eth_igb_filter_ctrl(struct rte_eth_dev *dev __rte_unused,
 	default:
 		PMD_DRV_LOG(WARNING, "Filter type (%d) not supported",
 							filter_type);
+		ret = -EINVAL;
 		break;
 	}