From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Krawczyk Subject: [PATCH v2 07/26] net/ena: restart only initialized queues instead of all Date: Mon, 4 Jun 2018 14:09:32 +0200 Message-ID: <20180604120933.16955-7-mk@semihalf.com> References: <20180604120933.16955-1-mk@semihalf.com> Cc: dev@dpdk.org, matua@amazon.com To: Marcin Wojtas , Michal Krawczyk , Guy Tzalik , Evgeny Schemeilin Return-path: Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) by dpdk.org (Postfix) with ESMTP id 581E45B40 for ; Mon, 4 Jun 2018 14:09:48 +0200 (CEST) Received: by mail-lf0-f68.google.com with SMTP id i83-v6so12652703lfh.5 for ; Mon, 04 Jun 2018 05:09:48 -0700 (PDT) In-Reply-To: <20180604120933.16955-1-mk@semihalf.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" There is no need to check for restart all queues. It is sufficient to check only previously initialized queues. Signed-off-by: Michal Krawczyk --- drivers/net/ena/ena_ethdev.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index ae13916d1..fc4776327 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -749,13 +749,18 @@ static int ena_queue_restart_all(struct rte_eth_dev *dev, struct ena_adapter *adapter = (struct ena_adapter *)(dev->data->dev_private); struct ena_ring *queues = NULL; + int nb_queues; int i = 0; int rc = 0; - queues = (ring_type == ENA_RING_TYPE_RX) ? - adapter->rx_ring : adapter->tx_ring; - - for (i = 0; i < adapter->num_queues; i++) { + if (ring_type == ENA_RING_TYPE_RX) { + queues = adapter->rx_ring; + nb_queues = dev->data->nb_rx_queues; + } else { + queues = adapter->tx_ring; + nb_queues = dev->data->nb_tx_queues; + } + for (i = 0; i < nb_queues; i++) { if (queues[i].configured) { if (ring_type == ENA_RING_TYPE_RX) { ena_assert_msg( -- 2.14.1