From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id 726BA1BC73 for ; Thu, 20 Dec 2018 13:41:33 +0100 (CET) Received: from rsa59-2-82-233-193-189.fbx.proxad.net ([82.233.193.189] helo=droids-corp.org) by mail.droids-corp.org with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZxfT-0007VD-Jk; Thu, 20 Dec 2018 13:43:13 +0100 Received: by droids-corp.org (sSMTP sendmail emulation); Thu, 20 Dec 2018 13:41:28 +0100 Date: Thu, 20 Dec 2018 13:41:28 +0100 From: Olivier Matz To: "Dumitrescu, Cristian" Cc: "Pattan, Reshma" , "dev@dpdk.org" , "jerin.jacob@caviumnetworks.com" , "Rao, Nikhil" , "thomas@monjalon.net" , "Singh, Jasvinder" Message-ID: <20181220124128.itv6qgakvn4qb35r@platinum> References: <20181219153418.52747-1-reshma.pattan@intel.com> <20181219154237.836-1-reshma.pattan@intel.com> <20181219154237.836-2-reshma.pattan@intel.com> <20181220082914.5hluj6nmn6s4rdrj@platinum> <3EB4FA525960D640B5BDFFD6A3D891268E817B4F@IRSMSX108.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3EB4FA525960D640B5BDFFD6A3D891268E817B4F@IRSMSX108.ger.corp.intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v6 2/2] mbuf: implement generic format for sched field X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Dec 2018 12:41:33 -0000 Hi Cristian, [...] On Thu, Dec 20, 2018 at 11:28:01AM +0000, Dumitrescu, Cristian wrote: > > > + * @param m > > > + * Mbuf to read > > > + * @param queue_id > > > + * Returns the queue id > > > + * @param traffic_class > > > + * Returns the traffic class id > > > + * @param color > > > + * Returns the colour id > > > + */ > > > +static inline void > > > +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; > > > + > > > + *queue_id = sched.queue_id; > > > + *traffic_class = sched.traffic_class; > > > + *color = sched.color; > > > > I don't think there is a need to have an additional local copy. > > > > *queue_id = m->hash.sched.queue_id; > > *traffic_class = m->hash.sched.traffic_class; > > *color = m->hash.sched.color; > > > > With local copy, compiler typically generates a single 8-byte read instruction. Without the local copy, compiler typically generates 3x read instructions. > > The set/get functions are used in some performance critical actions, so this is the reason to make sure we get them right. Ok, that makes sense, thanks for clarification. Regards, Olivier