DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] app: fix silent enqueue fail in test_mbuf test_refcnt_iter
@ 2023-08-09  5:38 jhascoet
  2023-08-09  9:18 ` David Marchand
  2023-08-10  6:00 ` jhascoet
  0 siblings, 2 replies; 16+ messages in thread
From: jhascoet @ 2023-08-09  5:38 UTC (permalink / raw)
  To: david.marchand; +Cc: dev, jhascoet, Julien Hascoet

In case of ring full state, we retry the enqueue
operation in order to avoid mbuf loss.

Fixes: af75078fece ("first public release")

Signed-off-by: Julien Hascoet <jhascoet@kalrayinc.com>
---
 app/test/test_mbuf.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index efac01806b..be114e3302 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -1033,12 +1033,17 @@ test_refcnt_iter(unsigned int lcore, unsigned int iter,
 		tref += ref;
 		if ((ref & 1) != 0) {
 			rte_pktmbuf_refcnt_update(m, ref);
-			while (ref-- != 0)
-				rte_ring_enqueue(refcnt_mbuf_ring, m);
+			while (ref-- != 0) {
+				/* retry in case of failure */
+				while (rte_ring_enqueue(refcnt_mbuf_ring, m) != 0)
+					;
+			}
 		} else {
 			while (ref-- != 0) {
 				rte_pktmbuf_refcnt_update(m, 1);
-				rte_ring_enqueue(refcnt_mbuf_ring, m);
+				/* retry in case of failure */
+				while (rte_ring_enqueue(refcnt_mbuf_ring, m) != 0)
+					;
 			}
 		}
 		rte_pktmbuf_free(m);
-- 
2.34.1


^ permalink raw reply	[flat|nested] 16+ messages in thread
* [PATCH] app: fix silent enqueue fail in test_mbuf test_refcnt_iter
@ 2023-08-09 14:14 jhascoet
  0 siblings, 0 replies; 16+ messages in thread
From: jhascoet @ 2023-08-09 14:14 UTC (permalink / raw)
  To: david.marchand; +Cc: dev, Julien Hascoet

From: Julien Hascoet <ju.hascoet@gmail.com>

In case of ring full state, we retry the enqueue
operation in order to avoid mbuf loss.

Fixes: af75078fece ("first public release")

Signed-off-by: Julien Hascoet <ju.hascoet@gmail.com>
---
 app/test/test_mbuf.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index efac01806b..be114e3302 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -1033,12 +1033,17 @@ test_refcnt_iter(unsigned int lcore, unsigned int iter,
 		tref += ref;
 		if ((ref & 1) != 0) {
 			rte_pktmbuf_refcnt_update(m, ref);
-			while (ref-- != 0)
-				rte_ring_enqueue(refcnt_mbuf_ring, m);
+			while (ref-- != 0) {
+				/* retry in case of failure */
+				while (rte_ring_enqueue(refcnt_mbuf_ring, m) != 0)
+					;
+			}
 		} else {
 			while (ref-- != 0) {
 				rte_pktmbuf_refcnt_update(m, 1);
-				rte_ring_enqueue(refcnt_mbuf_ring, m);
+				/* retry in case of failure */
+				while (rte_ring_enqueue(refcnt_mbuf_ring, m) != 0)
+					;
 			}
 		}
 		rte_pktmbuf_free(m);
-- 
2.34.1


^ permalink raw reply	[flat|nested] 16+ messages in thread
* [PATCH] app: fix silent enqueue fail in test_mbuf test_refcnt_iter
@ 2023-08-10 15:39 jhascoet
  0 siblings, 0 replies; 16+ messages in thread
From: jhascoet @ 2023-08-10 15:39 UTC (permalink / raw)
  To: david.marchand; +Cc: dev, Julien Hascoet

From: Julien Hascoet <ju.hascoet@gmail.com>

In case of ring full state, we retry the enqueue
operation in order to avoid mbuf loss.

Fixes: af75078fece ("first public release")

Signed-off-by: Julien Hascoet <ju.hascoet@gmail.com>
---
 app/test/test_mbuf.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index efac01806b..be114e3302 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -1033,12 +1033,17 @@ test_refcnt_iter(unsigned int lcore, unsigned int iter,
 		tref += ref;
 		if ((ref & 1) != 0) {
 			rte_pktmbuf_refcnt_update(m, ref);
-			while (ref-- != 0)
-				rte_ring_enqueue(refcnt_mbuf_ring, m);
+			while (ref-- != 0) {
+				/* retry in case of failure */
+				while (rte_ring_enqueue(refcnt_mbuf_ring, m) != 0)
+					;
+			}
 		} else {
 			while (ref-- != 0) {
 				rte_pktmbuf_refcnt_update(m, 1);
-				rte_ring_enqueue(refcnt_mbuf_ring, m);
+				/* retry in case of failure */
+				while (rte_ring_enqueue(refcnt_mbuf_ring, m) != 0)
+					;
 			}
 		}
 		rte_pktmbuf_free(m);
-- 
2.34.1


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

end of thread, other threads:[~2024-10-04 21:18 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-09  5:38 [PATCH] app: fix silent enqueue fail in test_mbuf test_refcnt_iter jhascoet
2023-08-09  9:18 ` David Marchand
2023-08-10  6:00 ` jhascoet
2023-08-10 15:33   ` Stephen Hemminger
2023-08-10 15:40     ` [PUB] " Julien Hascoet
2023-08-10 16:09   ` jhascoet
2023-08-18  5:16     ` Hascoet Julien
2023-08-18  6:25       ` David Marchand
2023-08-22  6:34     ` jhascoet
2023-08-22  8:34       ` Olivier Matz
2023-08-24  6:51         ` Hascoet Julien
2023-08-30 16:16       ` Thomas Monjalon
2023-08-24  7:37     ` [PATCH] app: enhance error check if " jhascoet
2024-10-04 21:18       ` Stephen Hemminger
2023-08-09 14:14 [PATCH] app: fix silent " jhascoet
2023-08-10 15:39 jhascoet

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