From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id D1C1B1B1AC for ; Mon, 25 Sep 2017 05:22:59 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP; 24 Sep 2017 20:22:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,434,1500966000"; d="scan'208";a="1198583551" Received: from unknown (HELO dpdk5.bj.intel.com) ([172.16.182.182]) by fmsmga001.fm.intel.com with ESMTP; 24 Sep 2017 20:22:58 -0700 From: Zhiyong Yang To: dev@dpdk.org Cc: ferruh.yigit@intel.com, thomas@monjalon.net, adrien.mazarguil@6wind.com, Zhiyong Yang Date: Mon, 25 Sep 2017 11:22:31 +0800 Message-Id: <20170925032231.72897-6-zhiyong.yang@intel.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170925032231.72897-1-zhiyong.yang@intel.com> References: <20170921083243.57991-1-zhiyong.yang@intel.com> <20170925032231.72897-1-zhiyong.yang@intel.com> Subject: [dpdk-dev] [PATCH v5 5/5] 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: Mon, 25 Sep 2017 03:23:00 -0000 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. Signed-off-by: Zhiyong Yang --- lib/librte_mbuf/rte_mbuf.c | 2 +- lib/librte_mbuf/rte_mbuf.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c index 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 = mp; m->nb_segs = 1; - m->port = 0xff; + m->port = MBUF_INVALID_PORT; rte_mbuf_refcnt_set(m, 1); m->next = NULL; } diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index eaed7eee0..cc380400d 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 UINT16_MAX + static inline void rte_pktmbuf_reset(struct rte_mbuf *m) { m->next = NULL; @@ -1095,7 +1097,7 @@ static inline void rte_pktmbuf_reset(struct rte_mbuf *m) m->vlan_tci = 0; m->vlan_tci_outer = 0; m->nb_segs = 1; - m->port = 0xff; + m->port = MBUF_INVALID_PORT; m->ol_flags = 0; m->packet_type = 0; -- 2.13.3