28 lines
937 B
Diff
28 lines
937 B
Diff
From 1d18079dea84bd368605f851738f8f14b917c98d Mon Sep 17 00:00:00 2001
|
|
From: Changsheng Wu <wuchangsheng2@huawei.com>
|
|
Date: Thu, 16 Dec 2021 15:33:11 +0800
|
|
Subject: [PATCH] huawei-0004-dpdk-master-core-donot-set-affinity-in-libstorage
|
|
|
|
---
|
|
lib/eal/linux/eal.c | 4 +++-
|
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
|
|
index 127b7f7b53..47c2186bee 100644
|
|
--- a/lib/eal/linux/eal.c
|
|
+++ b/lib/eal/linux/eal.c
|
|
@@ -1219,7 +1219,9 @@ rte_eal_init(int argc, char **argv)
|
|
|
|
eal_check_mem_on_local_socket();
|
|
|
|
- if (pthread_setaffinity_np(pthread_self(), sizeof(rte_cpuset_t),
|
|
+ /* Master thread don't set affinity in LibStorage application */
|
|
+ if (strstr(logid, "LibStorage") != NULL &&
|
|
+ pthread_setaffinity_np(pthread_self(), sizeof(rte_cpuset_t),
|
|
&lcore_config[config->main_lcore].cpuset) != 0) {
|
|
rte_eal_init_alert("Cannot set affinity");
|
|
rte_errno = EINVAL;
|
|
--
|
|
2.27.0
|
|
|