net/ice: fix flow validation for unsupported patterns

Message ID 20200828023328.62492-1-guinanx.sun@intel.com (mailing list archive)
State Rejected, archived
Delegated to: Qi Zhang
Headers
Series net/ice: fix flow validation for unsupported patterns |

Checks

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

Commit Message

Guinan Sun Aug. 28, 2020, 2:33 a.m. UTC
  When loading the OS default package and the pipeline mode is enabled
by the "pipeline-mode-support=1" operation. In this case, the wrong
parser is selected for processing and it will cause the unsupported
patterns(pppoes/pfcp/l2tpv3/esp/ah) to be validated successfully.
This patch corrects the parser selection issue.

Fixes: 47d460d63233 ("net/ice: rework switch filter")
Cc: stable@dpdk.org

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
---
 drivers/net/ice/ice_switch_filter.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Comments

Qi Zhang Aug. 31, 2020, 4:22 a.m. UTC | #1
> -----Original Message-----
> From: Sun, GuinanX <guinanx.sun@intel.com>
> Sent: Friday, August 28, 2020 10:33 AM
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>; Sun, GuinanX <guinanx.sun@intel.com>;
> stable@dpdk.org
> Subject: [PATCH] net/ice: fix flow validation for unsupported patterns
> 
> When loading the OS default package and the pipeline mode is enabled by the
> "pipeline-mode-support=1" operation. In this case, the wrong parser is selected
> for processing and it will cause the unsupported
> patterns(pppoes/pfcp/l2tpv3/esp/ah) to be validated successfully.
> This patch corrects the parser selection issue.
> 
> Fixes: 47d460d63233 ("net/ice: rework switch filter")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
> ---
>  drivers/net/ice/ice_switch_filter.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ice/ice_switch_filter.c
> b/drivers/net/ice/ice_switch_filter.c
> index c4b00b6a2..884fbaae2 100644
> --- a/drivers/net/ice/ice_switch_filter.c
> +++ b/drivers/net/ice/ice_switch_filter.c
> @@ -1806,7 +1806,8 @@ ice_switch_init(struct ice_adapter *ad)
>  	else
>  		return -EINVAL;
> 
> -	if (ad->devargs.pipe_mode_support)
> +	if (ad->devargs.pipe_mode_support &&
> +	    ad->active_pkg_type != ICE_PKG_TYPE_OS_DEFAULT)
>  		ret = ice_register_parser(perm_parser, ad);

This is not correct, package type should not related with pipe line mode.


>  	else
>  		ret = ice_register_parser(dist_parser, ad); @@ -1824,7 +1825,8 @@
> ice_switch_uninit(struct ice_adapter *ad)
>  	else
>  		dist_parser = &ice_switch_dist_parser_os;
> 
> -	if (ad->devargs.pipe_mode_support)
> +	if (ad->devargs.pipe_mode_support &&
> +	    ad->active_pkg_type != ICE_PKG_TYPE_OS_DEFAULT)
>  		ice_unregister_parser(perm_parser, ad);
>  	else
>  		ice_unregister_parser(dist_parser, ad);
> --
> 2.17.1
  
Guinan Sun Sept. 1, 2020, 7:19 a.m. UTC | #2
Hi qi

> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Monday, August 31, 2020 12:23 PM
> To: Sun, GuinanX <guinanx.sun@intel.com>; dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; stable@dpdk.org
> Subject: RE: [PATCH] net/ice: fix flow validation for unsupported patterns
> 
> 
> 
> > -----Original Message-----
> > From: Sun, GuinanX <guinanx.sun@intel.com>
> > Sent: Friday, August 28, 2020 10:33 AM
> > To: dev@dpdk.org
> > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Yang, Qiming
> > <qiming.yang@intel.com>; Sun, GuinanX <guinanx.sun@intel.com>;
> > stable@dpdk.org
> > Subject: [PATCH] net/ice: fix flow validation for unsupported patterns
> >
> > When loading the OS default package and the pipeline mode is enabled
> > by the "pipeline-mode-support=1" operation. In this case, the wrong
> > parser is selected for processing and it will cause the unsupported
> > patterns(pppoes/pfcp/l2tpv3/esp/ah) to be validated successfully.
> > This patch corrects the parser selection issue.
> >
> > Fixes: 47d460d63233 ("net/ice: rework switch filter")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
> > ---
> >  drivers/net/ice/ice_switch_filter.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/ice/ice_switch_filter.c
> > b/drivers/net/ice/ice_switch_filter.c
> > index c4b00b6a2..884fbaae2 100644
> > --- a/drivers/net/ice/ice_switch_filter.c
> > +++ b/drivers/net/ice/ice_switch_filter.c
> > @@ -1806,7 +1806,8 @@ ice_switch_init(struct ice_adapter *ad)
> >  	else
> >  		return -EINVAL;
> >
> > -	if (ad->devargs.pipe_mode_support)
> > +	if (ad->devargs.pipe_mode_support &&
> > +	    ad->active_pkg_type != ICE_PKG_TYPE_OS_DEFAULT)
> >  		ret = ice_register_parser(perm_parser, ad);
> 
> This is not correct, package type should not related with pipe line mode.

Under the premise of pipe-mode support, the choice of parser for different package types will be added.
Patch v2 will fix it.

> 
> 
> >  	else
> >  		ret = ice_register_parser(dist_parser, ad); @@ -1824,7
> +1825,8 @@
> > ice_switch_uninit(struct ice_adapter *ad)
> >  	else
> >  		dist_parser = &ice_switch_dist_parser_os;
> >
> > -	if (ad->devargs.pipe_mode_support)
> > +	if (ad->devargs.pipe_mode_support &&
> > +	    ad->active_pkg_type != ICE_PKG_TYPE_OS_DEFAULT)
> >  		ice_unregister_parser(perm_parser, ad);
> >  	else
> >  		ice_unregister_parser(dist_parser, ad);
> > --
> > 2.17.1
  

Patch

diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c
index c4b00b6a2..884fbaae2 100644
--- a/drivers/net/ice/ice_switch_filter.c
+++ b/drivers/net/ice/ice_switch_filter.c
@@ -1806,7 +1806,8 @@  ice_switch_init(struct ice_adapter *ad)
 	else
 		return -EINVAL;
 
-	if (ad->devargs.pipe_mode_support)
+	if (ad->devargs.pipe_mode_support &&
+	    ad->active_pkg_type != ICE_PKG_TYPE_OS_DEFAULT)
 		ret = ice_register_parser(perm_parser, ad);
 	else
 		ret = ice_register_parser(dist_parser, ad);
@@ -1824,7 +1825,8 @@  ice_switch_uninit(struct ice_adapter *ad)
 	else
 		dist_parser = &ice_switch_dist_parser_os;
 
-	if (ad->devargs.pipe_mode_support)
+	if (ad->devargs.pipe_mode_support &&
+	    ad->active_pkg_type != ICE_PKG_TYPE_OS_DEFAULT)
 		ice_unregister_parser(perm_parser, ad);
 	else
 		ice_unregister_parser(dist_parser, ad);