From: "Van Haaren, Harry" <harry.van.haaren@intel.com>
To: Olivier Matz <olivier.matz@6wind.com>,
"Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>,
Stephen Hemminger <stephen@networkplumber.org>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"Pattan, Reshma" <reshma.pattan@intel.com>,
"thomas@monjalon.net" <thomas@monjalon.net>
Subject: Re: [dpdk-dev] [PATCH v2] mbuf: fix compile by removing struct from function
Date: Fri, 11 Jan 2019 11:20:30 +0000 [thread overview]
Message-ID: <E923DB57A917B54B9182A2E928D00FA6757BE3BF@IRSMSX102.ger.corp.intel.com> (raw)
In-Reply-To: <20190111084441.qi7ufsuqbyhb5bqo@platinum>
Converging discussion, +Stephen Hemminger wrote:
> I believe this was done so that the compiler doesn't generate
> bad code.
>
> If you reference the mbuf to get the fields then each operation becomes
> a load shift and mask operation to get to the bitfield. But if they
> are local then this is all done on a single register value.
>
> Check the generated code.
I did :) I see no difference in generated assembly here, system has
GCC 7.3.0 with Meson release build and -g for debug symbols.
Anyway, as per below the consensus seems to be to just lift the struct
as per V1 with a note that the sched field is 8 bytes. I'll send v3 with
the comment updated so we can close this ASAP.
> -----Original Message-----
> From: Olivier Matz [mailto:olivier.matz@6wind.com]
> Sent: Friday, January 11, 2019 8:45 AM
> To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> Cc: Van Haaren, Harry <harry.van.haaren@intel.com>; dev@dpdk.org; Pattan,
> Reshma <reshma.pattan@intel.com>; thomas@monjalon.net
> Subject: Re: [PATCH v2] mbuf: fix compile by removing struct from function
<snip>
> > > /**
> > > @@ -2395,11 +2393,9 @@ rte_mbuf_sched_set(struct rte_mbuf *m,
> > > uint32_t queue_id,
> > > uint8_t traffic_class,
> > > uint8_t color)
> > > {
> > > - m->hash.sched = (struct rte_mbuf_sched){
> > > - .queue_id = queue_id,
> > > - .traffic_class = traffic_class,
> > > - .color = color,
> > > - };
> > > + m->hash.sched.queue_id = queue_id;
> > > + m->hash.sched.traffic_class = traffic_class;
> > > + m->hash.sched.color = color;
> > > }
> > >
> > > #ifdef __cplusplus
> > > --
> > > 2.17.1
> >
> > NAK.
> >
> > I am fine with V1, but against this V2 due to the reasons previously
> discussed and agreed by Olivier [1] regarding performance. We should not
> sacrifice performance for the sake of cosmetics criteria that can met some
> other way.
> >
> > In order to meet readability requirements from Olivier, I suggest we go
> back to V1 and we explicitly mention the size of the mbuf->sched field
> inslide the mbuf as 8 bytes:
> >
> > struct rte_mbuf {
> > ...
> > struct rte_mbuf_sched sched; /**< Hierarchical scheduler: 8 bytes */
> > ...
> > }
> >
> > Olivier, is this a good compromise?
>
> Looks good to me, yes.
>
>
> Thanks
See above, I'll send v3 with updated comment.
next prev parent reply other threads:[~2019-01-11 11:20 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
2019-01-11 8:44 ` Olivier Matz
2019-01-11 11:20 ` Van Haaren, Harry [this message]
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=E923DB57A917B54B9182A2E928D00FA6757BE3BF@IRSMSX102.ger.corp.intel.com \
--to=harry.van.haaren@intel.com \
--cc=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
--cc=olivier.matz@6wind.com \
--cc=reshma.pattan@intel.com \
--cc=stephen@networkplumber.org \
--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).