From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Singh, Jasvinder" Subject: Re: [PATCH] mbuf: implement generic format for sched field Date: Wed, 5 Dec 2018 11:15:30 +0000 Message-ID: <54CBAA185211B4429112C315DA58FF6D33668BDA@IRSMSX103.ger.corp.intel.com> References: <20181123165423.134922-1-jasvinder.singh@intel.com> <20181201142237.GB17147@jerin> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , "Dumitrescu, Cristian" , "Pattan, Reshma" , "Rao, Nikhil" To: Jerin Jacob Return-path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id CC9BB1B0FC for ; Wed, 5 Dec 2018 12:15:33 +0100 (CET) In-Reply-To: <20181201142237.GB17147@jerin> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com] > Sent: Saturday, December 1, 2018 2:23 PM > To: Singh, Jasvinder > Cc: dev@dpdk.org; Dumitrescu, Cristian ; > Pattan, Reshma ; Rao, Nikhil > > Subject: Re: [dpdk-dev] [PATCH] mbuf: implement generic format for sched > field >=20 > -----Original Message----- > > Date: Fri, 23 Nov 2018 16:54:23 +0000 > > From: Jasvinder Singh > > To: dev@dpdk.org > > CC: cristian.dumitrescu@intel.com, Reshma Pattan > > > > Subject: [dpdk-dev] [PATCH] mbuf: implement generic format for sched > > field > > X-Mailer: git-send-email 2.17.1 > > > > This patch implements the changes proposed in the deprecation notes > > [1][2]. > > > > The opaque mbuf->hash.sched field is updated to support generic > > definition in line with the ethdev TM and MTR APIs. The new generic > > format contains: queue ID, traffic class, color. > > > > In addtion, following API functions of the sched library have been > > modified with an additional parameter of type struct rte_sched_port to > > accomodate the changes made to mbuf sched field. > > (i) rte_sched_port_pkt_write() > > (ii) rte_sched_port_pkt_read() > > > > The other libraries, sample applications and tests which use mbuf > > sched field have been updated as well. > > > > [1] http://mails.dpdk.org/archives/dev/2018-February/090651.html > > [2] https://mails.dpdk.org/archives/dev/2018-November/119051.html > > > > Signed-off-by: Jasvinder Singh > > Signed-off-by: Reshma Pattan > > --- > > @@ -575,12 +575,10 @@ struct rte_mbuf { > > */ > > } fdir; /**< Filter identifier if FDIR enabled = */ > > struct { > > - uint32_t lo; > > - uint32_t hi; > > - /**< The event eth Tx adapter uses this= field > > - * to store Tx queue id. > > - * @see rte_event_eth_tx_adapter_txq_se= t() > > - */ > > + uint32_t queue_id; /**< Queue ID. */ > > + uint8_t traffic_class; /**< Traffic c= lass ID. */ > > + uint8_t color; /**< Color. */ > > + uint16_t reserved; /**< Reserved. */ > > } sched; /**< Hierarchical scheduler *= / >=20 > +Nikhil. >=20 > Currently rte_event_eth_tx_adapter_txq_set() and > rte_event_eth_tx_adapter_txq_get() implemented using > hash.sched.queue_id. How about moving out from "sched" to "txadapter"? > Something like below, >=20 > $ git diff > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h inde= x > 3dbc6695e..b73bbef93 100644 > --- a/lib/librte_mbuf/rte_mbuf.h > +++ b/lib/librte_mbuf/rte_mbuf.h > @@ -575,13 +575,20 @@ struct rte_mbuf { > */ > } fdir; /**< Filter identifier if FDIR enabled */ > struct { > - uint32_t lo; > - uint32_t hi; > + uint32_t queue_id; /**< Queue ID. */ > + uint8_t traffic_class; /**< Traffic cla= ss ID. */ > + uint8_t color; /**< Color. */ > + uint16_t reserved; /**< Reserved. */ > + } sched; /**< Hierarchical scheduler */ > + struct { > + uint32_t reserved1; > + uint16_t reserved2; > + uint16_t txq; > /**< The event eth Tx adapter uses this f= ield > * to store Tx queue id. > * @see rte_event_eth_tx_adapter_txq_set(= ) > */ > - } sched; /**< Hierarchical scheduler */ > + } txadapter; /**< Eventdev ethdev Tx adapter */ > /**< User defined tags. See rte_distributor_proce= ss() */ > uint32_t usr; > } hash; /**< hash information */ >=20 >=20 > > rte_event_eth_tx_adapter_txq_set(struct rte_mbuf *pkt, uint16_t > > queue) { > > - uint16_t *p =3D (uint16_t *)&pkt->hash.sched.hi; > > + uint16_t *p =3D (uint16_t *)&pkt->hash.sched.queue_id; > > p[1] =3D queue; > > } > > > > @@ -320,7 +320,7 @@ rte_event_eth_tx_adapter_txq_set(struct rte_mbuf > > *pkt, uint16_t queue) static __rte_always_inline uint16_t > > __rte_experimental rte_event_eth_tx_adapter_txq_get(struct rte_mbuf > > *pkt) { > > - uint16_t *p =3D (uint16_t *)&pkt->hash.sched.hi; > > + uint16_t *p =3D (uint16_t *)&pkt->hash.sched.queue_id; > > return p[1]; > > } > > Will make this change in the next version. Thanks.