From patchwork Sat Feb 4 03:36:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingjing Wu X-Patchwork-Id: 20157 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 67A75F614; Sat, 4 Feb 2017 04:38:22 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 121B0F610 for ; Sat, 4 Feb 2017 04:38:17 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 03 Feb 2017 19:38:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,332,1477983600"; d="scan'208";a="816904978" Received: from dpdk2.sh.intel.com ([10.239.128.246]) by FMSMGA003.fm.intel.com with ESMTP; 03 Feb 2017 19:38:15 -0800 From: Jingjing Wu To: dev@dpdk.org Cc: jingjing.wu@intel.com, olivier.matz@6wind.com Date: Sat, 4 Feb 2017 11:36:11 +0800 Message-Id: <1486179375-133509-2-git-send-email-jingjing.wu@intel.com> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1486179375-133509-1-git-send-email-jingjing.wu@intel.com> References: <1485258650-86193-1-git-send-email-jingjing.wu@intel.com> <1486179375-133509-1-git-send-email-jingjing.wu@intel.com> Subject: [dpdk-dev] [PATCH v2 1/5] mbuf: fix bitmask of Tx offload flags 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Some Tx offload flags are missed in bitmask of all supported packet Tx offload features flags. This patch fixes it by redefining PKT_TX_OFFLOAD_MASK. PKT_RX_OFFLOAD_MASK is also defined in this patch. CC: olivier.matz@6wind.com Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation") Signed-off-by: Jingjing Wu --- lib/librte_mbuf/rte_mbuf.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 0d01167..018a604 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -177,10 +177,11 @@ extern "C" { */ #define PKT_RX_LRO (1ULL << 16) -/* add new RX flags here */ - -/* add new TX flags here */ +/* add new RX flags here, and update __PKT_RX_NEXT */ +#define __PKT_RX_NEXT (1ULL << 17) +/* add new TX flags here, and update __PKT_TX_NEXT */ +#define __PKT_TX_NEXT (1ULL << 43) /** * Offload the MACsec. This flag must be set by the application to enable * this offload feature for a packet to be transmitted. @@ -283,6 +284,12 @@ extern "C" { #define PKT_TX_OUTER_IPV4 (1ULL << 59) /** + * Bitmask of all supported packet Rx offload features flags, + * which can be set for packet. + **/ +#define PKT_RX_OFFLOAD_MASK (__PKT_RX_NEXT - 1) + +/** * Packet outer header is IPv6. This flag must be set when using any * outer offload feature (L4 checksum) to tell the NIC that the outer * header of the tunneled packet is an IPv6 packet. @@ -293,14 +300,7 @@ extern "C" { * Bitmask of all supported packet Tx offload features flags, * which can be set for packet. */ -#define PKT_TX_OFFLOAD_MASK ( \ - PKT_TX_IP_CKSUM | \ - PKT_TX_L4_MASK | \ - PKT_TX_OUTER_IP_CKSUM | \ - PKT_TX_TCP_SEG | \ - PKT_TX_QINQ_PKT | \ - PKT_TX_VLAN_PKT | \ - PKT_TX_TUNNEL_MASK) +#define PKT_TX_OFFLOAD_MASK ((~(__PKT_TX_NEXT - 1)) & 0x1fffffffffffffff) #define __RESERVED (1ULL << 61) /**< reserved for future mbuf use */