patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 3/6] net/ena: trigger reset when Tx prepare fails
       [not found] <20210713154118.32111-1-mk@semihalf.com>
@ 2021-07-13 15:41 ` Michal Krawczyk
       [not found] ` <20210714103435.3388-1-mk@semihalf.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Michal Krawczyk @ 2021-07-13 15:41 UTC (permalink / raw)
  To: dev; +Cc: ndagan, shaibran, upstream, Michal Krawczyk, stable, Shay Agroskin

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-stable] [PATCH v2 3/6] net/ena: trigger reset when Tx prepare fails
       [not found] ` <20210714103435.3388-1-mk@semihalf.com>
@ 2021-07-14 10:34   ` Michal Krawczyk
       [not found]   ` <20210714104320.4096-1-mk@semihalf.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Michal Krawczyk @ 2021-07-14 10:34 UTC (permalink / raw)
  To: dev; +Cc: ndagan, shaibran, upstream, Michal Krawczyk, stable, Shay Agroskin

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>
Change-Id: Iff7b3a0e8b0b8e52f5230331b8486bb04a076d5b
---
 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-stable] [PATCH v3 3/6] net/ena: trigger reset when Tx prepare fails
       [not found]   ` <20210714104320.4096-1-mk@semihalf.com>
@ 2021-07-14 10:43     ` Michal Krawczyk
       [not found]     ` <20210723102454.12206-1-mk@semihalf.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Michal Krawczyk @ 2021-07-14 10:43 UTC (permalink / raw)
  To: dev; +Cc: ndagan, shaibran, upstream, Michal Krawczyk, stable, Shay Agroskin

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-stable] [PATCH v4 3/6] net/ena: trigger reset when Tx prepare fails
       [not found]     ` <20210723102454.12206-1-mk@semihalf.com>
@ 2021-07-23 10:24       ` Michal Krawczyk
  0 siblings, 0 replies; 4+ messages in thread
From: Michal Krawczyk @ 2021-07-23 10:24 UTC (permalink / raw)
  To: dev; +Cc: ndagan, shaibran, upstream, Michal Krawczyk, stable, Shay Agroskin

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-23 10:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210713154118.32111-1-mk@semihalf.com>
2021-07-13 15:41 ` [dpdk-stable] [PATCH 3/6] net/ena: trigger reset when Tx prepare fails 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     ` [dpdk-stable] [PATCH v3 " Michal Krawczyk
     [not found]     ` <20210723102454.12206-1-mk@semihalf.com>
2021-07-23 10:24       ` [dpdk-stable] [PATCH v4 " Michal Krawczyk

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).