From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 7076B68B9 for ; Fri, 3 Oct 2014 17:30:03 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 03 Oct 2014 08:36:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,647,1406617200"; d="scan'208";a="609294514" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 03 Oct 2014 08:36:54 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id s93FarVv032542; Fri, 3 Oct 2014 16:36:53 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id s93FaqlD023232; Fri, 3 Oct 2014 16:36:52 +0100 Received: (from bricha3@localhost) by sivswdev02.ir.intel.com with id s93FaqPc023228; Fri, 3 Oct 2014 16:36:52 +0100 From: Bruce Richardson To: dev@dpdk.org Date: Fri, 3 Oct 2014 16:36:50 +0100 Message-Id: <1412350612-23190-2-git-send-email-bruce.richardson@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1412350612-23190-1-git-send-email-bruce.richardson@intel.com> References: <1412350612-23190-1-git-send-email-bruce.richardson@intel.com> Subject: [dpdk-dev] [PATCH 1/3] mbuf: move TX flags to group them near end of field 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: Fri, 03 Oct 2014 15:30:03 -0000 This patch takes the existing TX flags defined for the mbuf and shifts each uniquely defined one left so that additional RX flags can be defined without having RX and TX flags mixed together. Under the new scheme, RX flags start at bit 0 and work left, TX flags start at bit 55 and work right, and bits 56-63 are reserved for generic mbuf use, not for offloads. Signed-off-by: Bruce Richardson --- lib/librte_mbuf/rte_mbuf.h | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 1c6e115..7aa507e 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -68,6 +68,12 @@ extern "C" { /* * Packet Offload Features Flags. It also carry packet type information. * Critical resources. Both rx/tx shared these bits. Be cautious on any change + * + * - RX flags start at bit position zero, and get added to the left of previous + * flags. + * - The most-significant 8 bits are reserved for generic mbuf flags + * - TX flags therefore start at bit position 55 (i.e. 63-8), and new flags get + * added to the right of the previously defined flags */ #define PKT_RX_VLAN_PKT 0x0001 /**< RX packet is a 802.1q VLAN packet. */ #define PKT_RX_RSS_HASH 0x0002 /**< RX packet with RSS hash result. */ @@ -86,26 +92,27 @@ extern "C" { #define PKT_RX_IEEE1588_PTP 0x0200 /**< RX IEEE1588 L2 Ethernet PT Packet. */ #define PKT_RX_IEEE1588_TMST 0x0400 /**< RX IEEE1588 L2/L4 timestamped packet.*/ -#define PKT_TX_VLAN_PKT 0x0800 /**< TX packet is a 802.1q VLAN packet. */ -#define PKT_TX_IP_CKSUM 0x1000 /**< IP cksum of TX pkt. computed by NIC. */ -#define PKT_TX_IPV4_CSUM 0x1000 /**< Alias of PKT_TX_IP_CKSUM. */ +#define PKT_TX_VLAN_PKT (1ULL << 55) /**< TX packet is a 802.1q VLAN packet. */ +#define PKT_TX_IP_CKSUM (1ULL << 54) /**< IP cksum of TX pkt. computed by NIC. */ +#define PKT_TX_IPV4_CSUM PKT_TX_IP_CKSUM /**< Alias of PKT_TX_IP_CKSUM. */ #define PKT_TX_IPV4 PKT_RX_IPV4_HDR /**< IPv4 with no IP checksum offload. */ #define PKT_TX_IPV6 PKT_RX_IPV6_HDR /**< IPv6 packet */ /* - * Bit 14~13 used for L4 packet type with checksum enabled. + * Bits 52+53 used for L4 packet type with checksum enabled. * 00: Reserved * 01: TCP checksum * 10: SCTP checksum * 11: UDP checksum */ -#define PKT_TX_L4_MASK 0x6000 /**< Mask bits for L4 checksum offload request. */ -#define PKT_TX_L4_NO_CKSUM 0x0000 /**< Disable L4 cksum of TX pkt. */ -#define PKT_TX_TCP_CKSUM 0x2000 /**< TCP cksum of TX pkt. computed by NIC. */ -#define PKT_TX_SCTP_CKSUM 0x4000 /**< SCTP cksum of TX pkt. computed by NIC. */ -#define PKT_TX_UDP_CKSUM 0x6000 /**< UDP cksum of TX pkt. computed by NIC. */ -/* Bit 15 */ -#define PKT_TX_IEEE1588_TMST 0x8000 /**< TX IEEE1588 packet to timestamp. */ +#define PKT_TX_L4_NO_CKSUM (0ULL << 52) /**< Disable L4 cksum of TX pkt. */ +#define PKT_TX_TCP_CKSUM (1ULL << 52) /**< TCP cksum of TX pkt. computed by NIC. */ +#define PKT_TX_SCTP_CKSUM (2ULL << 52) /**< SCTP cksum of TX pkt. computed by NIC. */ +#define PKT_TX_UDP_CKSUM (3ULL << 52) /**< UDP cksum of TX pkt. computed by NIC. */ +#define PKT_TX_L4_MASK (3ULL << 52) /**< Mask for L4 cksum offload request. */ + +/* Bit 51 - IEEE1588*/ +#define PKT_TX_IEEE1588_TMST (1ULL << 51) /**< TX IEEE1588 packet to timestamp. */ /* Use final bit of flags to indicate a control mbuf */ #define CTRL_MBUF_FLAG (1ULL << 63) -- 1.9.3