From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH] mbuf: implement generic format for sched field Date: Sat, 1 Dec 2018 14:22:48 +0000 Message-ID: <20181201142237.GB17147@jerin> References: <20181123165423.134922-1-jasvinder.singh@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , "cristian.dumitrescu@intel.com" , Reshma Pattan , "nikhil.rao@intel.com" To: Jasvinder Singh Return-path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-eopbgr800049.outbound.protection.outlook.com [40.107.80.49]) by dpdk.org (Postfix) with ESMTP id B3DE61B4D7 for ; Sat, 1 Dec 2018 15:22:51 +0100 (CET) In-Reply-To: <20181123165423.134922-1-jasvinder.singh@intel.com> Content-Language: en-US Content-ID: <0B92333B8C5173498346A89E486E28BF@namprd07.prod.outlook.com> 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----- > 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 fiel= d > X-Mailer: git-send-email 2.17.1 >=20 > This patch implements the changes proposed in the deprecation > notes [1][2]. >=20 > 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. >=20 > 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() >=20 > The other libraries, sample applications and tests which use mbuf > sched field have been updated as well. >=20 > [1] http://mails.dpdk.org/archives/dev/2018-February/090651.html > [2] https://mails.dpdk.org/archives/dev/2018-November/119051.html >=20 > 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 f= ield > - * to store Tx queue id. > - * @see rte_event_eth_tx_adapter_txq_set(= ) > - */ > + 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 */ +Nikhil. 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, $ git diff diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 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 class= 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 fie= ld * 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_process= () */ uint32_t usr; } hash; /**< hash information */ > 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; > } >=20 > @@ -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]; > } >=20