From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Yang, Zhiyong" Subject: Re: [PATCH] librte_mbuf: modify the port initialization value Date: Tue, 5 Sep 2017 04:28:14 +0000 Message-ID: References: <20170904065532.13055-1-zhiyong.yang@intel.com> <20170904203959.727ea76a@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , "thomas@monjalon.net" , "Yigit, Ferruh" To: Stephen Hemminger Return-path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 807C2293B for ; Tue, 5 Sep 2017 06:28:18 +0200 (CEST) In-Reply-To: <20170904203959.727ea76a@xeon-e3> 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" Hi, Stephen: > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Tuesday, September 5, 2017 11:40 AM > To: Yang, Zhiyong > Cc: dev@dpdk.org; thomas@monjalon.net; Yigit, Ferruh > Subject: Re: [dpdk-dev] [PATCH] librte_mbuf: modify the port initializati= on value >=20 > > @@ -144,7 +144,7 @@ rte_pktmbuf_init(struct rte_mempool *mp, > > /* init some constant fields */ > > m->pool =3D mp; > > m->nb_segs =3D 1; > > - m->port =3D 0xff; > > + m->port =3D 0xffff; > > rte_mbuf_refcnt_set(m, 1); > > m->next =3D NULL; > > } > > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h > > index eaed7eee0..cdc70aa83 100644 > > --- a/lib/librte_mbuf/rte_mbuf.h > > +++ b/lib/librte_mbuf/rte_mbuf.h > > @@ -1095,7 +1095,7 @@ static inline void rte_pktmbuf_reset(struct rte_m= buf > *m) > > m->vlan_tci =3D 0; > > m->vlan_tci_outer =3D 0; > > m->nb_segs =3D 1; > > - m->port =3D 0xff; > > + m->port =3D 0xffff; > > > > m->ol_flags =3D 0; > > m->packet_type =3D 0; >=20 > Maybe introduce MBUF_INVALID_PORT as a constant? >=20 > #define MBUF_INVALID_PORT 0xffff Make sense. Thanks for your suggestion. Thanks Zhiyong