patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Michal Krawczyk <mk@semihalf.com>
To: dev@dpdk.org
Cc: ndagan@amazon.com, shaibran@amazon.com, upstream@semihalf.com,
	Michal Krawczyk <mk@semihalf.com>,
	stable@dpdk.org, Shay Agroskin <shayagr@amazon.com>
Subject: [dpdk-stable] [PATCH v3 3/6] net/ena: trigger reset when Tx prepare fails
Date: Wed, 14 Jul 2021 12:43:17 +0200	[thread overview]
Message-ID: <20210714104320.4096-4-mk@semihalf.com> (raw)
In-Reply-To: <20210714104320.4096-1-mk@semihalf.com>

If the prepare function failed, then it means the descriptors are in the
invalid state.

This condition now triggers the reset, which should be further handled
by the application.

To notify the application about prepare function failure, the error log
was added. In general, it should never fail in normal conditions, as the
Tx function checks for the available space in the Tx ring before the
preparation even starts.

Fixes: 2081d5e2e92d ("net/ena: add reset routine")
Cc: stable@dpdk.org

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Shai Brandes <shaibran@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
---
 drivers/net/ena/ena_ethdev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 2335436b6c..67cd91046a 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -2570,7 +2570,11 @@ static int ena_xmit_mbuf(struct ena_ring *tx_ring, struct rte_mbuf *mbuf)
 	rc = ena_com_prepare_tx(tx_ring->ena_com_io_sq,	&ena_tx_ctx,
 		&nb_hw_desc);
 	if (unlikely(rc)) {
+		PMD_DRV_LOG(ERR, "Failed to prepare Tx buffers, rc: %d\n", rc);
 		++tx_ring->tx_stats.prepare_ctx_err;
+		tx_ring->adapter->reset_reason =
+		    ENA_REGS_RESET_DRIVER_INVALID_STATE;
+		tx_ring->adapter->trigger_reset = true;
 		return rc;
 	}
 
-- 
2.25.1


  parent reply	other threads:[~2021-07-14 10:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210713154118.32111-1-mk@semihalf.com>
2021-07-13 15:41 ` [dpdk-stable] [PATCH " Michal Krawczyk
     [not found] ` <20210714103435.3388-1-mk@semihalf.com>
2021-07-14 10:34   ` [dpdk-stable] [PATCH v2 " Michal Krawczyk
     [not found]   ` <20210714104320.4096-1-mk@semihalf.com>
2021-07-14 10:43     ` Michal Krawczyk [this message]
     [not found]     ` <20210723102454.12206-1-mk@semihalf.com>
2021-07-23 10:24       ` [dpdk-stable] [PATCH v4 " 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=20210714104320.4096-4-mk@semihalf.com \
    --to=mk@semihalf.com \
    --cc=dev@dpdk.org \
    --cc=ndagan@amazon.com \
    --cc=shaibran@amazon.com \
    --cc=shayagr@amazon.com \
    --cc=stable@dpdk.org \
    --cc=upstream@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).