app: fix silent enqueue fail in test_mbuf test_refcnt_iter
Checks
Commit Message
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(-)
Comments
On Wed, Aug 9, 2023 at 7:39 AM jhascoet <ju.hascoet@gmail.com> wrote:
>
> In case of ring full state, we retry the enqueue
> operation in order to avoid mbuf loss.
>
> Fixes: af75078fece ("first public release")
Not sure we need to backport, but in doubt, I would mark it
Cc: stable@dpdk.org
>
> Signed-off-by: Julien Hascoet <jhascoet@kalrayinc.com>
Olivier, the patch lgtm, can you have a look?
Thanks.
@@ -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);