DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
To: Thomas Monjalon <thomas.monjalon@6wind.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v1 1/3] port: add mp/mc ring ports
Date: Wed, 23 Sep 2015 13:07:01 +0000	[thread overview]
Message-ID: <3EB4FA525960D640B5BDFFD6A3D89126478D6D32@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <3616846.ZsjBrqIcvx@xps13>



> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Tuesday, September 22, 2015 5:24 PM
> To: Dumitrescu, Cristian
> Cc: dev@dpdk.org; Stephen Hemminger; Azarewicz, PiotrX T
> Subject: Re: [dpdk-dev] [PATCH v1 1/3] port: add mp/mc ring ports
> 
> 2015-09-22 11:34, Dumitrescu, Cristian:
> >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen
> > > Hemminger
> > > Sent: Tuesday, September 22, 2015 1:36 AM
> > > To: Azarewicz, PiotrX T
> > > Cc: dev@dpdk.org
> > > Subject: Re: [dpdk-dev] [PATCH v1 1/3] port: add mp/mc ring ports
> > >
> > > On Tue, 15 Sep 2015 15:06:33 +0200
> > > Piotr Azarewicz <piotrx.t.azarewicz@intel.com> wrote:
> > >
> > > > +static inline void
> > > > +send_burst_mp(struct rte_port_ring_writer *p)
> > > > +{
> > >
> > > compiler will inline static functions anyway. No need to add inline qualifier
> >
> > Hi Stephen,
> >
> > Using 'static inline' seems to be the standard practice in DPDK and a good
> practice as well.
> 
> Why do you think it is a good practice?
> Forced inlining can be a random optimization having negative effects.
> 

What I meant is this: when users want to make sure their code gets inlined by the compiler, it is better to explicitly state this by using the mechanisms provided by the C compiler (C keyword "inline" and compiler pragmas like "always inline") rather than hope that compiler is going to do this anyway. I have been burned in the past by compilers not inlining code even when explicitly stated, so I am a quite sceptical about compilers doing it proactively.

Your point is slightly different: why use code inlining at all? IMHO this discussion is outside the scope of this patch and should be conducted as a separate debate. Please feel free to start it as a separate thread if you deem necessary. As said, there are already 1700 instances of "static inline" in DPDK, as well as lots of "always inline".

In the context of this debate (outside the scope of this patch), my quick input is:  compilers are typically good to optimize code at the function level rather than cross-functions, so having more code in the same function allows the compiler to do a better job at code optimization. I am not a compiler expert, so my views could simply be biased by my past experience.

> > DPDK> grep 'static inline' `find -name '*.[hc]'` | wc -l
> > 1700

  parent reply	other threads:[~2015-09-23 13:07 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-15 13:06 [dpdk-dev] [PATCH v1 0/3] ip_pipeline: add MP/MC and frag/ras support to SWQs Piotr Azarewicz
2015-09-15 13:06 ` [dpdk-dev] [PATCH v1 1/3] port: add mp/mc ring ports Piotr Azarewicz
2015-09-21 22:34   ` Stephen Hemminger
2015-09-22 11:35     ` Dumitrescu, Cristian
2015-09-21 22:35   ` Stephen Hemminger
2015-09-22 11:34     ` Dumitrescu, Cristian
2015-09-22 14:23       ` Thomas Monjalon
2015-09-22 16:34         ` Stephen Hemminger
2015-09-23 13:07         ` Dumitrescu, Cristian [this message]
2015-09-21 22:37   ` Stephen Hemminger
2015-09-22 11:34     ` Dumitrescu, Cristian
2015-09-15 13:06 ` [dpdk-dev] [PATCH v1 2/3] port: fix ras " Piotr Azarewicz
2015-09-15 13:06 ` [dpdk-dev] [PATCH v1 3/3] examples/ip_pipeline: add mp/mc and frag/ras swq Piotr Azarewicz
2015-09-15 13:49 ` [dpdk-dev] [PATCH v1 0/3] ip_pipeline: add MP/MC and frag/ras support to SWQs Dumitrescu, Cristian
2015-09-24  9:55 ` [dpdk-dev] [PATCH v2 " Piotr Azarewicz
2015-09-24  9:55   ` [dpdk-dev] [PATCH v2 1/3] port: add mp/mc ring ports Piotr Azarewicz
2015-10-19 15:18     ` Thomas Monjalon
2015-09-24  9:55   ` [dpdk-dev] [PATCH v2 2/3] port: fix ras " Piotr Azarewicz
2015-10-19 15:15     ` Thomas Monjalon
2015-09-24  9:55   ` [dpdk-dev] [PATCH v2 3/3] examples/ip_pipeline: add mp/mc and frag/ras swq Piotr Azarewicz
2015-09-24 10:28   ` [dpdk-dev] [PATCH v2 0/3] ip_pipeline: add MP/MC and frag/ras support to SWQs Dumitrescu, Cristian
2015-10-20 14:36   ` [dpdk-dev] [PATCH v3 " Piotr Azarewicz
2015-10-20 14:36     ` [dpdk-dev] [PATCH v3 1/3] port: add mp/mc ring ports Piotr Azarewicz
2015-10-20 14:36     ` [dpdk-dev] [PATCH v3 2/3] port: fix ras " Piotr Azarewicz
2015-10-20 14:36     ` [dpdk-dev] [PATCH v3 3/3] examples/ip_pipeline: add mp/mc and frag/ras swq Piotr Azarewicz
2015-10-28 13:30     ` [dpdk-dev] [PATCH v4 0/3] ip_pipeline: add MP/MC and frag/ras support to SWQs Piotr Azarewicz
2015-10-28 13:30       ` [dpdk-dev] [PATCH v4 1/3] port: add mp/mc ring ports Piotr Azarewicz
2015-10-28 13:30       ` [dpdk-dev] [PATCH v4 2/3] port: fix ras/frag " Piotr Azarewicz
2015-10-28 13:30       ` [dpdk-dev] [PATCH v4 3/3] examples/ip_pipeline: add mp/mc and frag/ras swq Piotr Azarewicz
2015-11-25 22:08       ` [dpdk-dev] [PATCH v4 0/3] ip_pipeline: add MP/MC and frag/ras support to SWQs 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=3EB4FA525960D640B5BDFFD6A3D89126478D6D32@IRSMSX108.ger.corp.intel.com \
    --to=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=thomas.monjalon@6wind.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).