net/ipn3ke: use ctrl thread to check link status

Message ID 1584338837-436345-1-git-send-email-andy.pei@intel.com (mailing list archive)
State Accepted, archived
Delegated to: xiaolong ye
Headers
Series net/ipn3ke: use ctrl thread to check link status |

Checks

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

Commit Message

Pei, Andy March 16, 2020, 6:07 a.m. UTC
  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: rosen.xu@intel.com
Cc: stable@dpdk.org

Signed-off-by: Andy Pei <andy.pei@intel.com>
---
Cc: david.marchand@redhat.com
Cc: xiaolong.ye@intel.com
Cc: ferruh.yigit@intel.com
  

Comments

Xu, Rosen March 19, 2020, 5:52 a.m. UTC | #1
Hi,

> -----Original Message-----
> From: Pei, Andy <andy.pei@intel.com>
> Sent: Monday, March 16, 2020 14:07
> To: dev@dpdk.org
> Cc: Pei, Andy <andy.pei@intel.com>; Xu, Rosen <rosen.xu@intel.com>;
> stable@dpdk.org; david.marchand@redhat.com; Ye, Xiaolong
> <xiaolong.ye@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> 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: rosen.xu@intel.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Andy Pei <andy.pei@intel.com>
> ---
> Cc: david.marchand@redhat.com
> Cc: xiaolong.ye@intel.com
> Cc: ferruh.yigit@intel.com
> 
> diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c
> b/drivers/net/ipn3ke/ipn3ke_representor.c
> index 80122e3..b673c49 100644
> --- a/drivers/net/ipn3ke/ipn3ke_representor.c
> +++ b/drivers/net/ipn3ke/ipn3ke_representor.c
> @@ -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) {
> --
> 1.8.3.1

Reviewed-by: Rosen Xu <rosen.xu@intel.com>
  
Xiaolong Ye March 19, 2020, 1:42 p.m. UTC | #2
On 03/16, Andy Pei wrote:
>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: rosen.xu@intel.com
>Cc: stable@dpdk.org
>
>Signed-off-by: Andy Pei <andy.pei@intel.com>
>---
>Cc: david.marchand@redhat.com
>Cc: xiaolong.ye@intel.com
>Cc: ferruh.yigit@intel.com
>
>diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c b/drivers/net/ipn3ke/ipn3ke_representor.c
>index 80122e3..b673c49 100644
>--- a/drivers/net/ipn3ke/ipn3ke_representor.c
>+++ b/drivers/net/ipn3ke/ipn3ke_representor.c
>@@ -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) {
>-- 
>1.8.3.1
>

Applied to dpdk-next-net-intel, Thanks.
  
Xu, Rosen March 19, 2020, 2:13 p.m. UTC | #3
Thanks.

> -----Original Message-----
> From: Ye, Xiaolong <xiaolong.ye@intel.com>
> Sent: Thursday, March 19, 2020 21:43
> To: Pei, Andy <andy.pei@intel.com>
> Cc: dev@dpdk.org; Xu, Rosen <rosen.xu@intel.com>; stable@dpdk.org;
> david.marchand@redhat.com; Yigit, Ferruh <ferruh.yigit@intel.com>
> Subject: Re: [PATCH] net/ipn3ke: use ctrl thread to check link status
> 
> On 03/16, Andy Pei wrote:
> >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: rosen.xu@intel.com
> >Cc: stable@dpdk.org
> >
> >Signed-off-by: Andy Pei <andy.pei@intel.com>
> >---
> >Cc: david.marchand@redhat.com
> >Cc: xiaolong.ye@intel.com
> >Cc: ferruh.yigit@intel.com
> >
> >diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c
> >b/drivers/net/ipn3ke/ipn3ke_representor.c
> >index 80122e3..b673c49 100644
> >--- a/drivers/net/ipn3ke/ipn3ke_representor.c
> >+++ b/drivers/net/ipn3ke/ipn3ke_representor.c
> >@@ -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) {
> >--
> >1.8.3.1
> >
> 
> Applied to dpdk-next-net-intel, Thanks.
  

Patch

diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c b/drivers/net/ipn3ke/ipn3ke_representor.c
index 80122e3..b673c49 100644
--- a/drivers/net/ipn3ke/ipn3ke_representor.c
+++ b/drivers/net/ipn3ke/ipn3ke_representor.c
@@ -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) {