From: Stephen Hemminger <stephen@networkplumber.org>
To: "Gavin Hu (Arm Technology China)" <Gavin.Hu@arm.com>
Cc: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>,
"Van Haaren, Harry" <harry.van.haaren@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>,
"Pattan, Reshma" <reshma.pattan@intel.com>,
"thomas@monjalon.net" <thomas@monjalon.net>,
"olivier.matz@6wind.com" <olivier.matz@6wind.com>,
Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
Subject: Re: [dpdk-dev] [PATCH v2] mbuf: fix compile by removing struct from function
Date: Thu, 10 Jan 2019 22:03:16 -0800 [thread overview]
Message-ID: <20190110220316.3937ad07@hermes.lan> (raw)
In-Reply-To: <VI1PR08MB3167B7EAFB35409EDCF9DADC8F850@VI1PR08MB3167.eurprd08.prod.outlook.com>
On Fri, 11 Jan 2019 03:01:43 +0000
"Gavin Hu (Arm Technology China)" <Gavin.Hu@arm.com> wrote:
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of Dumitrescu, Cristian
> > Sent: Friday, January 11, 2019 2:40 AM
> > To: Van Haaren, Harry <harry.van.haaren@intel.com>; dev@dpdk.org
> > Cc: Pattan, Reshma <reshma.pattan@intel.com>; thomas@monjalon.net;
> > olivier.matz@6wind.com
> > Subject: Re: [dpdk-dev] [PATCH v2] mbuf: fix compile by removing struct
> > from function
> >
> >
> >
> > > -----Original Message-----
> > > From: Van Haaren, Harry
> > > Sent: Thursday, January 10, 2019 6:07 PM
> > > To: dev@dpdk.org
> > > Cc: Van Haaren, Harry <harry.van.haaren@intel.com>; Pattan, Reshma
> > > <reshma.pattan@intel.com>; Dumitrescu, Cristian
> > > <cristian.dumitrescu@intel.com>; thomas@monjalon.net;
> > > olivier.matz@6wind.com
> > > Subject: [PATCH v2] mbuf: fix compile by removing struct from function
> > >
> > > Although C compilation works with the struct rte_mbuf_sched
> > > declared inside the struct rte_mbuf namespace, C++ fails to
> > > compile.
> > >
> > > This fix removes the temporary struct rte_mbuf_sched, instead
> > > reading from the mbuf directly for each struct member. As the
> > > struct is now not used directly, the C++ compiler doesn't need
> > > to know about the struct, resolving the issue.
> > >
> > > Fixes: 5d3f72100904 ("mbuf: implement generic format for sched field")
> > >
> > > Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
> > >
> > > ---
> > >
> > > Cc: reshma.pattan@intel.com
> > > Cc: cristian.dumitrescu@intel.com
> > > Cc: thomas@monjalon.net
> > > Cc: olivier.matz@6wind.com
> > >
> > > See mailing list for v1 discussion, perhaps this solution is more
> > > readable due to leaving sched struct in-line in the mbuf struct.
> > > ---
> > > lib/librte_mbuf/rte_mbuf.h | 16 ++++++----------
> > > 1 file changed, 6 insertions(+), 10 deletions(-)
> > >
> > > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> > > index bc562dc8a..1b260efd5 100644
> > > --- a/lib/librte_mbuf/rte_mbuf.h
> > > +++ b/lib/librte_mbuf/rte_mbuf.h
> > > @@ -2344,11 +2344,9 @@ rte_mbuf_sched_get(const struct rte_mbuf
> > *m,
> > > uint32_t *queue_id,
> > > uint8_t *traffic_class,
> > > uint8_t *color)
> > > {
> > > -struct rte_mbuf_sched sched = m->hash.sched;
>
> Did C++ complain *sched? *sched is better with less stack mem footprint.
> If the pointer works, the code looks better.
Using *sched will cause compiler to generate multiple references which
is the real performance issue here.
next prev parent reply other threads:[~2019-01-11 6:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-10 16:50 [dpdk-dev] [PATCH] mbuf: fix compile by making sched struct visible Harry van Haaren
2019-01-10 17:34 ` Thomas Monjalon
2019-01-10 17:57 ` Van Haaren, Harry
2019-01-10 18:06 ` [dpdk-dev] [PATCH v2] mbuf: fix compile by removing struct from function Harry van Haaren
2019-01-10 18:40 ` Dumitrescu, Cristian
2019-01-11 3:01 ` Gavin Hu (Arm Technology China)
2019-01-11 6:03 ` Stephen Hemminger [this message]
2019-01-11 8:44 ` Olivier Matz
2019-01-11 11:20 ` Van Haaren, Harry
2019-01-11 11:32 ` [dpdk-dev] [PATCH v3] mbuf: fix compile by making sched struct visible Harry van Haaren
2019-01-11 14:33 ` Dumitrescu, Cristian
2019-01-14 14:58 ` Olivier Matz
2019-01-14 15:28 ` Thomas Monjalon
2019-01-10 22:05 ` [dpdk-dev] [PATCH] " Stephen Hemminger
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=20190110220316.3937ad07@hermes.lan \
--to=stephen@networkplumber.org \
--cc=Gavin.Hu@arm.com \
--cc=Honnappa.Nagarahalli@arm.com \
--cc=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
--cc=harry.van.haaren@intel.com \
--cc=olivier.matz@6wind.com \
--cc=reshma.pattan@intel.com \
--cc=thomas@monjalon.net \
/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).