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: [dpdk-dev] [PATCH v2 07/26] net/ena: restart only initialized queues instead of all
Date: Mon, 4 Jun 2018 14:09:32 +0200 [thread overview]
Message-ID: <20180604120933.16955-7-mk@semihalf.com> (raw)
In-Reply-To: <20180604120933.16955-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 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
next prev parent reply other threads:[~2018-06-04 12:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-04 12:09 [dpdk-dev] [PATCH v2 01/26] net/ena: update ena_com to the newer version Michal Krawczyk
2018-06-04 12:09 ` [dpdk-dev] [PATCH v2 02/26] net/ena: remove support of legacy LLQ Michal Krawczyk
2018-06-04 12:09 ` [dpdk-dev] [PATCH v2 03/26] net/ena: add interrupt handler for admin queue Michal Krawczyk
2018-06-04 12:09 ` [dpdk-dev] [PATCH v2 04/26] net/ena: add stop and uninit routines Michal Krawczyk
2018-06-04 12:09 ` [dpdk-dev] [PATCH v2 05/26] net/ena: add LSC intr support and AENQ handling Michal Krawczyk
2018-06-04 12:09 ` [dpdk-dev] [PATCH v2 06/26] net/ena: handle ENA notification Michal Krawczyk
2018-06-04 12:09 ` Michal Krawczyk [this message]
2018-06-04 12:09 ` [dpdk-dev] [PATCH v2 08/26] net/ena: add reset routine Michal Krawczyk
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=20180604120933.16955-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).