From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id EF4148DAF for ; Wed, 20 Jan 2016 11:56:02 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 20 Jan 2016 02:56:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,320,1449561600"; d="scan'208";a="894535545" Received: from sie-lab-212-251.ir.intel.com (HELO silpixa00381635.ir.intel.com) ([10.237.212.251]) by orsmga002.jf.intel.com with ESMTP; 20 Jan 2016 02:56:01 -0800 From: Jasvinder Singh To: dev@dpdk.org Date: Wed, 20 Jan 2016 11:01:17 +0000 Message-Id: <1453287677-221142-1-git-send-email-jasvinder.singh@intel.com> X-Mailer: git-send-email 2.5.0 Subject: [dpdk-dev] [PATCH] ip_pipeline: fix cpu socket-id error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 10:56:03 -0000 This patch fixes the socket-id error in ip_pipeline sample application running over uni-processor systems. Signed-off-by: Jasvinder Singh Acked-by: Cristian Dumitrescu --- examples/ip_pipeline/init.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/examples/ip_pipeline/init.c b/examples/ip_pipeline/init.c index 186ca03..86aa378 100644 --- a/examples/ip_pipeline/init.c +++ b/examples/ip_pipeline/init.c @@ -835,6 +835,17 @@ app_init_link_frag_ras(struct app_params *app) } } +static inline int +app_get_cpu_socket_id(uint32_t pmd_id) +{ + int status = rte_eth_dev_socket_id(pmd_id); + + if (status == -1) + return 0; + + return status; +} + static void app_init_link(struct app_params *app) { @@ -890,7 +901,7 @@ app_init_link(struct app_params *app) p_link->pmd_id, rxq_queue_id, p_rxq->size, - rte_eth_dev_socket_id(p_link->pmd_id), + app_get_cpu_socket_id(p_link->pmd_id), &p_rxq->conf, app->mempool[p_rxq->mempool_id]); if (status < 0) @@ -917,7 +928,7 @@ app_init_link(struct app_params *app) p_link->pmd_id, txq_queue_id, p_txq->size, - rte_eth_dev_socket_id(p_link->pmd_id), + app_get_cpu_socket_id(p_link->pmd_id), &p_txq->conf); if (status < 0) rte_panic("%s (%" PRIu32 "): " @@ -989,7 +1000,7 @@ app_init_tm(struct app_params *app) /* TM */ p_tm->sched_port_params.name = p_tm->name; p_tm->sched_port_params.socket = - rte_eth_dev_socket_id(p_link->pmd_id); + app_get_cpu_socket_id(p_link->pmd_id); p_tm->sched_port_params.rate = (uint64_t) link_eth_params.link_speed * 1000 * 1000 / 8; -- 2.5.0