DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] vmxnet3: replenish ring buffers in rx processing
@ 2017-08-25 15:22 David Harton
  2017-08-25 15:41 ` Wiles, Keith
  2017-09-10 16:47 ` Shrikrishna Khare
  0 siblings, 2 replies; 6+ messages in thread
From: David Harton @ 2017-08-25 15:22 UTC (permalink / raw)
  To: skhare; +Cc: dev, David Harton

vmxnet3 rx processing should replenish ring buffers after new buffers
are available to prevent the interface from getting stuck in a state
that no new work is processed.

Signed-off-by: David Harton <dharton@cisco.com>
---
 drivers/net/vmxnet3/vmxnet3_rxtx.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index d9cf437..9861d35 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -880,6 +880,23 @@
 		}
 	}
 
+	if (unlikely(nb_rxd == 0)) {
+		uint32_t avail;
+		for (ring_idx = 0; ring_idx < VMXNET3_RX_CMDRING_SIZE; ring_idx++) {
+			avail = vmxnet3_cmd_ring_desc_avail(&rxq->cmd_ring[ring_idx]);
+			if (unlikely(avail > 0)) {
+				/* try to alloc new buf and renew descriptors */
+				vmxnet3_post_rx_bufs(rxq, ring_idx);
+			}
+		}
+		if (unlikely(rxq->shared->ctrl.updateRxProd)) {
+			for (ring_idx = 0; ring_idx < VMXNET3_RX_CMDRING_SIZE; ring_idx++) {
+				VMXNET3_WRITE_BAR0_REG(hw, rxprod_reg[ring_idx] + (rxq->queue_id * VMXNET3_REG_ALIGN),
+						       rxq->cmd_ring[ring_idx].next2fill);
+			}
+		}
+	}
+
 	return nb_rx;
 }
 
-- 
1.8.3.1

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

end of thread, other threads:[~2017-09-11 13:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-25 15:22 [dpdk-dev] [PATCH] vmxnet3: replenish ring buffers in rx processing David Harton
2017-08-25 15:41 ` Wiles, Keith
2017-08-25 15:51   ` David Harton (dharton)
2017-08-25 15:57     ` Wiles, Keith
2017-09-10 16:47 ` Shrikrishna Khare
2017-09-11 13:19   ` Ferruh Yigit

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