[v2] net/ice: fix core dumped issue in switch filter

Message ID 20200506030525.3907-1-junyux.jiang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: xiaolong ye
Headers
Series [v2] net/ice: fix core dumped issue in switch filter |

Checks

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

Commit Message

Junyu Jiang May 6, 2020, 3:05 a.m. UTC
  The number of queues in queue group should be checked before
using it. This patch fixed the issue.

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

Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
Tested-by: Qimai Xiao <qimaix.xiao@intel.com>
---
 drivers/net/ice/ice_switch_filter.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Qiming Yang May 6, 2020, 6:30 a.m. UTC | #1
Acked-by: Qiming Yang <qiming.yang@intel.com>

> -----Original Message-----
> From: Jiang, JunyuX <junyux.jiang@intel.com>
> Sent: Wednesday, May 6, 2020 11:05
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Jiang, JunyuX
> <junyux.jiang@intel.com>; stable@dpdk.org
> Subject: [PATCH v2] net/ice: fix core dumped issue in switch filter
> 
> The number of queues in queue group should be checked before using it.
> This patch fixed the issue.
> 
> Fixes: 47d460d63233 ("net/ice: rework switch filter")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
> Tested-by: Qimai Xiao <qimaix.xiao@intel.com>
> ---
>  drivers/net/ice/ice_switch_filter.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ice/ice_switch_filter.c
> b/drivers/net/ice/ice_switch_filter.c
> index 179430136..c2762e331 100644
> --- a/drivers/net/ice/ice_switch_filter.c
> +++ b/drivers/net/ice/ice_switch_filter.c
> @@ -1296,6 +1296,8 @@ ice_switch_parse_action(struct ice_pf *pf,
>  		switch (action_type) {
>  		case RTE_FLOW_ACTION_TYPE_RSS:
>  			act_qgrop = action->conf;
> +			if (act_qgrop->queue_num <= 1)
> +				goto error;
>  			rule_info->sw_act.fltr_act =
>  				ICE_FWD_TO_QGRP;
>  			rule_info->sw_act.fwd_id.q_id =
> --
> 2.17.1
  
Xiaolong Ye May 6, 2020, 8:57 a.m. UTC | #2
On 05/06, Junyu Jiang wrote:
>The number of queues in queue group should be checked before
>using it. This patch fixed the issue.
>
>Fixes: 47d460d63233 ("net/ice: rework switch filter")
>Cc: stable@dpdk.org
>
>Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
>Tested-by: Qimai Xiao <qimaix.xiao@intel.com>
>---
> drivers/net/ice/ice_switch_filter.c | 2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c
>index 179430136..c2762e331 100644
>--- a/drivers/net/ice/ice_switch_filter.c
>+++ b/drivers/net/ice/ice_switch_filter.c
>@@ -1296,6 +1296,8 @@ ice_switch_parse_action(struct ice_pf *pf,
> 		switch (action_type) {
> 		case RTE_FLOW_ACTION_TYPE_RSS:
> 			act_qgrop = action->conf;
>+			if (act_qgrop->queue_num <= 1)
>+				goto error;
> 			rule_info->sw_act.fltr_act =
> 				ICE_FWD_TO_QGRP;
> 			rule_info->sw_act.fwd_id.q_id =
>-- 
>2.17.1
>

Applied to dpdk-next-net-intel, Thanks.
  
Zhao1, Wei May 20, 2020, 9:31 a.m. UTC | #3
Hi, Junyu

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Junyu Jiang
> Sent: Wednesday, May 6, 2020 11:05 AM
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; guinanx.sun@intel.com X
> <junyux.jiang@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH v2] net/ice: fix core dumped issue in switch filter
> 
> The number of queues in queue group should be checked before using it. This
> patch fixed the issue.
> 
> Fixes: 47d460d63233 ("net/ice: rework switch filter")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
> Tested-by: Qimai Xiao <qimaix.xiao@intel.com>
> ---
>  drivers/net/ice/ice_switch_filter.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ice/ice_switch_filter.c
> b/drivers/net/ice/ice_switch_filter.c
> index 179430136..c2762e331 100644
> --- a/drivers/net/ice/ice_switch_filter.c
> +++ b/drivers/net/ice/ice_switch_filter.c
> @@ -1296,6 +1296,8 @@ ice_switch_parse_action(struct ice_pf *pf,
>  		switch (action_type) {
>  		case RTE_FLOW_ACTION_TYPE_RSS:
>  			act_qgrop = action->conf;
> +			if (act_qgrop->queue_num <= 1)
> +				goto error;

Why do you ban the case of queue num =1?

>  			rule_info->sw_act.fltr_act =
>  				ICE_FWD_TO_QGRP;
>  			rule_info->sw_act.fwd_id.q_id =
> --
> 2.17.1
  
Zhao1, Wei May 20, 2020, 9:32 a.m. UTC | #4
Get, this is for queue group, thanks.


> -----Original Message-----
> From: Zhao1, Wei
> Sent: Wednesday, May 20, 2020 5:31 PM
> To: Junyu Jiang <junyux.jiang@intel.com>; dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Jiang, JunyuX
> <JunyuX.Jiang@intel.com>; stable@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH v2] net/ice: fix core dumped issue in switch
> filter
> 
> Hi, Junyu
> 
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of Junyu Jiang
> > Sent: Wednesday, May 6, 2020 11:05 AM
> > To: dev@dpdk.org
> > Cc: Yang, Qiming <qiming.yang@intel.com>; guinanx.sun@intel.com X
> > <junyux.jiang@intel.com>; stable@dpdk.org
> > Subject: [dpdk-dev] [PATCH v2] net/ice: fix core dumped issue in
> > switch filter
> >
> > The number of queues in queue group should be checked before using it.
> > This patch fixed the issue.
> >
> > Fixes: 47d460d63233 ("net/ice: rework switch filter")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
> > Tested-by: Qimai Xiao <qimaix.xiao@intel.com>
> > ---
> >  drivers/net/ice/ice_switch_filter.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/net/ice/ice_switch_filter.c
> > b/drivers/net/ice/ice_switch_filter.c
> > index 179430136..c2762e331 100644
> > --- a/drivers/net/ice/ice_switch_filter.c
> > +++ b/drivers/net/ice/ice_switch_filter.c
> > @@ -1296,6 +1296,8 @@ ice_switch_parse_action(struct ice_pf *pf,
> >  		switch (action_type) {
> >  		case RTE_FLOW_ACTION_TYPE_RSS:
> >  			act_qgrop = action->conf;
> > +			if (act_qgrop->queue_num <= 1)
> > +				goto error;
> 
> Why do you ban the case of queue num =1?

> 
> >  			rule_info->sw_act.fltr_act =
> >  				ICE_FWD_TO_QGRP;
> >  			rule_info->sw_act.fwd_id.q_id =
> > --
> > 2.17.1
  

Patch

diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c
index 179430136..c2762e331 100644
--- a/drivers/net/ice/ice_switch_filter.c
+++ b/drivers/net/ice/ice_switch_filter.c
@@ -1296,6 +1296,8 @@  ice_switch_parse_action(struct ice_pf *pf,
 		switch (action_type) {
 		case RTE_FLOW_ACTION_TYPE_RSS:
 			act_qgrop = action->conf;
+			if (act_qgrop->queue_num <= 1)
+				goto error;
 			rule_info->sw_act.fltr_act =
 				ICE_FWD_TO_QGRP;
 			rule_info->sw_act.fwd_id.q_id =