mbuf fast free optimization idea

Asaf Penso asafp at nvidia.com
Sat Aug 26 19:49:08 CEST 2023


+ @Slava Ovsiienko<mailto:viacheslavo at nvidia.com>

Regards,
Asaf Penso
________________________________
From: Morten Brørup <mb at smartsharesystems.com>
Sent: Saturday, August 26, 2023 1:04:18 PM
To: olivier.matz at 6wind.com <olivier.matz at 6wind.com>; NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas at monjalon.net>; Shahaf Shuler <shahafs at nvidia.com>
Cc: dev at dpdk.org <dev at dpdk.org>
Subject: mbuf fast free optimization idea

When RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE is used, the usage pattern of some of the mbuf fields differs:

- The "pool" pointer becomes rarely used. (Only one packet per burst.)
- The "next" pointer becomes unused.
- The "tx_offload" field is still used. (Set by application, read by driver.)

This means that the 2nd cache line in the mbuf now only contains one hot field, "tx_offload".

So, if we swap the "tx_offload" field (in the 2nd cache line) with the "pool" field (in the 1st cache line), the 2nd cache line becomes rarely used.

This should provide a performance improvement for applications (using RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE) when under cache pressure.

PS: Back in the days, the mbuf description said that the 1st cache line was for RX purposes, and the 2nd cache line was for TX purposes. This is not true anymore, so let's not limit out thinking by that (obsolete) design.


Med venlig hilsen / Kind regards,
-Morten Brørup

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/dev/attachments/20230826/48c37c47/attachment.htm>


More information about the dev mailing list