<div dir="ltr"><div>Thanks for your response, got it.</div><div><br></div>BR<div>Narsimha</div><div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Dec 10, 2025 at 3:14 PM Morten Brørup <<a href="mailto:mb@smartsharesystems.com">mb@smartsharesystems.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> From: narsimharaj pentam [mailto:<a href="mailto:pnarsimharaj@gmail.com" target="_blank">pnarsimharaj@gmail.com</a>] <br>
> Sent: Tuesday, 9 December 2025 18.05<br>
> <br>
> Added dev group.<br>
> <br>
> On Tue, Dec 9, 2025 at 10:11 PM narsimharaj pentam <<a href="mailto:pnarsimharaj@gmail.com" target="_blank">pnarsimharaj@gmail.com</a>> wrote:<br>
> Hi <br>
> <br>
> I have a query related to ip fragmentation handling in DPDK.<br>
> <br>
> The DPDK application is trying to send a larger packet than the configured MTU on the interface, before sending the packet to the i40e PMD the packet will<br>
> undergo fragmentation . The DPDK library function "rte_ipv4_fragment_packet" is used for fragmentation. Function rte_ipv4_fragment_packet will create<br>
> direct and indirect mbuf's for a fragment , the indirect buffers will have reference to the mbuf of the actual packet (zero copy).<br>
> <br>
> The application will call function rte_eth_tx_burst to transmit fragments , which internally invokes i40e_xmit_pkts , the question here is when should main application<br>
> mbuf should be freed , can It be freed immediately after i40e_xmit_pkts returns success, not sure because the mbuf's are queued up in software ring before actual transmit, <br>
> I am worried about the fragments holding references to the main application buffer.<br>
<br>
The original packet can be freed immediately when then fragments have been created.<br>
<br>
This is what the fragmentation example does:<br>
<a href="https://elixir.bootlin.com/dpdk/v25.11/source/examples/ip_fragmentation/main.c#L289" rel="noreferrer" target="_blank">https://elixir.bootlin.com/dpdk/v25.11/source/examples/ip_fragmentation/main.c#L289</a><br>
<br>
This is what happens:<br>
The original packet has a reference counter (which was incremented for each of the indirect mbufs referring to it), so freeing it at that point doesn't put it back in the pool.<br>
When the last of the indirect mbufs is freed (by the driver called by rte_eth_tx_burst()), the original packet's reference counter reaches zero, and then the original mbuf is put back in the pool.<br>
<br>
> <br>
> Thanks.<br>
> <br>
> BR<br>
> Narsimha<br>
<br>
</blockquote></div></div></div>