DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Stephen Hemminger" <stephen@networkplumber.org>,
	"Cristian Dumitrescu" <cristian.dumitrescu@intel.com>
Cc: <dev@dpdk.org>
Subject: RE: [PATCH V2 0/6] pipeline: make the hash function configurable per table
Date: Thu, 1 Sep 2022 10:11:21 +0200	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D872DB@smartserver.smartshare.dk> (raw)
In-Reply-To: <20220831092320.64a3a42a@hermes.local>

> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Wednesday, 31 August 2022 18.23
> Subject: Re: [PATCH V2 0/6] pipeline: make the hash function
> configurable per table
> 
> On Fri, 19 Aug 2022 19:52:19 +0000
> Cristian Dumitrescu <cristian.dumitrescu@intel.com> wrote:
> 
> > Also, since this flexibility has some performance cost, this patch
> set
> > also introduces key comparison functions specialized for each key
> size
> > value. Since the key size is fixed for each table, the key comparison
> > function can be selected at initialization as opposed to using a
> > generic function that can handle any key size. This strategy result
> in
> > a performance improvement for the table lookup operation of around
> 5%.
> 
> I wonder if DPDK should start to adopt the Linux kernel optimizations
> around indirect calls. For most all cases, the function pointer will be
> a certain value and the cpu can do direct rather than indirect call.
> 
> As in:
> 
>      if (likely(hash_func == crc32_hash))
>             crc32_hash(x, y)
>      else
>             (*hash_func)(x, y)
> 
> This was done in Linux kernel because of the overhead of the
> Spectre/Meltdown
> mitigation's, but could apply more generally in DPDK.

+1 to that!

Along the very same lines, I remember reading on LWN about the Linux kernel using some magic to avoid function pointers, or to install optimized functions: At locations in the code where multiple variants of a function could be used, the address of the correct/optimized function is written directly into those locations in the code at startup. I didn't read the article in depth back then, and I can't find it now. Perhaps you know what I'm referring to, Stephen? I wonder if that also might be relevant for DPDK.


  reply	other threads:[~2022-09-01  8:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-18 11:44 [PATCH " Cristian Dumitrescu
2022-08-18 11:44 ` [PATCH 1/6] table: add hash function prototype Cristian Dumitrescu
2022-08-18 11:44 ` [PATCH 2/6] table: add key comparison functions Cristian Dumitrescu
2022-08-18 11:44 ` [PATCH 3/6] table: configure the hash function for regular tables Cristian Dumitrescu
2022-08-18 11:44 ` [PATCH 4/6] pipeline: " Cristian Dumitrescu
2022-08-18 11:44 ` [PATCH 5/6] table: configure the hash function for learner tables Cristian Dumitrescu
2022-08-18 11:44 ` [PATCH 6/6] pipeline: " Cristian Dumitrescu
2022-08-19 19:52 ` [PATCH V2 0/6] pipeline: make the hash function configurable per table Cristian Dumitrescu
2022-08-19 19:52   ` [PATCH V2 1/6] table: add hash function prototype Cristian Dumitrescu
2022-08-19 19:52   ` [PATCH V2 2/6] table: add key comparison functions Cristian Dumitrescu
2022-08-19 19:52   ` [PATCH V2 3/6] table: configure the hash function for regular tables Cristian Dumitrescu
2022-08-19 19:52   ` [PATCH V2 4/6] pipeline: " Cristian Dumitrescu
2022-08-19 19:52   ` [PATCH V2 5/6] table: configure the hash function for learner tables Cristian Dumitrescu
2022-08-19 19:52   ` [PATCH V2 6/6] pipeline: " Cristian Dumitrescu
2022-08-31 16:23   ` [PATCH V2 0/6] pipeline: make the hash function configurable per table Stephen Hemminger
2022-09-01  8:11     ` Morten Brørup [this message]
2022-09-23 15:58   ` Thomas Monjalon

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=98CBD80474FA8B44BF855DF32C47DC35D872DB@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.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 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).