From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) by dpdk.org (Postfix) with ESMTP id 666AE2D13 for ; Thu, 7 Jun 2018 11:43:39 +0200 (CEST) Received: by mail-lf0-f66.google.com with SMTP id v135-v6so13648418lfa.9 for ; Thu, 07 Jun 2018 02:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eXiOad6h7zR8a6/2uKwn4P4ivXff1ZoL9yjq4Vuv89g=; b=dopFZBER/SFsQu4hQtziOlMbvukH5ellwacrcVF2tOkoljs7QuNk94CnGOBf4LFwmo BzHn+RLkIFsXd4ScLURLg/pkbDk1wHwPFHuZSJdHe6BDjQgMjBrdBVTtXkyLRQ+Fdoix c280JRA7oSRcWZ95/tPN07jGi993ImHi1O2Kz7hEw9y+qdDYGeQtZCosSTeYQ7gURIin RDecO/DO8IHYJ+Ndpj1RqzcZNYZWZQS5gwSSIUnfSMG+qtugFU1fqO0iT5qq9T7jnKYi u63/p31lBoYVns7j93WUcg0ftPGvWG97hBLEhyUUfTrKpKcOoxlumLTubi/6ZsP1BsJd FRDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=eXiOad6h7zR8a6/2uKwn4P4ivXff1ZoL9yjq4Vuv89g=; b=kzGg5V7fOI7LTEQmTxyuPa/taeo3012z5DKrCj3SsMKnrdI7CdiBmywFXpEavJlF+v 2IcG5dsZIsunbyo5lcabH7o/2dpkSEXdE4uGJQwhEpDNC+JXFx0voUajilCgUGJ6pcM6 jCz3nIiWVCrMhsmZAUs+fzllixM+Tpu0lDJM3rQR5owiMpb5jROqVHRWB5Cycz2ewm5a Fv7eGVHEaFomzfE/Z9GlZaViSrK/6kSDSNCUs9PVHchgeGLo9y0O0gwFf/UGX3G4C0Is XJxHFM5QxKNBPv359mPzzobv0zAVfrNv57DiYKp5thbTclUlaKQOUWiMhVz072gO+oUN QXqA== X-Gm-Message-State: APt69E0z/JRU1yjkroSIWX0Gp4AxnGuReEQv/YjEBSynh8q1k5FXltqe 586TeEEvdhxRt/c/p8bXJc3Ucg== X-Google-Smtp-Source: ADUXVKKJNzUoW//RPhRHQrfHXSII7fbYNtRifmhMlZhn7YSLCqo7KI9P2HlCpEFdafEWZvlh0ushRw== X-Received: by 2002:a2e:44c6:: with SMTP id b67-v6mr961291ljf.120.1528364619067; Thu, 07 Jun 2018 02:43:39 -0700 (PDT) Received: from mkPC.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id p28-v6sm3612368lfh.24.2018.06.07.02.43.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 02:43:38 -0700 (PDT) From: Michal Krawczyk To: Marcin Wojtas , Michal Krawczyk , Guy Tzalik , Evgeny Schemeilin Cc: dev@dpdk.org, matua@amazon.com Date: Thu, 7 Jun 2018 11:43:03 +0200 Message-Id: <20180607094322.14312-8-mk@semihalf.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180607094322.14312-1-mk@semihalf.com> References: <20180607094322.14312-1-mk@semihalf.com> Subject: [dpdk-dev] [PATCH v3 08/27] net/ena: restart only initialized queues instead of all 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: , X-List-Received-Date: Thu, 07 Jun 2018 09:43:40 -0000 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 1b8fc0f42..58cf8a971 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