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 269DBA0096 for ; Tue, 4 Jun 2019 12:48:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EF47E1BC70; Tue, 4 Jun 2019 12:48:00 +0200 (CEST) Received: from mail-vs1-f68.google.com (mail-vs1-f68.google.com [209.85.217.68]) by dpdk.org (Postfix) with ESMTP id 89AEA1BC16 for ; Tue, 4 Jun 2019 12:47:58 +0200 (CEST) Received: by mail-vs1-f68.google.com with SMTP id c24so13195251vsp.7 for ; Tue, 04 Jun 2019 03:47:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=o8XY9lgxFlaKijd/dE0/ZXTIQC+dt0XJmJCWjkt3IQ8=; b=fHOrb/+mhQerH22ZsTV+alB8gozWLdRuQlugqBFHtJyNQt0pIHaQhUAkTKm/n+gANJ 30erAN99FR4tA+3jeN2XV4pbqQIM+g9dpYEeo15pYrwtJdbZofblmlzYlVXaOvb6betk KeiIiEtvvpi3XjP9KtTYTQNy5/xfvGsk/AvmShnYZLDBKpAIADP3hBZ1vMfgHbU5dkea +F7u8SxXfNZI6+rtLnYqIDvTuV+Am3kkTXWaSjptCRWVVrdnoAOLatoZm4kL0wRt0Bxb Gv4RBpzAts1o39vrYC5H8HNq8Zf0g6Abo+Riew84ceUkV4Ekue+HG/Mu7pgBM+JMPkWz WJ5A== X-Gm-Message-State: APjAAAXIXFUQOIw+He8pbSem/ckNRVyHXKScC0uK8ke3faiTryFkgneT fbDf6MWIgdt88K2c3rjSKHRb6u8NYz6HQOjaow603g== X-Google-Smtp-Source: APXvYqwV2WSdYvkUzQb63PbK5FQvnh+TnHZSelYjhYd466ibi4TwqHjDucnkLPj8ODxo5tQhyGeV5cNDP7zorM7SJhM= X-Received: by 2002:a67:688f:: with SMTP id d137mr6606310vsc.198.1559645277912; Tue, 04 Jun 2019 03:47:57 -0700 (PDT) MIME-Version: 1.0 References: <1559644299-28575-1-git-send-email-mk@semihalf.com> <1559644955-29088-1-git-send-email-mk@semihalf.com> In-Reply-To: <1559644955-29088-1-git-send-email-mk@semihalf.com> From: David Marchand Date: Tue, 4 Jun 2019 12:47:46 +0200 Message-ID: To: Michal Krawczyk Cc: dev , Marcin Wojtas , gtzalik@amazon.com, evgenys@amazon.com, matua@amazon.com, igorch@amazon.com, "Burakov, Anatoly" , dpdk stable Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-stable] [PATCH v2] net/ena: fix assigning NUMA node to IO queue X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On Tue, Jun 4, 2019 at 12:43 PM Michal Krawczyk wrote: > Previous solution was using memzones in invalid way in hope to assign > IO queue to the appropriate NUMA zone. > > The right way is to use socket_id from the rx/tx queue setup function > and then pass it to the IO queue. > > Fixes: 3d3edc265fc8 ("net/ena: make coherent memory allocation NUMA-aware") > Cc: stable@dpdk.org > > Signed-off-by: Michal Krawczyk > --- > v2: > * Remove gerrit change id > * Add dpdk-stable to cc > > drivers/net/ena/ena_ethdev.c | 24 +++++------------------- > drivers/net/ena/ena_ethdev.h | 2 ++ > 2 files changed, 7 insertions(+), 19 deletions(-) > > diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c > index b6651fc..e9ccb04 100644 > --- a/drivers/net/ena/ena_ethdev.c > +++ b/drivers/net/ena/ena_ethdev.c > @@ -272,22 +272,6 @@ static const struct eth_dev_ops ena_dev_ops = { > .reta_query = ena_rss_reta_query, > }; > > -#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; > -} > - > I suppose you can remove the rte_eal_memconfig.h header inclusion now. static inline void ena_rx_mbuf_prepare(struct rte_mbuf *mbuf, > struct ena_com_rx_ctx *ena_rx_ctx) > { > @@ -1126,7 +1110,7 @@ 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); > + ctx.numa_node = ring->numa_socket_id; > > rc = ena_com_create_io_queue(ena_dev, &ctx); > if (rc) { > @@ -1224,7 +1208,7 @@ static int ena_queue_start(struct ena_ring *ring) > static int ena_tx_queue_setup(struct rte_eth_dev *dev, > uint16_t queue_idx, > uint16_t nb_desc, > - __rte_unused unsigned int socket_id, > + unsigned int socket_id, > const struct rte_eth_txconf *tx_conf) > { > struct ena_ring *txq = NULL; > @@ -1262,6 +1246,7 @@ static int ena_tx_queue_setup(struct rte_eth_dev > *dev, > txq->next_to_clean = 0; > txq->next_to_use = 0; > txq->ring_size = nb_desc; > + txq->numa_socket_id = socket_id; > > txq->tx_buffer_info = rte_zmalloc("txq->tx_buffer_info", > sizeof(struct ena_tx_buffer) * > @@ -1309,7 +1294,7 @@ static int ena_tx_queue_setup(struct rte_eth_dev > *dev, > static int ena_rx_queue_setup(struct rte_eth_dev *dev, > uint16_t queue_idx, > uint16_t nb_desc, > - __rte_unused unsigned int socket_id, > + unsigned int socket_id, > __rte_unused const struct rte_eth_rxconf > *rx_conf, > struct rte_mempool *mp) > { > @@ -1347,6 +1332,7 @@ static int ena_rx_queue_setup(struct rte_eth_dev > *dev, > rxq->next_to_clean = 0; > rxq->next_to_use = 0; > rxq->ring_size = nb_desc; > + rxq->numa_socket_id = socket_id; > rxq->mb_pool = mp; > > rxq->rx_buffer_info = rte_zmalloc("rxq->buffer_info", > diff --git a/drivers/net/ena/ena_ethdev.h b/drivers/net/ena/ena_ethdev.h > index dcc8690..9067e90 100644 > --- a/drivers/net/ena/ena_ethdev.h > +++ b/drivers/net/ena/ena_ethdev.h > @@ -143,6 +143,8 @@ struct ena_ring { > struct ena_stats_rx rx_stats; > struct ena_stats_tx tx_stats; > }; > + > + unsigned int numa_socket_id; > } __rte_cache_aligned; > > enum ena_adapter_state { > -- > 2.7.4 > > Reviewed-by: David Marchand -- David Marchand