Skip to contentSkip to conversation

net/i40e: fix RSS key pointer initialization error

PATCH Applied Wei Zhao 2 participants 3 messages Nov 15, 2018 Network drivers

lore
Share & tools
lore

Wei Zhao

author
#0 lore raw

PATCH 1/1 net/i40e: fix RSS key pointer initialization error

The assignment should be done after initialization, or it will be zero.

Fixes 264b23e3d2c1 ("net/i40e: add parameter check for RSS flow init")
---
 drivers/net/i40e/i40e_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/i40e/i40e_ethdev.c +2 -2
index 790ecc3..a96d407 100644
@@ -12554,8 +12554,6 @@ i40e_rss_conf_init(struct i40e_rte_flow_rss_conf *out,
 		return -EINVAL;
 	if (!in->key && in->key_len)
 		return -EINVAL;
-	if (in->key)
-		out->conf.key = memcpy(out->key, in->key, in->key_len);
 	out->conf = (struct rte_flow_action_rss){
 		.func = in->func,
 		.level = in->level,
@@ -12565,6 +12563,8 @@ i40e_rss_conf_init(struct i40e_rte_flow_rss_conf *out,
 		.queue = memcpy(out->queue, in->queue,
 				sizeof(*in->queue) * in->queue_num),
 	};
+	if (in->key)
+		out->conf.key = memcpy(out->key, in->key, in->key_len);
 	return 0;
 }
 
Signature · 1 line
2.7.5
author Tested-by Peng, Yuan on v1 1/1
#1 lore raw

Send on behalf of Peng, Yuan <[email protected]>

- Tested Branch: master
- Tested Commit: 3e42b6ce06a1901b1ab631df4484ec8f548091c6
- OS: 4.5.5-300.fc24.x86_64
- GCC: gcc (GCC) 5.3.1 20151207 (Red Hat 5.3.1-2)
- CPU: Intel(R) Xeon(R) CPU E5-2699 v4 @ 2.20GHz
- NIC: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection [8086:10fb] (rev 01)

     Intel Corporation Ethernet Controller X710 for 10GbE SFP+ [8086:1572] (rev 01)

- Default x86_64-native-linuxapp-gcc configuration
- Prerequisites:
- Total 1 cases, 1 passed, 0 failed

- Case:
./usertools/dpdk-devbind.py -b igb_uio 05:00.0 05:00.1 ./x86_64-native-linuxapp-gcc/app/testpmd -c 1ffff -n 4 - -i --nb-cores=8 --rxq=4 --txq=4 --port-topology=chained testpmd> flow create 0 ingress pattern end actions rss types ipv4-udp end key 67108863 / end Flow rule #0 created
testpmd> flow flush 0
testpmd> flow create 0 ingress pattern end actions rss types ipv4-udp end / end
Flow rule #0 created

Quoted 43 lines

-----Original Message-----
From: Zhao1, Wei
Sent: Thursday, November 15, 2018 4:57 PM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Peng, Yuan <[email protected]>; Zhao1, Wei <[email protected]>
Subject: [PATCH] net/i40e: fix RSS key pointer initialization error

The assignment should be done after initialization, or it will be zero.

Fixes 264b23e3d2c1 ("net/i40e: add parameter check for RSS flow init")
---
 drivers/net/i40e/i40e_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/i40e/i40e_ethdev.c +0 -2
index 790ecc3..a96d407 100644
@@ -12554,8 +12554,6 @@ i40e_rss_conf_init(struct i40e_rte_flow_rss_conf
 *out,
 		return -EINVAL;
 	if (!in->key && in->key_len)
 		return -EINVAL;
-	if (in->key)
-		out->conf.key = memcpy(out->key, in->key, in->key_len);
 	out->conf = (struct rte_flow_action_rss){
 		.func = in->func,
drivers/net/i40e/i40e_ethdev.c +2 -1
 		.level = in->level,
@@ -12565,6 +12563,8 @@ i40e_rss_conf_init(struct i40e_rte_flow_rss_conf
 *out,
 		.queue = memcpy(out->queue, in->queue,
 				sizeof(*in->queue) * in->queue_num),
 	};
+	if (in->key)
+		out->conf.key = memcpy(out->key, in->key, in->key_len);
 	return 0;
 }
 
--

2.7.5

Acked-by Applied
#2 lore raw
Quoted 9 lines

-----Original Message-----
From: Zhao1, Wei
Sent: Thursday, November 15, 2018 1:55 AM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Peng, Yuan <[email protected]>
Subject: RE: [PATCH] net/i40e: fix RSS key pointer initialization error

Quoted 3 lines

Send on behalf of Peng, Yuan <[email protected]>

Applied to dpdk-next-net-intel.

Thanks
Qi

Quoted 72 lines

- Tested Branch: master
- Tested Commit: 3e42b6ce06a1901b1ab631df4484ec8f548091c6
- OS: 4.5.5-300.fc24.x86_64
- GCC: gcc (GCC) 5.3.1 20151207 (Red Hat 5.3.1-2)
- CPU: Intel(R) Xeon(R) CPU E5-2699 v4 @ 2.20GHz
- NIC: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection [8086:10fb] (rev 01)
Intel Corporation Ethernet Controller X710 for 10GbE SFP+ [8086:1572]
(rev 01)
- Default x86_64-native-linuxapp-gcc configuration
- Prerequisites:
- Total 1 cases, 1 passed, 0 failed

- Case:
./usertools/dpdk-devbind.py -b igb_uio 05:00.0
05:00.1 ./x86_64-native-linuxapp-gcc/app/testpmd -c 1ffff -n 4 - -i --nb-cores=8 --rxq=4 --txq=4 --port-topology=chained testpmd> flow create 0 ingress pattern end actions rss types ipv4-udp testpmd> end key 67108863 / end
Flow rule #0 created
testpmd> flow flush 0
testpmd> flow create 0 ingress pattern end actions rss types ipv4-udp testpmd> end / end
Flow rule #0 created

Quoted 44 lines

-----Original Message-----
From: Zhao1, Wei
Sent: Thursday, November 15, 2018 4:57 PM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Peng, Yuan <[email protected]>; Zhao1, Wei <[email protected]>
Subject: [PATCH] net/i40e: fix RSS key pointer initialization error

The assignment should be done after initialization, or it will be zero.

Fixes 264b23e3d2c1 ("net/i40e: add parameter check for RSS flow

init")

---
 drivers/net/i40e/i40e_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/net/i40e/i40e_ethdev.c index 790ecc3..a96d407 100644

drivers/net/i40e/i40e_ethdev.c +0 -2
@@ -12554,8 +12554,6 @@ i40e_rss_conf_init(struct
 i40e_rte_flow_rss_conf *out,
 		return -EINVAL;
 	if (!in->key && in->key_len)
 		return -EINVAL;
-	if (in->key)
-		out->conf.key = memcpy(out->key, in->key, in->key_len);
 	out->conf = (struct rte_flow_action_rss){
 		.func = in->func,
drivers/net/i40e/i40e_ethdev.c +2 -1
 		.level = in->level,
@@ -12565,6 +12563,8 @@ i40e_rss_conf_init(struct
 i40e_rte_flow_rss_conf *out,
 		.queue = memcpy(out->queue, in->queue,
 				sizeof(*in->queue) * in->queue_num),
 	};
+	if (in->key)
+		out->conf.key = memcpy(out->key, in->key, in->key_len);
 	return 0;
 }
 
--

2.7.5