From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 3CAB9C30A for ; Tue, 2 Jun 2015 05:16:22 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP; 01 Jun 2015 20:16:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,536,1427785200"; d="scan'208";a="719075720" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga001.fm.intel.com with ESMTP; 01 Jun 2015 20:16:20 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t523GH3E025830; Tue, 2 Jun 2015 11:16:17 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t523GEQK022295; Tue, 2 Jun 2015 11:16:16 +0800 Received: (from hzhan75@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t523GE7F022291; Tue, 2 Jun 2015 11:16:14 +0800 From: Helin Zhang To: dev@dpdk.org Date: Tue, 2 Jun 2015 11:16:03 +0800 Message-Id: <1433214967-22247-3-git-send-email-helin.zhang@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1433214967-22247-1-git-send-email-helin.zhang@intel.com> References: <1432629400-25303-1-git-send-email-helin.zhang@intel.com> <1433214967-22247-1-git-send-email-helin.zhang@intel.com> Subject: [dpdk-dev] [PATCH v2 2/6] mbuf: use the reserved 16 bits for double vlan X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2015 03:16:22 -0000 Use the reserved 16 bits in rte_mbuf structure for the outer vlan, also add QinQ offloading flags for both RX and TX sides. Signed-off-by: Helin Zhang --- lib/librte_mbuf/rte_mbuf.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) v2 changes: * Fixed a typo. diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index ab6de67..84fe181 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -101,11 +101,17 @@ extern "C" { #define PKT_RX_TUNNEL_IPV6_HDR (1ULL << 12) /**< RX tunnel packet with IPv6 header. */ #define PKT_RX_FDIR_ID (1ULL << 13) /**< FD id reported if FDIR match. */ #define PKT_RX_FDIR_FLX (1ULL << 14) /**< Flexible bytes reported if FDIR match. */ +#define PKT_RX_QINQ_PKT (1ULL << 15) /**< RX packet with double VLAN stripped. */ /* add new RX flags here */ /* add new TX flags here */ /** + * Second VLAN insertion (QinQ) flag. + */ +#define PKT_TX_QINQ_PKT (1ULL << 49) /**< TX packet with double VLAN inserted. */ + +/** * TCP segmentation offload. To enable this offload feature for a * packet to be transmitted on hardware supporting TSO: * - set the PKT_TX_TCP_SEG flag in mbuf->ol_flags (this flag implies @@ -279,7 +285,7 @@ struct rte_mbuf { uint16_t data_len; /**< Amount of data in segment buffer. */ uint32_t pkt_len; /**< Total pkt len: sum of all segments. */ uint16_t vlan_tci; /**< VLAN Tag Control Identifier (CPU order) */ - uint16_t reserved; + uint16_t vlan_tci_outer; /**< Outer VLAN Tag Control Identifier (CPU order) */ union { uint32_t rss; /**< RSS hash result if RSS enabled */ struct { @@ -777,6 +783,7 @@ static inline void rte_pktmbuf_reset(struct rte_mbuf *m) m->pkt_len = 0; m->tx_offload = 0; m->vlan_tci = 0; + m->vlan_tci_outer = 0; m->nb_segs = 1; m->port = 0xff; @@ -849,6 +856,7 @@ static inline void rte_pktmbuf_attach(struct rte_mbuf *mi, struct rte_mbuf *m) mi->data_len = m->data_len; mi->port = m->port; mi->vlan_tci = m->vlan_tci; + mi->vlan_tci_outer = m->vlan_tci_outer; mi->tx_offload = m->tx_offload; mi->hash = m->hash; -- 1.9.3