Skip to contentSkip to conversation

net/ice: fix core dumped issue in switch filter

PATCH Superseded Junyu Jiang 5 participants 9 messages Apr 29, 2020 – May 20, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ice: fix core dumped issue in switch filter

The number of queues in queue group should be checked before using it to avoid NULL pointer. This patch fixed the issue.

Fixes 47d460d63233 ("net/ice: rework switch filter")
---
 drivers/net/ice/ice_switch_filter.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ice/ice_switch_filter.c +2 -0
index 179430136..c2762e331 100644
@@ -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 =
Signature · 1 line
2.17.1
#1 lore raw

Hi,
I don't understand your fix log, which pointer is NULL?

Qiming

Quoted 35 lines

-----Original Message-----
From: Jiang, JunyuX <[email protected]>
Sent: Wednesday, April 29, 2020 15:25
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Jiang, JunyuX <[email protected]>; [email protected]
Subject: [PATCH] net/ice: fix core dumped issue in switch filter

The number of queues in queue group should be checked before using it to avoid NULL pointer. This patch fixed the issue.

Fixes 47d460d63233 ("net/ice: rework switch filter")
---
 drivers/net/ice/ice_switch_filter.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ice/ice_switch_filter.c +2 -1
index 179430136..c2762e331 100644
@@ -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

Tested-by on v1 1/1
#3 lore raw
In reply to Junyu Jiang

Regards,
Xiao Qimai

Quoted 35 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Junyu Jiang
Sent: Wednesday, April 29, 2020 3:25 PM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Jiang, JunyuX <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH] net/ice: fix core dumped issue in switch filter

The number of queues in queue group should be checked before using it to avoid NULL pointer. This patch fixed the issue.

Fixes 47d460d63233 ("net/ice: rework switch filter")
---
 drivers/net/ice/ice_switch_filter.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ice/ice_switch_filter.c +2 -1
index 179430136..c2762e331 100644
@@ -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

#4 lore raw

PATCH v2 1/1 net/ice: fix core dumped issue in switch filter

In reply to Junyu Jiang

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")
---
 drivers/net/ice/ice_switch_filter.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ice/ice_switch_filter.c +2 -0
index 179430136..c2762e331 100644
@@ -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 =
Signature · 1 line
2.17.1
Acked-by on v2 1/1
#5 lore raw
Quoted 36 lines

-----Original Message-----
From: Jiang, JunyuX <[email protected]>
Sent: Wednesday, May 6, 2020 11:05
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Jiang, JunyuX <[email protected]>; [email protected]
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")
---
 drivers/net/ice/ice_switch_filter.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ice/ice_switch_filter.c +2 -1
index 179430136..c2762e331 100644
@@ -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
#6 lore raw
In reply to Junyu Jiang
Quoted 28 lines · Junyu Jiang

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")

---
drivers/net/ice/ice_switch_filter.c | 2 ++

1 file changed, 2 insertions(+)
drivers/net/ice/ice_switch_filter.c +2 -0
index 179430136..c2762e331 100644
@@ -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 =
Signature · 1 line
2.17.1

Applied to dpdk-next-net-intel, Thanks.

#7 lore raw
In reply to Junyu Jiang

Hi, Junyu

Quoted 26 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Junyu Jiang
Sent: Wednesday, May 6, 2020 11:05 AM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; [email protected] X <[email protected]>; [email protected]
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")
---
 drivers/net/ice/ice_switch_filter.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ice/ice_switch_filter.c +0 -0
index 179430136..c2762e331 100644

drivers/net/ice/ice_switch_filter.c ice_switch_parse_action(struct ice_pf *pf, · line 1300

Quoted 5 lines
drivers/net/ice/ice_switch_filter.c +2 -0
@@ -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?

Quoted 5 lines
drivers/net/ice/ice_switch_filter.c +0 -1
 			rule_info->sw_act.fltr_act =
 				ICE_FWD_TO_QGRP;
 			rule_info->sw_act.fwd_id.q_id =
--

2.17.1

#8 lore raw

Get, this is for queue group, thanks.

Quoted 52 lines

-----Original Message-----
From: Zhao1, Wei
Sent: Wednesday, May 20, 2020 5:31 PM
To: Junyu Jiang <[email protected]>; [email protected]
Cc: Yang, Qiming <[email protected]>; Jiang, JunyuX <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] [PATCH v2] net/ice: fix core dumped issue in switch filter

Hi, Junyu

Quoted 27 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Junyu Jiang
Sent: Wednesday, May 6, 2020 11:05 AM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; [email protected] X <[email protected]>; [email protected]
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")
---
 drivers/net/ice/ice_switch_filter.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ice/ice_switch_filter.c +0 -0
index 179430136..c2762e331 100644

drivers/net/ice/ice_switch_filter.c ice_switch_parse_action(struct ice_pf *pf, · line 1300

Quoted 5 lines
drivers/net/ice/ice_switch_filter.c +2 -0
@@ -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?

Quoted 5 lines
drivers/net/ice/ice_switch_filter.c +0 -1
 			rule_info->sw_act.fltr_act =
 				ICE_FWD_TO_QGRP;
 			rule_info->sw_act.fwd_id.q_id =
--

2.17.1