<div dir="ltr">Hello all,<div><br></div><div> I fixed both bugs on my work computer. but it is hard to push a patch because dpdk git has so many steps.</div><div><br></div><div><a href="https://bugs.dpdk.org/show_bug.cgi?id=1227">https://bugs.dpdk.org/show_bug.cgi?id=1227</a><br></div><div><a href="https://bugs.dpdk.org/show_bug.cgi?id=1229">https://bugs.dpdk.org/show_bug.cgi?id=1229</a><br></div><div><br></div><div>Best regards.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Yasin CANER <<a href="mailto:yasinncaner@gmail.com">yasinncaner@gmail.com</a>>, 9 May 2023 Sal, 14:13 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 dir="ltr"><div dir="ltr">Hello,<div><br></div><div>I draw a flow via asciiflow to explain myself better. Problem is after transmitting packets(mbufs) , it never puts in the kni->free_q to back to the original pool. Each cycle, it allocates another 32 units that cause leaks. Or I am missing something.</div><div><br></div><div>I already tried the rte_eth_tx_done_cleanup() function but it didn't fix anything.</div><div><br></div><div>I am working on a patch to fix this issue but I am not sure if there is another way.</div><div><br></div><div>Best regards.</div><div><br></div><div><a href="https://pastebin.ubuntu.com/p/s4h5psqtgZ/" target="_blank">https://pastebin.ubuntu.com/p/s4h5psqtgZ/</a><br></div><div><br></div><div><br></div><div>unsigned<br>rte_kni_rx_burst(struct rte_kni *kni, struct rte_mbuf **mbufs, unsigned int num)<br>{<br>   unsigned int ret = kni_fifo_get(kni->tx_q, (void **)mbufs, num);<br><br> /* If buffers removed, allocate mbufs and then put them into alloc_q */</div><div>/* Question, how to test buffers is removed or not?*/<br>   if (ret)<br>    kni_allocate_mbufs(kni);<br><br>    return ret;<br>}<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Stephen Hemminger <<a href="mailto:stephen@networkplumber.org" target="_blank">stephen@networkplumber.org</a>>, 8 May 2023 Pzt, 19:18 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">On Mon, 8 May 2023 09:01:41 +0300<br>
Yasin CANER <<a href="mailto:yasinncaner@gmail.com" target="_blank">yasinncaner@gmail.com</a>> wrote:<br>
<br>
> Hello Stephen,<br>
> <br>
> Thank you for response, it helps me a lot. I understand problem better.<br>
> <br>
> After reading mbuf library (<br>
> <a href="https://doc.dpdk.org/guides/prog_guide/mempool_lib.html" rel="noreferrer" target="_blank">https://doc.dpdk.org/guides/prog_guide/mempool_lib.html</a>)  i realized that<br>
> 31 units allocation memory slot doesn't return to pool!<br>
<br>
If receive burst returns 1 mbuf, the other 31 pointers in the array<br>
are not valid. They do not point to mbufs.<br>
<br>
> 1 unit mbuf can be freed via rte_pktmbuf_free so it can back to pool.<br>
> <br>
> Main problem is that allocation doesn't return to original pool, act as<br>
> used. So, after following rte_pktmbuf_free<br>
> <<a href="http://doc.dpdk.org/api/rte__mbuf_8h.html#a1215458932900b7cd5192326fa4a6902" rel="noreferrer" target="_blank">http://doc.dpdk.org/api/rte__mbuf_8h.html#a1215458932900b7cd5192326fa4a6902</a>><br>
> function,<br>
> i realized that there is 2 function to helps to mbufs back to pool.<br>
> <br>
> These are rte_mbuf_raw_free<br>
> <<a href="http://doc.dpdk.org/api/rte__mbuf_8h.html#a9f188d53834978aca01ea101576d7432" rel="noreferrer" target="_blank">http://doc.dpdk.org/api/rte__mbuf_8h.html#a9f188d53834978aca01ea101576d7432</a>><br>
>  and rte_pktmbuf_free_seg<br>
> <<a href="http://doc.dpdk.org/api/rte__mbuf_8h.html#a006ee80357a78fbb9ada2b0432f82f37" rel="noreferrer" target="_blank">http://doc.dpdk.org/api/rte__mbuf_8h.html#a006ee80357a78fbb9ada2b0432f82f37</a>>.<br>
> I will focus on them.<br>
> <br>
> If there is another suggestion, I will be very pleased.<br>
> <br>
> Best regards.<br>
> <br>
> Yasin CANER<br>
> Ulak<br>
<br>
</blockquote></div></div>
</blockquote></div>