<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Here is a patch, I let you amend it if needed as I'm a beginner in the dpdk project</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Thanks<br>
</div>
<div id="appendonsend"></div>
<div id="content_out_jhascoet_kalrayinc.com"></div><hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>De :</b> David Marchand <david.marchand@redhat.com><br>
<b>Envoyé :</b> lundi 7 août 2023 09:26<br>
<b>À :</b> Julien Hascoet <jhascoet@kalrayinc.com>; Olivier Matz <olivier.matz@6wind.com><br>
<b>Cc :</b> dev@dpdk.org <dev@dpdk.org><br>
<b>Objet :</b> Re: [TEST] dpdk/app/test/test_mbuf.c test_refcnt_mbuf instability + fix proposal</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hello Julien,<br>
<br>
On Mon, Aug 7, 2023 at 8:19 AM Julien Hascoet <jhascoet@kalrayinc.com> wrote:<br>
> from my understanding after debugging, in test_refcnt_iter the return value of rte_ring_enqueue is not checked; leading to lack of expected mbufs at the end checks.<br>
><br>
> Here is some fix proposal that seems to work after running endurance tests for several days:<br>
><br>
> diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c<br>
> index b4f436b5e2..8a5d26e4f6 100644<br>
> --- a/app/test/test_mbuf.c<br>
> +++ b/app/test/test_mbuf.c<br>
> @@ -1033,12 +1033,17 @@ test_refcnt_iter(unsigned int lcore, unsigned int iter,<br>
>                 tref += ref;<br>
>                 if ((ref & 1) != 0) {<br>
>                         rte_pktmbuf_refcnt_update(m, ref);<br>
> -                       while (ref-- != 0)<br>
> -                               rte_ring_enqueue(refcnt_mbuf_ring, m);<br>
> +                       while (ref-- != 0) {<br>
> +                               /* retry in case of failure */<br>
> +                               while (rte_ring_enqueue(refcnt_mbuf_ring, m) != 0)<br>
> +                                       ;<br>
> +                       }<br>
>                 } else {<br>
>                         while (ref-- != 0) {<br>
>                                 rte_pktmbuf_refcnt_update(m, 1);<br>
> -                               rte_ring_enqueue(refcnt_mbuf_ring, m);<br>
> +                               /* retry in case of failure */<br>
> +                               while (rte_ring_enqueue(refcnt_mbuf_ring, m) != 0)<br>
> +                                       ;<br>
>                         }<br>
>                 }<br>
>                 rte_pktmbuf_free(m);<br>
><br>
> Can you confirm ?<br>
<br>
This analysis looks correct (though failing to enqueue in this unit<br>
test seems strange to me).<br>
Could you send a fix with a Fixes: line in the commitlog, and copying<br>
the maintainer?<br>
<br>
Thanks.<br>
<br>
<br>
-- <br>
David Marchand<br>
<br>
<br>
<br>
<br>
<br>
</div>
</span></font></div>
</body>
</html>