DPDK usage discussions
 help / color / mirror / Atom feed
From: Yasin CANER <yasin.caner@ulakhaberlesme.com.tr>
To: "users@dpdk.org" <users@dpdk.org>
Subject: DPDK 22.11 - How to fix memory leak for KNI - How to debug
Date: Thu, 4 May 2023 07:32:18 +0000	[thread overview]
Message-ID: <AM9P189MB1554CBE7F5BB198946A345EFB96D9@AM9P189MB1554.EURP189.PROD.OUTLOOK.COM> (raw)

[-- Attachment #1: Type: text/plain, Size: 4167 bytes --]

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.

[-- Attachment #2: Type: text/html, Size: 13339 bytes --]

             reply	other threads:[~2023-05-04  8:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-04  7:32 Yasin CANER [this message]
2023-05-04 13:00 ` Yasin CANER
2023-05-04 16:14   ` Stephen Hemminger
2023-05-08  6:01 Yasin CANER
2023-05-08 16:18 ` Stephen Hemminger
2023-05-09 11:13   ` Yasin CANER
2023-05-11 14:14     ` Yasin CANER
2023-05-17 17:53     ` Ferruh Yigit
2023-05-18  8:14       ` Yasin CANER
2023-05-18 14:56         ` Ferruh Yigit
2023-05-19 17:47           ` Yasin CANER
2023-05-19 18:43             ` Ferruh Yigit
2023-05-29  6:33               ` Yasin CANER

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM9P189MB1554CBE7F5BB198946A345EFB96D9@AM9P189MB1554.EURP189.PROD.OUTLOOK.COM \
    --to=yasin.caner@ulakhaberlesme.com.tr \
    --cc=users@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).