From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by dpdk.org (Postfix) with ESMTP id 73425590E for ; Wed, 30 Apr 2014 15:16:20 +0200 (CEST) Received: by mail-wg0-f50.google.com with SMTP id k14so1653481wgh.33 for ; Wed, 30 Apr 2014 06:16:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=hpC/14z/3BjKgy/w3+w4iBW1bvBEWuGfp3S19nUDRlk=; b=ciYndeanxXL5ejCFLN91Zw+aytt8g5vrHEHJR7DgNUadZZl1aPznc8U1AzmhiBRppk ZWTd2x370gzpXTGE6iN4Z4YhhxwHc1i461z+yyqRvlwK/3jOlhpqBhQ2/s1XWpClH6+l z8jRva4QEc76K66poskVJ988LMck7RwdbnC1oGzwMpXH9mxpcon5g4NKtRMk2vOzxSU7 NlujkOpsIQfu9lEjjjeW+X+YrKw0MHI78R1GTWNYsIgXpWNJms017j+QjOHiULHjRyCv 1Hj9Z4marzil2GXKOn7H6uxVYCSZJF8Iz6MP0jrSgxNwSsMV9T+oyPSTTy03oEpvcX4w 1Q3A== X-Gm-Message-State: ALoCoQmrrg53eIwWaYgQt9ZI9Icb/dnKARJbUjzyXb26HiAHjU5zmczxr+Iez8mjHIjIlE2tC7MU X-Received: by 10.180.85.134 with SMTP id h6mr3706123wiz.44.1398863784247; Wed, 30 Apr 2014 06:16:24 -0700 (PDT) Received: from alcyon.dev.6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id gc2sm3609007wic.3.2014.04.30.06.16.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Apr 2014 06:16:23 -0700 (PDT) From: David Marchand To: dev@dpdk.org Date: Wed, 30 Apr 2014 15:16:16 +0200 Message-Id: <1398863776-31121-1-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.7.10.4 Subject: [dpdk-dev] [PATCH] app/testpmd: fix crash when using set fwd tx_first with NUMA 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, 30 Apr 2014 13:16:20 -0000 From: Adrien Mazarguil When NUMA is enabled, the per-core fwd_lcore structure mbuf pool pointer is not set, causing a crash. Initialize fwd_lcore after allocating NUMA memory pools. Signed-off-by: Adrien Mazarguil --- app/test-pmd/testpmd.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 97229a5..9c56914 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -552,15 +552,6 @@ init_config(void) mbuf_pool_create(mbuf_data_size, nb_mbuf_per_pool, socket_num); } - /* - * Records which Mbuf pool to use by each logical core, if needed. - */ - for (lc_id = 0; lc_id < nb_lcores; lc_id++) { - mbp = mbuf_pool_find(rte_lcore_to_socket_id(lc_id)); - if (mbp == NULL) - mbp = mbuf_pool_find(0); - fwd_lcores[lc_id]->mbp = mbp; - } /* Configuration of Ethernet ports. */ ports = rte_zmalloc("testpmd: ports", @@ -609,6 +600,17 @@ init_config(void) } } init_port_config(); + + /* + * Records which Mbuf pool to use by each logical core, if needed. + */ + for (lc_id = 0; lc_id < nb_lcores; lc_id++) { + mbp = mbuf_pool_find(rte_lcore_to_socket_id(lc_id)); + if (mbp == NULL) + mbp = mbuf_pool_find(0); + fwd_lcores[lc_id]->mbp = mbp; + } + /* Configuration of packet forwarding streams. */ if (init_fwd_streams() < 0) rte_exit(EXIT_FAILURE, "FAIL from init_fwd_streams()\n"); -- 1.7.10.4