From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 629B9A04F1; Wed, 11 Dec 2019 06:29:29 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 861971B994; Wed, 11 Dec 2019 06:29:27 +0100 (CET) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id DFF4D2C6A; Wed, 11 Dec 2019 06:29:25 +0100 (CET) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 4A8681A00AB; Wed, 11 Dec 2019 06:29:25 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 1BC081A0033; Wed, 11 Dec 2019 06:29:23 +0100 (CET) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id EFC19402AE; Wed, 11 Dec 2019 13:29:19 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: cristian.dumitrescu@intel.com, Stable@dpdk.org, Jun Yang Date: Wed, 11 Dec 2019 10:55:34 +0530 Message-Id: <20191211052534.14600-2-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191211052534.14600-1-hemant.agrawal@nxp.com> References: <20191211052534.14600-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 2/2] examples/ip_pipeline: fix to use sock id instead of cpuid X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Jun Yang 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 --- 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