Hello all,

I think there is a memory leak for KNI.

Firstly, try to active trace modüle to follow memory management but could not. 
İt doesn't create file and dont have any clue.

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/


Secondly, I used followed functions.

``code
  used_mpool  = rte_mempool_in_use_count(rdpdk_cfg->mbuf_pool);
  count_mpool = rte_mempool_avail_count(rdpdk_cfg->mbuf_pool);
``

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!


How to fix or understand this issue.
Follow logs,




  1.  (59383)  6:55:10    lrtc():3212> [KNI]Picked up 1 packets from port 0 
[KNI:F000]   --> 1 packet is received from Kernel that is allocate 32 unit
  2.  (59383)  6:55:10   print_mempool_tx():2511> 
[UseCount_mpool:468][avail_mpool:9931]
  3.  (59383)  6:55:10    pkni():2536> [KNI] i:0/1
  4.  (59383)  6:55:10    pkni():2616> [KNI][EGR]  P:[IPv6]  P:[0] 
[fe80::f816:3eff:fe93:f5fd]->[ff02::2] --> Packet is a broadcast packet IPv6
  5.  (59383)  6:55:10    pkni():2620> [KNI][EGR][pkt-len:70]
  6.  (59383)  6:55:10   print_mempool_tx():2511> 
[UseCount_mpool:467][avail_mpool:9932] --> mbuf is freed to understand 
mem-leak. İt is same happens after calling rte_eth_tx_burst
  7.  (59383)  6:55:10    lrtc():3212> [KNI]Picked up 1 packets from port 1 
[KNI:F000] --> 1 packet is received from Kernel that is allocate 32 unit 9932 
to 9900 then same process happens and 31 units is not freed.
  8.  (59383)  6:55:10   print_mempool_tx():2511> 
[UseCount_mpool:499][avail_mpool:9900]
  9.  (59383)  6:55:10    pkni():2536> [KNI] i:0/1
  10. (59383)  6:55:10    pkni():2616> [KNI][EGR]  P:[IPv6]    P:[1] 
[fe80::f816:3eff:fed2:9101]->[ff02::2]
  11. (59383)  6:55:10    pkni():2620> [KNI][EGR][pkt-len:70]
  12. (59383)  6:55:10   print_mempool_tx():2511> 
[UseCount_mpool:498][avail_mpool:9901]


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
Ubuntu 20.04
DPDK dpdk-stable-22.11.1
İgb_uio is used.

Best regards.
___
Yasin CANER
Lider Mühendis
Ulak Haberleşme A.Ş. Ankara


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.

________________________________

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.

Reply via email to