patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: dev@dpdk.org
Cc: cristian.dumitrescu@intel.com, Stable@dpdk.org,
	Jun Yang <jun.yang@nxp.com>
Subject: [dpdk-stable] [PATCH 2/2] examples/ip_pipeline: fix to use sock id instead of cpuid
Date: Wed, 11 Dec 2019 10:55:34 +0530	[thread overview]
Message-ID: <20191211052534.14600-2-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <20191211052534.14600-1-hemant.agrawal@nxp.com>

From: Jun Yang <jun.yang@nxp.com>

rte_lcore_to_socket_id should be used to convert cpu ID to socket ID.

Fixes: 6bfe74f8c93e ("examples/ip_pipeline: add mempool object")
Fixes: d75c371e9b46 ("examples/ip_pipeline: add pipeline object")
Cc: Stable@dpdk.org

Signed-off-by: Jun Yang <jun.yang@nxp.com>
---
 examples/ip_pipeline/mempool.c  |  2 +-
 examples/ip_pipeline/pipeline.c | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/examples/ip_pipeline/mempool.c b/examples/ip_pipeline/mempool.c
index f5d2a7d108..d7eea85f8f 100644
--- a/examples/ip_pipeline/mempool.c
+++ b/examples/ip_pipeline/mempool.c
@@ -58,7 +58,7 @@ mempool_create(const char *name, struct mempool_params *params)
 		params->cache_size,
 		0,
 		params->buffer_size - sizeof(struct rte_mbuf),
-		params->cpu_id);
+		rte_lcore_to_socket_id(params->cpu_id));
 
 	if (m == NULL)
 		return NULL;
diff --git a/examples/ip_pipeline/pipeline.c b/examples/ip_pipeline/pipeline.c
index b627310a0c..d8df62d785 100644
--- a/examples/ip_pipeline/pipeline.c
+++ b/examples/ip_pipeline/pipeline.c
@@ -94,7 +94,7 @@ pipeline_create(const char *name, struct pipeline_params *params)
 
 	msgq_req = rte_ring_create(msgq_name,
 		PIPELINE_MSGQ_SIZE,
-		params->cpu_id,
+		rte_lcore_to_socket_id(params->cpu_id),
 		RING_F_SP_ENQ | RING_F_SC_DEQ);
 	if (msgq_req == NULL)
 		return NULL;
@@ -103,7 +103,7 @@ pipeline_create(const char *name, struct pipeline_params *params)
 
 	msgq_rsp = rte_ring_create(msgq_name,
 		PIPELINE_MSGQ_SIZE,
-		params->cpu_id,
+		rte_lcore_to_socket_id(params->cpu_id),
 		RING_F_SP_ENQ | RING_F_SC_DEQ);
 	if (msgq_rsp == NULL) {
 		rte_ring_free(msgq_req);
@@ -111,7 +111,7 @@ pipeline_create(const char *name, struct pipeline_params *params)
 	}
 
 	pp.name = name;
-	pp.socket_id = (int) params->cpu_id;
+	pp.socket_id = (int) rte_lcore_to_socket_id(params->cpu_id);
 	pp.offset_port_id = params->offset_port_id;
 
 	p = rte_pipeline_create(&pp);
@@ -332,7 +332,7 @@ pipeline_port_in_create(const char *pipeline_name,
 
 	if (ap) {
 		action = rte_port_in_action_create(ap->ap,
-			pipeline->cpu_id);
+			rte_lcore_to_socket_id(pipeline->cpu_id));
 		if (action == NULL)
 			return -1;
 
@@ -1002,7 +1002,7 @@ pipeline_table_create(const char *pipeline_name,
 
 	if (ap) {
 		action = rte_table_action_create(ap->ap,
-			pipeline->cpu_id);
+			rte_lcore_to_socket_id(pipeline->cpu_id));
 		if (action == NULL)
 			return -1;
 
-- 
2.17.1


  reply	other threads:[~2019-12-11  5:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-11  5:25 [dpdk-stable] [PATCH 1/2] examples/ip_pipeline: fix crypto queue config Hemant Agrawal
2019-12-11  5:25 ` Hemant Agrawal [this message]
2020-02-14 11:27   ` [dpdk-stable] [dpdk-dev] [PATCH 2/2] examples/ip_pipeline: fix to use sock id instead of cpuid Dumitrescu, Cristian
2020-02-14 15:18     ` [dpdk-stable] [EXT] " Jun Yang
2020-02-18 10:47       ` Dumitrescu, Cristian
2020-02-19 14:17         ` Jun Yang
2020-02-14 10:52 ` [dpdk-stable] [dpdk-dev] [PATCH 1/2] examples/ip_pipeline: fix crypto queue config Zhang, Roy Fan
2020-02-14 11:22 ` Dumitrescu, Cristian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191211052534.14600-2-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=Stable@dpdk.org \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=jun.yang@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).