All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Krawczyk <mk@semihalf.com>
To: Marcin Wojtas <mw@semihalf.com>,
	Michal Krawczyk <mk@semihalf.com>,
	Guy Tzalik <gtzalik@amazon.com>,
	Evgeny Schemeilin <evgenys@amazon.com>
Cc: dev@dpdk.org, matua@amazon.com
Subject: [PATCH v1 07/24] net/ena: restart only initialized queues instead of all
Date: Wed,  9 May 2018 14:45:51 +0200	[thread overview]
Message-ID: <20180509124552.22854-7-mk@semihalf.com> (raw)
In-Reply-To: <20180509124552.22854-1-mk@semihalf.com>

There is no need to check for restart all queues. It is sufficient to
check only previously initialized queues.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
---
 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 09a5ee6c8..fc2ee6a4f 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -753,13 +753,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

  parent reply	other threads:[~2018-05-09 12:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-09 12:45 [PATCH v1 01/24] net/ena: update ena_com to the newer version Michal Krawczyk
2018-05-09 12:45 ` [PATCH v1 02/24] net/ena: remove support of legacy LLQ Michal Krawczyk
2018-05-09 12:45 ` [PATCH v1 03/24] net/ena: add interrupt handler for admin queue Michal Krawczyk
2018-05-09 12:45 ` [PATCH v1 04/24] net/ena: add stop and uninit routines Michal Krawczyk
2018-05-09 12:45 ` [PATCH v1 05/24] net/ena: add LSC intr support and AENQ handling Michal Krawczyk
2018-05-09 12:45 ` [PATCH v1 06/24] net/ena: handle ENA notification Michal Krawczyk
2018-05-09 12:45 ` Michal Krawczyk [this message]
2018-05-09 12:45 ` [PATCH v1 08/24] net/ena: add reset routine Michal Krawczyk
2018-05-31 15:12 ` [PATCH v1 01/24] net/ena: update ena_com to the newer version Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180509124552.22854-7-mk@semihalf.com \
    --to=mk@semihalf.com \
    --cc=dev@dpdk.org \
    --cc=evgenys@amazon.com \
    --cc=gtzalik@amazon.com \
    --cc=matua@amazon.com \
    --cc=mw@semihalf.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.