DPDK patches and discussions
 help / color / mirror / Atom feed
From: Asaf Penso <asafp@nvidia.com>
To: "Morten Brørup" <mb@smartsharesystems.com>,
	"olivier.matz@6wind.com" <olivier.matz@6wind.com>,
	"NBU-Contact-Thomas Monjalon (EXTERNAL)" <thomas@monjalon.net>,
	"Shahaf Shuler" <shahafs@nvidia.com>,
	"Slava Ovsiienko" <viacheslavo@nvidia.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: mbuf fast free optimization idea
Date: Sat, 26 Aug 2023 17:49:08 +0000	[thread overview]
Message-ID: <SA3PR12MB8811C2FAE64197760A295264CDE2A@SA3PR12MB8811.namprd12.prod.outlook.com> (raw)
In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D87B46@smartserver.smartshare.dk>

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

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

Regards,
Asaf Penso
________________________________
From: Morten Brørup <mb@smartsharesystems.com>
Sent: Saturday, August 26, 2023 1:04:18 PM
To: olivier.matz@6wind.com <olivier.matz@6wind.com>; NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>; Shahaf Shuler <shahafs@nvidia.com>
Cc: dev@dpdk.org <dev@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


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

      reply	other threads:[~2023-08-26 17:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-26 10:04 Morten Brørup
2023-08-26 17:49 ` Asaf Penso [this message]

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=SA3PR12MB8811C2FAE64197760A295264CDE2A@SA3PR12MB8811.namprd12.prod.outlook.com \
    --to=asafp@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=mb@smartsharesystems.com \
    --cc=olivier.matz@6wind.com \
    --cc=shahafs@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@nvidia.com \
    /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).