net/gve: always attempt Rx refill on DQ

Message ID 20241001234533.3308368-1-joshwash@google.com (mailing list archive)
State Accepted
Delegated to: Ferruh Yigit
Headers
Series net/gve: always attempt Rx refill on DQ |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS

Commit Message

Joshua Washington Oct. 1, 2024, 11:45 p.m. UTC
Before this patch, gve_rx_refill_dqo() is only called if the number of
packets received in a cycle is non-zero. However, in a
memory-constrained scenario, this doesn't behave well, as this could be
a potential source of lockup, if there is no memory and all buffers have
been received before memory is freed up for the driver to use.

This patch moves the gve_rx_refill_dqo() call to occur regardless of
whether packets have been received so that in the case that enough
memory is freed, the driver can recover.

Fixes: 45da16b5b181 ("net/gve: support basic Rx data path for DQO")
Cc: stable@dpdk.org

Signed-off-by: Joshua Washington <joshwash@google.com>
Reviewed-by: Praveen Kaligineedi <pkaligineedi@google.com>
Reviewed-by: Rushil Gupta <rushilg@google.com>
---
 .mailmap                     | 1 +
 drivers/net/gve/gve_rx_dqo.c | 6 ++----
 2 files changed, 3 insertions(+), 4 deletions(-)
  

Comments

Ferruh Yigit Oct. 4, 2024, 4:47 a.m. UTC | #1
On 10/2/2024 12:45 AM, Joshua Washington wrote:
> Before this patch, gve_rx_refill_dqo() is only called if the number of
> packets received in a cycle is non-zero. However, in a
> memory-constrained scenario, this doesn't behave well, as this could be
> a potential source of lockup, if there is no memory and all buffers have
> been received before memory is freed up for the driver to use.
> 
> This patch moves the gve_rx_refill_dqo() call to occur regardless of
> whether packets have been received so that in the case that enough
> memory is freed, the driver can recover.
> 
> Fixes: 45da16b5b181 ("net/gve: support basic Rx data path for DQO")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Joshua Washington <joshwash@google.com>
> Reviewed-by: Praveen Kaligineedi <pkaligineedi@google.com>
> Reviewed-by: Rushil Gupta <rushilg@google.com>
>

Applied to dpdk-next-net/main, thanks.
  

Patch

diff --git a/.mailmap b/.mailmap
index d798a3f30f..d2f30cf8eb 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1174,6 +1174,7 @@  Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
 Prashant Upadhyaya <prashant.upadhyaya@aricent.com> <praupadhyaya@gmail.com>
 Prateek Agarwal <prateekag@cse.iitb.ac.in>
 Prathisna Padmasanan <prathisna.padmasanan@intel.com>
+Praveen Kaligineedi <pkaligineedi@google.com>
 Praveen Shetty <praveen.shetty@intel.com>
 Pravin Pathak <pravin.pathak@intel.com>
 Prince Takkar <ptakkar@marvell.com>
diff --git a/drivers/net/gve/gve_rx_dqo.c b/drivers/net/gve/gve_rx_dqo.c
index d8e9eee4a8..60702d4100 100644
--- a/drivers/net/gve/gve_rx_dqo.c
+++ b/drivers/net/gve/gve_rx_dqo.c
@@ -195,14 +195,12 @@  gve_rx_burst_dqo(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 
 	if (nb_rx > 0) {
 		rxq->rx_tail = rx_id;
-		if (rx_id_bufq != rxq->next_avail)
-			rxq->next_avail = rx_id_bufq;
-
-		gve_rx_refill_dqo(rxq);
+		rxq->next_avail = rx_id_bufq;
 
 		rxq->stats.packets += nb_rx;
 		rxq->stats.bytes += bytes;
 	}
+	gve_rx_refill_dqo(rxq);
 
 	return nb_rx;
 }