[dpdk-stable] patch 'net/ena: prevent double doorbell' has been queued to stable release 20.11.1

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Feb 5 12:19:18 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/07/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/0eedd3ea60fd71e7235eafb2bd676966c054ea10

Thanks.

Luca Boccassi

---
>From 0eedd3ea60fd71e7235eafb2bd676966c054ea10 Mon Sep 17 00:00:00 2001
From: Igor Chauskin <igorch at amazon.com>
Date: Tue, 26 Jan 2021 19:32:26 +0100
Subject: [PATCH] net/ena: prevent double doorbell

[ upstream commit 1d973d8f4c149523a15c1c0813f204bb89d4e588 ]

Add per-tx-ring flag for packets that were pushed to HW but await
doorbell. That is to prevent a situation when a doorbell is sent due to
reaching Tx burst threshold and next send fails (e.g., due to queue
full). In such case we shouldn't send another doorbell because there are
no actual packets waiting for transmission.

Fixes: c7519ea5eb8d ("net/ena: call additional doorbells if needed")

Signed-off-by: Igor Chauskin <igorch at amazon.com>
Reviewed-by: Michal Krawczyk <mk at semihalf.com>
---
 drivers/net/ena/ena_ethdev.c | 7 +++++--
 drivers/net/ena/ena_ethdev.h | 4 ++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 4083568d5d..8baec80040 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -1282,6 +1282,7 @@ static int ena_tx_queue_setup(struct rte_eth_dev *dev,
 	txq->ring_size = nb_desc;
 	txq->size_mask = nb_desc - 1;
 	txq->numa_socket_id = socket_id;
+	txq->pkts_without_db = false;
 
 	txq->tx_buffer_info = rte_zmalloc("txq->tx_buffer_info",
 					  sizeof(struct ena_tx_buffer) *
@@ -2522,6 +2523,7 @@ static int ena_xmit_mbuf(struct ena_ring *tx_ring, struct rte_mbuf *mbuf)
 			tx_ring->id);
 		ena_com_write_sq_doorbell(tx_ring->ena_com_io_sq);
 		tx_ring->tx_stats.doorbells++;
+		tx_ring->pkts_without_db = false;
 	}
 
 	/* prepare the packet's descriptors to dma engine */
@@ -2603,7 +2605,7 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 	for (sent_idx = 0; sent_idx < nb_pkts; sent_idx++) {
 		if (ena_xmit_mbuf(tx_ring, tx_pkts[sent_idx]))
 			break;
-
+		tx_ring->pkts_without_db = true;
 		rte_prefetch0(tx_pkts[ENA_IDX_ADD_MASKED(sent_idx, 4,
 			tx_ring->size_mask)]);
 	}
@@ -2612,10 +2614,11 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		ena_com_free_q_entries(tx_ring->ena_com_io_sq);
 
 	/* If there are ready packets to be xmitted... */
-	if (sent_idx > 0) {
+	if (likely(tx_ring->pkts_without_db)) {
 		/* ...let HW do its best :-) */
 		ena_com_write_sq_doorbell(tx_ring->ena_com_io_sq);
 		tx_ring->tx_stats.doorbells++;
+		tx_ring->pkts_without_db = false;
 	}
 
 	ena_tx_cleanup(tx_ring);
diff --git a/drivers/net/ena/ena_ethdev.h b/drivers/net/ena/ena_ethdev.h
index 7bb74a1d06..ae235897ee 100644
--- a/drivers/net/ena/ena_ethdev.h
+++ b/drivers/net/ena/ena_ethdev.h
@@ -100,6 +100,10 @@ struct ena_ring {
 
 	enum ena_ring_type type;
 	enum ena_admin_placement_policy_type tx_mem_queue_type;
+
+	/* Indicate there are Tx packets pushed to the device and wait for db */
+	bool pkts_without_db;
+
 	/* Holds the empty requests for TX/RX OOO completions */
 	union {
 		uint16_t *empty_tx_reqs;
-- 
2.29.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-02-05 11:18:41.185024559 +0000
+++ 0272-net-ena-prevent-double-doorbell.patch	2021-02-05 11:18:29.358701621 +0000
@@ -1 +1 @@
-From 1d973d8f4c149523a15c1c0813f204bb89d4e588 Mon Sep 17 00:00:00 2001
+From 0eedd3ea60fd71e7235eafb2bd676966c054ea10 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 1d973d8f4c149523a15c1c0813f204bb89d4e588 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index 8a937d7f27..7acbf5e305 100644
+index 4083568d5d..8baec80040 100644


More information about the stable mailing list