<div dir="ltr">Hello,<div><br></div><div>mempool drivers is listed here. </div><div><a href="https://doc.dpdk.org/guides/mempool/index.html">https://doc.dpdk.org/guides/mempool/index.html</a><br></div><div><br></div><div>my app loads <strong style="box-sizing:border-box;color:rgb(64,64,64);font-family:Lato,proxima-nova,"Helvetica Neue",Arial,sans-serif;font-size:16px;background-color:rgb(252,252,252)">rte_mempool_ring</strong><span style="color:rgb(64,64,64);font-family:Lato,proxima-nova,"Helvetica Neue",Arial,sans-serif;font-size:16px;background-color:rgb(252,252,252)"> and also </span><strong style="box-sizing:border-box;color:rgb(64,64,64);font-family:Lato,proxima-nova,"Helvetica Neue",Arial,sans-serif;font-size:16px;background-color:rgb(252,252,252)">rte_mempool_stack</strong><span style="color:rgb(64,64,64);font-family:Lato,proxima-nova,"Helvetica Neue",Arial,sans-serif;font-size:16px;background-color:rgb(252,252,252)"> . In doc, rte_mempool_ring is default mempool driver.</span></div><div><span style="color:rgb(64,64,64);font-family:Lato,proxima-nova,"Helvetica Neue",Arial,sans-serif;font-size:16px;background-color:rgb(252,252,252)"><br></span></div><div><span style="color:rgb(64,64,64);font-family:Lato,proxima-nova,"Helvetica Neue",Arial,sans-serif;font-size:16px;background-color:rgb(252,252,252)">"</span>-d librte_mbuf.so -d librte_mempool.so -d librte_mempool_ring.so -d librte_mempool_stack.so -d librte_mempool_bucket.so -d librte_kni.so"</div><div><br></div><div>EAL: open shared lib librte_mbuf.so<br>EAL: open shared lib librte_mempool.so<br>EAL: open shared lib librte_mempool_ring.so<br>EAL: open shared lib librte_mempool_stack.so<br>EAL: lib.stack log level changed from disabled to notice<br>EAL: open shared lib librte_mempool_bucket.so<br>EAL: open shared lib librte_kni.so<br>EAL: open shared lib DPDK_LIBS/lib/x86_64-linux-gnu/dpdk/pmds-23.0/librte_mempool_octeontx.so<br>EAL: pmd.octeontx.mbox log level changed from disabled to notice<br>EAL: pmd.mempool.octeontx log level changed from disabled to notice<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Morten Brørup <<a href="mailto:mb@smartsharesystems.com">mb@smartsharesystems.com</a>>, 17 May 2023 Çar, 12:04 tarihinde şunu yazdı:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg-7325796300504299815"><div lang="EN-US"><div class="m_-7325796300504299815WordSection1"><div style="border-top:none;border-right:none;border-bottom:none;border-left:1.5pt solid blue;padding:0cm 0cm 0cm 4pt"><p class="MsoNormal"><b><span style="font-size:10pt;font-family:Tahoma,"sans-serif"">From:</span></b><span style="font-size:10pt;font-family:Tahoma,"sans-serif""> Morten Brørup [mailto:<a href="mailto:mb@smartsharesystems.com" target="_blank">mb@smartsharesystems.com</a>] <br><b>Sent:</b> Wednesday, 17 May 2023 10.38<br><br></span><u></u><u></u></p><div style="border-top:none;border-right:none;border-bottom:none;border-left:1.5pt solid blue;padding:0cm 0cm 0cm 4pt"><p class="MsoNormal"><b><span style="font-size:10pt;font-family:Tahoma,"sans-serif"">From:</span></b><span style="font-size:10pt;font-family:Tahoma,"sans-serif""> Yasin CANER [mailto:<a href="mailto:yasinncaner@gmail.com" target="_blank">yasinncaner@gmail.com</a>] <br><b>Sent:</b> Wednesday, 17 May 2023 10.01<br><br></span><u></u><u></u></p><div><p class="MsoNormal">Hello,<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I don't have full knowledge of how to work rte_mempool_ops_get_count() but there is another comment about it. Maybe it relates. <u></u><u></u></p></div><div><p class="MsoNormal">/*<br> * due to race condition (access to len is not locked), the<br> * total can be greater than size... so fix the result<br> */<u></u><u></u></p></div><div><p class="MsoNormal"><span style="color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,"sans-serif";color:rgb(31,73,125)">MB: This comment relates to the race when accessing the per-lcore cache counters.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,"sans-serif";color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,"sans-serif";color:rgb(31,73,125)">MB (continued): I have added more information, regarding mempool drivers, in Bugzilla: <a href="https://bugs.dpdk.org/show_bug.cgi?id=1229" target="_blank">https://bugs.dpdk.org/show_bug.cgi?id=1229</a><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,"sans-serif";color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,"sans-serif";color:rgb(31,73,125)"><u></u> <u></u></span></p></div><div><p class="MsoNormal">Best regards.<u></u><u></u></p></div></div><p class="MsoNormal"><u></u> <u></u></p><div><div><p class="MsoNormal">Morten Brørup <<a href="mailto:mb@smartsharesystems.com" target="_blank">mb@smartsharesystems.com</a>>, 16 May 2023 Sal, 19:04 tarihinde şunu yazdı:<u></u><u></u></p></div><blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt"><p class="MsoNormal">> From: Stephen Hemminger [mailto:<a href="mailto:stephen@networkplumber.org" target="_blank">stephen@networkplumber.org</a>]<br>> Sent: Tuesday, 16 May 2023 17.24<br>> <br>> On Tue, 16 May 2023 13:41:46 +0000<br>> Yasin CANER <<a href="mailto:yasinncaner@gmail.com" target="_blank">yasinncaner@gmail.com</a>> wrote:<br>> <br>> > From: Yasin CANER <<a href="mailto:yasin.caner@ulakhaberlesme.com.tr" target="_blank">yasin.caner@ulakhaberlesme.com.tr</a>><br>> ><br>> > after a while working rte_mempool_avail_count function returns bigger<br>> > than mempool size that cause miscalculation rte_mempool_in_use_count.<br>> ><br>> > it helps to avoid miscalculation rte_mempool_in_use_count.<br>> ><br>> > Bugzilla ID: 1229<br>> ><br>> > Signed-off-by: Yasin CANER <<a href="mailto:yasin.caner@ulakhaberlesme.com.tr" target="_blank">yasin.caner@ulakhaberlesme.com.tr</a>><br>> <br>> An alternative that avoids some code duplication.<br>> <br>> diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c<br>> index cf5dea2304a7..2406b112e7b0 100644<br>> --- a/lib/mempool/rte_mempool.c<br>> +++ b/lib/mempool/rte_mempool.c<br>> @@ -1010,7 +1010,7 @@ rte_mempool_avail_count(const struct rte_mempool<br>> *mp)<br>>         count = rte_mempool_ops_get_count(mp);<br>> <br>>         if (mp->cache_size == 0)<br>> -               return count;<br>> +               goto exit;<br><br>This bug can only occur here (i.e. with cache_size==0) if rte_mempool_ops_get_count() returns an incorrect value. The bug should be fixed there instead.<span style="color:rgb(31,73,125)"><u></u><u></u></span></p><p class="MsoNormal" style="margin-bottom:5pt"><span style="font-size:11pt;font-family:Calibri,"sans-serif";color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal" style="margin-bottom:5pt"><span style="font-size:11pt;font-family:Calibri,"sans-serif";color:rgb(31,73,125)">MB (continued): The bug must be in the underlying mempool driver. I took a look at the ring and stack drivers, and they seem fine.<u></u><u></u></span></p><p class="MsoNormal"><br><br>> <br>>         for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++)<br>>                 count += mp->local_cache[lcore_id].len;<br>> @@ -1019,6 +1019,7 @@ rte_mempool_avail_count(const struct rte_mempool<br>> *mp)<br>>          * due to race condition (access to len is not locked), the<br>>          * total can be greater than size... so fix the result<br>>          */<br>> +exit:<br>>         if (count > mp->size)<br>>                 return mp->size;<br>>         return count;<u></u><u></u></p></blockquote></div></div></div></div></div></div></blockquote></div>