All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla@dpdk.org
To: dev@dpdk.org
Subject: [Bug 1227] KNI : memory-leaks, each time kni_rx_burst it is allocates new mbufs even if no needs.
Date: Tue, 09 May 2023 14:24:26 +0000	[thread overview]
Message-ID: <bug-1227-3@http.bugs.dpdk.org/> (raw)

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

https://bugs.dpdk.org/show_bug.cgi?id=1227

            Bug ID: 1227
           Summary: KNI : memory-leaks, each time kni_rx_burst it is
                    allocates new mbufs even if no needs.
           Product: DPDK
           Version: 22.11
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: ethdev
          Assignee: dev@dpdk.org
          Reporter: yasinncaner@gmail.com
  Target Milestone: ---

Created attachment 251
  --> https://bugs.dpdk.org/attachment.cgi?id=251&action=edit
flow_kni_rx_burst

Hello

I tried to explain memory-leak via graph 

https://pastebin.ubuntu.com/p/s4h5psqtgZ/


scenario : 

1. kni_alloc allocates 32 units (kni->alloc_q) then completes initialization
2. rte_kni_rx_burst receive 1 packet from kernel. 1 of 31 units is filled by
message, 31 units is empty but it is allocated in kni->alloc_q.
3. rte_kni_rx_burst then allocates another 32 units i dont know why but there
is a comment like this."If buffers removed, allocate mbufs and then put them
into alloc_q" ( How to tests buffers are removed or not? there is not any query
in code)
4. 1 message mbuf is transmited via rte_eth_tx_burst . 
5. 1 message mbuf never back to freed and back to original memory pool. 31+32
units memory act like in use but they are not. never back to original memory
pool
6. this cycle goes on to 2 .

? Why there is newer allocation in rte_kni_rx_burst i dont know.
? I tried to free 1 packet via rte_pktmbuf_free but sometimes corrupt to pool
like below. sometimes 1 packet/unit back to original memory pool
[UseCount_mpool:65][avail_mpool:10334]
[UseCount_mpool:4294967135][avail_mpool:10560]
? In my view, after transmiting message to mbufs should be in to kni->free_q.
? in my view, there is missing query in func kni_allocate_mbufs to test alloc_q
is empty or not.
Best regards.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

             reply	other threads:[~2023-05-09 14:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09 14:24 bugzilla [this message]
2023-05-25  7:16 ` [Bug 1227] KNI : memory-leaks, each time kni_rx_burst it is allocates new mbufs even if no needs bugzilla

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=bug-1227-3@http.bugs.dpdk.org/ \
    --to=bugzilla@dpdk.org \
    --cc=dev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.