From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id BDE472C2F for ; Tue, 5 Sep 2017 07:20:38 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2017 22:20:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,478,1498546800"; d="scan'208";a="1010975333" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga003.jf.intel.com with ESMTP; 04 Sep 2017 22:20:37 -0700 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 4 Sep 2017 22:20:37 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 4 Sep 2017 22:20:37 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.219]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.168]) with mapi id 14.03.0319.002; Tue, 5 Sep 2017 13:20:35 +0800 From: "Zhang, Helin" To: "Yang, Zhiyong" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] librte_mbuf: modify port initialization value Thread-Index: AQHTJgXPutF0lA5SPUCabQ3FgcRIu6Klv9hw Date: Tue, 5 Sep 2017 05:20:35 +0000 Message-ID: References: <20170904065532.13055-1-zhiyong.yang@intel.com> <20170905051319.11223-1-zhiyong.yang@intel.com> In-Reply-To: <20170905051319.11223-1-zhiyong.yang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] librte_mbuf: modify port initialization value 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: Tue, 05 Sep 2017 05:20:39 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhiyong Yang > Sent: Tuesday, September 5, 2017 1:13 PM > To: dev@dpdk.org > Cc: thomas@monjalon.net; Yigit, Ferruh; stephen@networkplumber.org; Yang, > Zhiyong > Subject: [dpdk-dev] [PATCH v2] librte_mbuf: modify port initialization va= lue >=20 > In order to support more than 256 virtual ports, the field "port" > in rte_mbuf has been increased to 16 bits. The initialization/reset value= of the > field "port" should be changed from 0xff to 0xffff accordingly. >=20 > Signed-off-by: Zhiyong Yang > --- >=20 > Changes in V2: > Introduce MBUF_INVALID_PORT as a constant. >=20 > lib/librte_mbuf/rte_mbuf.c | 2 +- > lib/librte_mbuf/rte_mbuf.h | 4 +++- > 2 files changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c inde= x > 26a62b8e1..bcf4e2fcf 100644 > --- a/lib/librte_mbuf/rte_mbuf.c > +++ b/lib/librte_mbuf/rte_mbuf.c > @@ -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 MBUF_INVALID_PORT; > 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 inde= x > eaed7eee0..e32038a73 100644 > --- a/lib/librte_mbuf/rte_mbuf.h > +++ b/lib/librte_mbuf/rte_mbuf.h > @@ -1087,6 +1087,8 @@ static inline void > rte_pktmbuf_reset_headroom(struct rte_mbuf *m) > * @param m > * The packet mbuf to be resetted. > */ > +#define MBUF_INVALID_PORT 0xffff Replaced with below, or use UINT16_MAX directly? #define MBUF_INVALID_PORT UINT16_MAX > + > static inline void rte_pktmbuf_reset(struct rte_mbuf *m) { > m->next =3D NULL; > @@ -1095,7 +1097,7 @@ static inline void rte_pktmbuf_reset(struct rte_mbu= f > *m) > m->vlan_tci =3D 0; > m->vlan_tci_outer =3D 0; > m->nb_segs =3D 1; > - m->port =3D 0xff; > + m->port =3D MBUF_INVALID_PORT; >=20 > m->ol_flags =3D 0; > m->packet_type =3D 0; > -- > 2.13.3