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.