DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: bluca@debian.org, Ali Alnubani <alialnu@nvidia.com>,
	dev@dpdk.org, Asaf Penso <asafp@nvidia.com>,
	ferruh.yigit@intel.com, jerinj@marvell.com, akhil.goyal@nxp.com,
	andrew.rybchenko@oktetlabs.ru, ajit.khaparde@broadcom.com,
	konstantin.ananyev@intel.com, viacheslavo@nvidia.com
Subject: Re: [dpdk-dev] performance degradation with fpic
Date: Tue, 3 Nov 2020 11:23:21 +0000	[thread overview]
Message-ID: <20201103112321.GA1144@bricha3-MOBL.ger.corp.intel.com> (raw)
In-Reply-To: <7983217.MxgJTX9gS5@thomas>

On Tue, Nov 03, 2020 at 11:18:57AM +0100, Thomas Monjalon wrote:
> 02/11/2020 16:00, Bruce Richardson:
> > On Mon, Nov 02, 2020 at 10:40:54AM +0000, Ali Alnubani wrote:
> > > Hi Bruce,
> > > 
> > > I was able to pin this down on drivers/net/mlx5/mlx5_rxtx.c. Removing -fPIC from its ninja recipe in build.ninja resolves the issue (had to prevent creating shared libs in this case).
> > > What do you suggest I do? Can we have per-pmd customized compilation flags?
> > > 
> > > Regards,
> > > Ali
> > > 
> > There are multiple possible ways to achieve this, but below are some ideas:
> > 
> > 1. Take the changes for supporting function versioning and duplicate them
> > from lib/meson.build to drivers/meson.build. Since function versioning
> > support already requires everything to be built twice, we could set it to
> > not use -fpic for the static libs in that case. Then mark mlx5 as using
> > function versioning. This is a bit hackish though, so
> > 
> > 2. The "objs" parameter from each sub-directory is not widely used, so we
> > could split this easily enough into objs-shared and objs-static, and allow
> > the subdirectory build file, in this case mlx5/meson.ninja, to build any c
> > files manually to pass them back. This is more flexible, and also means
> > that you can limit the files which are to be built twice to only the single
> > file, rather than marking the whole driver as needing rebuild.
> 
> Can it be done only in the driver?
> No general meson change for this option?
> 

Well, apart from splitting the objs variable into two, I don't see any
other general meson changes being needed in this case. So yes, it makes any
changes specific to the driver.

That said, I have not tried to implement such a change, so the "in
practice" may be different from the "in theory"!

> > I'm sure there are other approaches too. However, I agree with Luca's
> > comment that first approach should probably be to see if you can track down
> > exactly why this one file is having problems. Could any of the slowdown be
> > due to the fact that you use a common lib from your driver? Are there
> > cross-driver calls in the fast-path that are suffering a penalty?
> 
> Of course the performance will be analyzed in the long run.
> However, such analyzis is more convenient if meson is flexible enough
> to allow customization of the build.
> And in general, I think it is good to have meson flexible
> to allow any kind of driver build customization.
> 

I'm partially agreeing and partially disagreeing here. While flexibility is
something that people generally want, based off my experience with DPDK
builds over the last few years, I think that there is an awful lot to be
said for consistency! While we need to support special cases that we can't
work around, there are many advantages to having everything built in the
same way using common flags etc. I would really hate to see the flexibility
translate into drivers all choosing to do their own special build
customization.

/Bruce

      parent reply	other threads:[~2020-11-03 11:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15 16:00 Ali Alnubani
2020-10-15 17:08 ` Bruce Richardson
2020-10-15 17:14   ` Thomas Monjalon
2020-10-15 17:28     ` [dpdk-dev] [EXT] " Jerin Jacob Kollanukkaran
2020-10-16  8:29       ` Bruce Richardson
2020-10-16  8:39         ` Jerin Jacob
2020-10-15 21:44     ` [dpdk-dev] " Stephen Hemminger
2020-10-16  8:35       ` Bruce Richardson
2020-10-16  9:59   ` Bruce Richardson
2020-10-19 11:47     ` Ali Alnubani
2020-10-19 13:01       ` Bruce Richardson
2020-10-22 13:17         ` Ali Alnubani
2020-10-22 13:57           ` Bruce Richardson
2020-10-22 14:16             ` Ali Alnubani
2020-11-02 10:40               ` Ali Alnubani
2020-11-02 11:01                 ` Luca Boccassi
2020-11-02 15:00                 ` Bruce Richardson
2020-11-03 10:18                   ` Thomas Monjalon
2020-11-03 10:45                     ` Luca Boccassi
2020-11-03 11:23                     ` Bruce Richardson [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=20201103112321.GA1144@bricha3-MOBL.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=akhil.goyal@nxp.com \
    --cc=alialnu@nvidia.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=asafp@nvidia.com \
    --cc=bluca@debian.org \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jerinj@marvell.com \
    --cc=konstantin.ananyev@intel.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).