From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 2CA03A045E for ; Wed, 29 May 2019 18:35:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 278411BA8F; Wed, 29 May 2019 18:32:04 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 2EE3A1BA46 for ; Wed, 29 May 2019 18:31:58 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 May 2019 09:31:58 -0700 X-ExtLoop1: 1 Received: from silpixa00399498.ir.intel.com (HELO silpixa00399498.ger.corp.intel.com) ([10.237.223.125]) by orsmga005.jf.intel.com with ESMTP; 29 May 2019 09:31:56 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Marcin Wojtas , Michal Krawczyk , Guy Tzalik , Evgeny Schemeilin , stephen@networkplumber.org, thomas@monjalon.net, david.marchand@redhat.com Date: Wed, 29 May 2019 17:31:10 +0100 Message-Id: <5f6e26e27ad524f85ee9a911aeebae69f1ec0c1a.1559147228.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH 24/25] net/ena: fix direct access to shared memory config 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" The ENA driver calculates a ring's NUMA node affinity by directly accessing the memzone list. Fix it to do it through the public API's instead. Signed-off-by: Anatoly Burakov --- drivers/net/ena/ena_ethdev.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index b6651fc0f..e745e9e92 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -274,20 +274,6 @@ static const struct eth_dev_ops ena_dev_ops = { #define NUMA_NO_NODE SOCKET_ID_ANY -static inline int ena_cpu_to_node(int cpu) -{ - struct rte_config *config = rte_eal_get_configuration(); - struct rte_fbarray *arr = &config->mem_config->memzones; - const struct rte_memzone *mz; - - if (unlikely(cpu >= RTE_MAX_MEMZONE)) - return NUMA_NO_NODE; - - mz = rte_fbarray_get(arr, cpu); - - return mz->socket_id; -} - static inline void ena_rx_mbuf_prepare(struct rte_mbuf *mbuf, struct ena_com_rx_ctx *ena_rx_ctx) { @@ -1099,6 +1085,7 @@ static int ena_create_io_queue(struct ena_ring *ring) { struct ena_adapter *adapter; struct ena_com_dev *ena_dev; + struct rte_memseg_list *msl; struct ena_com_create_io_ctx ctx = /* policy set to _HOST just to satisfy icc compiler */ { ENA_ADMIN_PLACEMENT_POLICY_HOST, @@ -1126,7 +1113,8 @@ static int ena_create_io_queue(struct ena_ring *ring) } ctx.qid = ena_qid; ctx.msix_vector = -1; /* interrupts not used */ - ctx.numa_node = ena_cpu_to_node(ring->id); + msl = rte_mem_virt2memseg_list(ring); + ctx.numa_node = msl->socket_id; rc = ena_com_create_io_queue(ena_dev, &ctx); if (rc) { -- 2.17.1