<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;
mso-fareast-language:EN-US;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;
mso-fareast-language:EN-US;}
span.E-postaStili17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:144396478;
mso-list-type:hybrid;
mso-list-template-ids:1161593320 17448958 69140505 69140507 69140495 69140505 69140507 69140495 69140505 69140507;}
@list l0:level1
{mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:20.5pt;
text-indent:-18.0pt;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:56.5pt;
text-indent:-18.0pt;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
margin-left:92.5pt;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:128.5pt;
text-indent:-18.0pt;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:164.5pt;
text-indent:-18.0pt;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
margin-left:200.5pt;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:236.5pt;
text-indent:-18.0pt;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:272.5pt;
text-indent:-18.0pt;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
margin-left:308.5pt;
text-indent:-9.0pt;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="TR" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hello all,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I think there is a memory leak for KNI. <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Firstly, try to active trace modüle to follow memory management but could not. İt doesn’t create file and dont have any clue.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Run Command : -c dpdk_core_mask -d librte_net_virtio.so -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 --log-level lib.kni:debug --log-level lib.eal:debug
--log-level lib.ethdev:debug --trace=kni --trace-dir=/tmp/<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Secondly, I used followed functions.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">``code<o:p></o:p></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:Consolas;color:#D4D4D4;mso-ligatures:none;mso-fareast-language:TR"> </span><span style="font-size:10.5pt;font-family:Consolas;color:#9CDCFE;mso-ligatures:none;mso-fareast-language:TR">used_mpool</span><span style="font-size:10.5pt;font-family:Consolas;color:#D4D4D4;mso-ligatures:none;mso-fareast-language:TR"> = </span><span style="font-size:10.5pt;font-family:Consolas;color:#DCDCAA;mso-ligatures:none;mso-fareast-language:TR">rte_mempool_in_use_count</span><span style="font-size:10.5pt;font-family:Consolas;color:#D4D4D4;mso-ligatures:none;mso-fareast-language:TR">(</span><span style="font-size:10.5pt;font-family:Consolas;color:#9CDCFE;mso-ligatures:none;mso-fareast-language:TR">rdpdk_cfg</span><span style="font-size:10.5pt;font-family:Consolas;color:#D4D4D4;mso-ligatures:none;mso-fareast-language:TR">-></span><span style="font-size:10.5pt;font-family:Consolas;color:#9CDCFE;mso-ligatures:none;mso-fareast-language:TR">mbuf_pool</span><span style="font-size:10.5pt;font-family:Consolas;color:#D4D4D4;mso-ligatures:none;mso-fareast-language:TR">);<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:Consolas;color:#D4D4D4;mso-ligatures:none;mso-fareast-language:TR"> </span><span style="font-size:10.5pt;font-family:Consolas;color:#9CDCFE;mso-ligatures:none;mso-fareast-language:TR">count_mpool</span><span style="font-size:10.5pt;font-family:Consolas;color:#D4D4D4;mso-ligatures:none;mso-fareast-language:TR"> = </span><span style="font-size:10.5pt;font-family:Consolas;color:#DCDCAA;mso-ligatures:none;mso-fareast-language:TR">rte_mempool_avail_count</span><span style="font-size:10.5pt;font-family:Consolas;color:#D4D4D4;mso-ligatures:none;mso-fareast-language:TR">(</span><span style="font-size:10.5pt;font-family:Consolas;color:#9CDCFE;mso-ligatures:none;mso-fareast-language:TR">rdpdk_cfg</span><span style="font-size:10.5pt;font-family:Consolas;color:#D4D4D4;mso-ligatures:none;mso-fareast-language:TR">-></span><span style="font-size:10.5pt;font-family:Consolas;color:#9CDCFE;mso-ligatures:none;mso-fareast-language:TR">mbuf_pool</span><span style="font-size:10.5pt;font-family:Consolas;color:#D4D4D4;mso-ligatures:none;mso-fareast-language:TR">);<o:p></o:p></span></p>
<p class="MsoNormal">``<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">After calling function rte_kni_rx_burst, 32 unit is allocated. Then i force to free message_buf (mbuf). It frees 1 unit. 31 units left in memory!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">How to fix or understand this issue.<o:p></o:p></p>
<p class="MsoNormal">Follow logs,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<ol style="margin-top:0cm" start="1" type="1">
<li class="MsoListParagraph" style="margin-left:-15.5pt;mso-list:l0 level1 lfo1">
(59383) 6:55:10 lrtc():3212> [KNI]Picked up 1 packets from port 0 [KNI:F000]
<span style="font-family:Wingdings">à</span> 1 packet is received from Kernel that is allocate 32 unit<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:-15.5pt;mso-list:l0 level1 lfo1">
(59383) 6:55:10 print_mempool_tx():2511> [UseCount_mpool:468][avail_mpool:9931]<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:-15.5pt;mso-list:l0 level1 lfo1">
(59383) 6:55:10 pkni():2536> [KNI] i:0/1<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:-15.5pt;mso-list:l0 level1 lfo1">
(59383) 6:55:10 pkni():2616> [KNI][EGR] P:[IPv6] P:[0] [fe80::f816:3eff:fe93:f5fd]->[ff02::2]
<span style="font-family:Wingdings">à</span> Packet is a broadcast packet IPv6<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:-15.5pt;mso-list:l0 level1 lfo1">
(59383) 6:55:10 pkni():2620> [KNI][EGR][pkt-len:70]<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:-15.5pt;mso-list:l0 level1 lfo1">
(59383) 6:55:10 print_mempool_tx():2511> [UseCount_mpool:467][avail_mpool:9932]
<span style="font-family:Wingdings">à</span> mbuf is freed to understand mem-leak. İt is same happens after calling rte_eth_tx_burst<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:-15.5pt;mso-list:l0 level1 lfo1">
(59383) 6:55:10 lrtc():3212> [KNI]Picked up 1 packets from port 1 [KNI:F000] <span style="font-family:Wingdings">
à</span> 1 packet is received from Kernel that is allocate 32 unit 9932 to 9900 then same process happens and 31 units is not freed.<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:-15.5pt;mso-list:l0 level1 lfo1">
(59383) 6:55:10 print_mempool_tx():2511> [UseCount_mpool:499][avail_mpool:9900]<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:-15.5pt;mso-list:l0 level1 lfo1">
(59383) 6:55:10 pkni():2536> [KNI] i:0/1<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:-15.5pt;mso-list:l0 level1 lfo1">
(59383) 6:55:10 pkni():2616> [KNI][EGR] P:[IPv6] P:[1] [fe80::f816:3eff:fed2:9101]->[ff02::2]<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:-15.5pt;mso-list:l0 level1 lfo1">
(59383) 6:55:10 pkni():2620> [KNI][EGR][pkt-len:70]<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:-15.5pt;mso-list:l0 level1 lfo1">
(59383) 6:55:10 print_mempool_tx():2511> [UseCount_mpool:498][avail_mpool:9901]<o:p></o:p></li></ol>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Kernel : 5.4.0-146-generic #163-Ubuntu SMP Fri Mar 17 18:26:02 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux<o:p></o:p></p>
<p class="MsoNormal">Ubuntu 20.04<o:p></o:p></p>
<p class="MsoNormal">DPDK dpdk-stable-22.11.1<o:p></o:p></p>
<p class="MsoNormal">İgb_uio is used.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Best regards.<o:p></o:p></p>
<p class="MsoNormal"><span style="mso-ligatures:none;mso-fareast-language:TR">___<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-ligatures:none;mso-fareast-language:TR">Yasin CANER<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-ligatures:none;mso-fareast-language:TR">Lider Mühendis<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-ligatures:none;mso-fareast-language:TR">Ulak Haberleşme A.Ş. Ankara<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<!DOCTYPE html>
<p>Bu elektronik posta ve onunla iletilen bütün dosyalar sadece göndericisi tarafından alması amaçlanan yetkili, gerçek ya da tüzel kişinin kullanımı içindir. Eğer söz konusu yetkili alıcı değilseniz, bu elektronik postanın içeriğini açıklamanız, kopyalamanız,
yönlendirmeniz ve kullanmanız kesinlikle yasaktır ve bu elektronik postayı derhal silmeniz gerekmektedir. Şirketimiz bu mesajın içerdiği bilgilerin doğruluğu veya eksiksiz olduğu konusunda herhangi bir garanti vermemektedir. Bu nedenle, bu bilgilerin ne şekilde
olursa olsun içeriğinden, iletilmesinden, alınmasından ve saklanmasından sorumlu değildir. Bu mesajdaki görüşler yalnızca gönderen kişiye aittir ve Şirketimizin görüşlerini yansıtmayabilir. Tarafınız ile paylaşılan kişisel verilerin, 6698 sayılı Kişisel Verilerin
Korunması Kanununa uygun olarak işlenmesi gereğini bilginize sunarız. </p>
<hr style:?border-top:="" 1px="" solid="" black?="">
<p>This e-mail and all files sent with it are intended for authorized natural or legal persons, who should be the only persons to open and read them. If you are not an authorized recipient, you are strictly prohibited from disclosing, copying, forwarding, and
using the contents of this e-mail, and you must immediately delete it. Our company does not guarantee the accuracy or thoroughness of the information contained in this message. It is therefore in no way responsible for the content, sending, retrieval and storage
of this information. The opinions contained in this message are the views of the sender only and do not necessarily reflect the views of the company. We would like to inform you that any personal data shared with you should be processed in accordance with
the Law on Protection of Personal Data numbered 6698. </p>
</body>
</html>