Skip to contentSkip to conversation

net/ipn3ke: use ctrl thread to check link status

PATCH Applied Andy Pei 3 participants 4 messages Mar 16, 2020 – Mar 19, 2020 Network drivers

lore
Share & tools
lore

Andy Pei

author
#0 lore raw

PATCH 1/1 net/ipn3ke: use ctrl thread to check link status

ipn3ke driver creates a thread to check link status.

before this patch, pthread_create() is used to create thread, leaving the new thread unrestrained wrt cpu affinity.

After this patch, rte_ctrl_thread_create() is used to create thread. The affinity of the new thread is based on the CPU affinity retrieved at the time rte_eal_init() was called, the dataplane and service lcores are then excluded.

Fixes 70d6b7f550f4 ("net/ipn3ke: add representor")

---
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

drivers/net/ipn3ke/ipn3ke_representor.c +2 -1
index 80122e3..b673c49 100644
@@ -2598,7 +2598,8 @@ struct rte_eth_xstat_name *xstats_names,
 	int ret;
 
 	if (ipn3ke_rpst_scan_num == 1) {
-		ret = pthread_create(&ipn3ke_rpst_scan_thread,
+		ret = rte_ctrl_thread_create(&ipn3ke_rpst_scan_thread,
+			"ipn3ke scanner",
 			NULL,
 			ipn3ke_rpst_scan_handle_request, NULL);
 		if (ret) {
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 44 lines

-----Original Message-----
From: Pei, Andy <[email protected]>
Sent: Monday, March 16, 2020 14:07
To: [email protected]
Cc: Pei, Andy <[email protected]>; Xu, Rosen <[email protected]>; [email protected]; [email protected]; Ye, Xiaolong <[email protected]>; Yigit, Ferruh <[email protected]>
Subject: [PATCH] net/ipn3ke: use ctrl thread to check link status

ipn3ke driver creates a thread to check link status.

before this patch, pthread_create() is used to create thread, leaving the new thread unrestrained wrt cpu affinity.

After this patch, rte_ctrl_thread_create() is used to create thread. The affinity of the new thread is based on the CPU affinity retrieved at the time rte_eal_init() was called, the dataplane and service lcores are then excluded.

Fixes 70d6b7f550f4 ("net/ipn3ke: add representor")

---
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

drivers/net/ipn3ke/ipn3ke_representor.c +2 -2
index 80122e3..b673c49 100644
@@ -2598,7 +2598,8 @@ struct rte_eth_xstat_name *xstats_names,
 	int ret;
 
 	if (ipn3ke_rpst_scan_num == 1) {
-		ret = pthread_create(&ipn3ke_rpst_scan_thread,
+		ret = rte_ctrl_thread_create(&ipn3ke_rpst_scan_thread,
+			"ipn3ke scanner",
 			NULL,
 			ipn3ke_rpst_scan_handle_request, NULL);
 		if (ret) {
--
Quoted 1 line

1.8.3.1

Applied
#2 lore raw
In reply to Andy Pei
Quoted 39 lines · Andy Pei

ipn3ke driver creates a thread to check link status.

before this patch, pthread_create() is used to create thread, leaving the new thread unrestrained wrt cpu affinity.

After this patch, rte_ctrl_thread_create() is used to create thread. The affinity of the new thread is based on the CPU affinity retrieved at the time rte_eal_init() was called, the dataplane and service lcores are then excluded.

Fixes 70d6b7f550f4 ("net/ipn3ke: add representor")

---
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

drivers/net/ipn3ke/ipn3ke_representor.c +2 -1
index 80122e3..b673c49 100644
@@ -2598,7 +2598,8 @@ struct rte_eth_xstat_name *xstats_names,
 	int ret;
 
 	if (ipn3ke_rpst_scan_num == 1) {
-		ret = pthread_create(&ipn3ke_rpst_scan_thread,
+		ret = rte_ctrl_thread_create(&ipn3ke_rpst_scan_thread,
+			"ipn3ke scanner",
 			NULL,
 			ipn3ke_rpst_scan_handle_request, NULL);
 		if (ret) {
Signature · 1 line
1.8.3.1

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

#3 lore raw

Thanks.

Quoted 49 lines

-----Original Message-----
From: Ye, Xiaolong <[email protected]>
Sent: Thursday, March 19, 2020 21:43
To: Pei, Andy <[email protected]>
Cc: [email protected]; Xu, Rosen <[email protected]>; [email protected]; [email protected]; Yigit, Ferruh <[email protected]>
Subject: Re: [PATCH] net/ipn3ke: use ctrl thread to check link status

Quoted 36 lines · Andy Pei

ipn3ke driver creates a thread to check link status.

before this patch, pthread_create() is used to create thread, leaving the new thread unrestrained wrt cpu affinity.

After this patch, rte_ctrl_thread_create() is used to create thread. The affinity of the new thread is based on the CPU affinity retrieved at the time rte_eal_init() was called, the dataplane and service lcores are then excluded.

Fixes 70d6b7f550f4 ("net/ipn3ke: add representor")

---
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

drivers/net/ipn3ke/ipn3ke_representor.c +2 -2
index 80122e3..b673c49 100644
@@ -2598,7 +2598,8 @@ struct rte_eth_xstat_name *xstats_names,
 	int ret;
 
 	if (ipn3ke_rpst_scan_num == 1) {
-		ret = pthread_create(&ipn3ke_rpst_scan_thread,
+		ret = rte_ctrl_thread_create(&ipn3ke_rpst_scan_thread,
+			"ipn3ke scanner",
 			NULL,
 			ipn3ke_rpst_scan_handle_request, NULL);
 		if (ret) {
--
Quoted 2 lines

1.8.3.1

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