From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) by dpdk.org (Postfix) with ESMTP id 186ED1F7 for ; Tue, 30 Sep 2014 17:53:24 +0200 (CEST) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail1.windriver.com (8.14.9/8.14.5) with ESMTP id s8UG04Ug023803 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Tue, 30 Sep 2014 09:00:05 -0700 (PDT) Received: from ALA-MBB.corp.ad.wrs.com ([169.254.1.18]) by ALA-HCA.corp.ad.wrs.com ([147.11.189.40]) with mapi id 14.03.0174.001; Tue, 30 Sep 2014 09:00:04 -0700 From: "Wiles, Roger Keith" To: "RICHARDSON, BRUCE" Thread-Topic: [dpdk-dev] [PATCH RFC] mbuf: Adjust TX flags to start at bit 32 Thread-Index: AQHP3MMRv0kg7IC7ZUmo03vrnRyYwZwaQ60AgAAHVwA= Date: Tue, 30 Sep 2014 16:00:04 +0000 Message-ID: References: <1412090762-18852-1-git-send-email-bruce.richardson@intel.com> <20140930153348.GA13504@BRICHA3-MOBL> In-Reply-To: <20140930153348.GA13504@BRICHA3-MOBL> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.25.40.166] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH RFC] mbuf: Adjust TX flags to start at bit 32 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, 30 Sep 2014 15:53:25 -0000 Hi Bruce, I like the idea of the split, which should make it easier to do the testing= of those bits. One comment below. On Sep 30, 2014, at 10:33 AM, Bruce Richardson = wrote: > On Tue, Sep 30, 2014 at 04:26:02PM +0100, Bruce Richardson wrote: >> 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. >>=20 >> Signed-off-by: Bruce Richardson >> --- >=20 > This is just an RFC patch for now, as I'm looking for input to make sure= =20 > this is done right. Couple of opens, if people have input: > * is a 32/32 split for RX/TX flags appropriate? Are we likely to have abo= ut=20 > equal numbers of each? > * Doing a grep for the TX flag use, it seems the defines are commonly use= d,=20 > but if anyone is aware of anywhere where the code depends on the flags = =20 > having a particular value, please let me know. >=20 > If I have time, I also hope to look at doing rework on the testpmd flag=20 > handling based off Olivier's previous patches, but since that is not=20 > affecting the public ABI, I consider it a bit lower priority. >=20 > Thanks, > /Bruce >=20 >> lib/librte_mbuf/rte_mbuf.h | 26 +++++++++++++------------- >> 1 file changed, 13 insertions(+), 13 deletions(-) >>=20 >> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h >> index 1c6e115..c9fc4ec 100644 >> --- a/lib/librte_mbuf/rte_mbuf.h >> +++ b/lib/librte_mbuf/rte_mbuf.h >> @@ -86,26 +86,26 @@ extern "C" { >> #define PKT_RX_IEEE1588_PTP 0x0200 /**< RX IEEE1588 L2 Ethernet PT Pack= et. */ >> #define PKT_RX_IEEE1588_TMST 0x0400 /**< RX IEEE1588 L2/L4 timestamped p= acket.*/ >>=20 >> -#define PKT_TX_VLAN_PKT 0x0800 /**< TX packet is a 802.1q VLAN pac= ket. */ >> -#define PKT_TX_IP_CKSUM 0x1000 /**< IP cksum of TX pkt. computed b= y NIC. */ >> -#define PKT_TX_IPV4_CSUM 0x1000 /**< Alias of PKT_TX_IP_CKSUM. */ >> -#define PKT_TX_IPV4 PKT_RX_IPV4_HDR /**< IPv4 with no IP check= sum offload. */ >> -#define PKT_TX_IPV6 PKT_RX_IPV6_HDR /**< IPv6 packet */ >> +#define PKT_TX_VLAN_PKT (0x0001 << 32) /**< TX packet is a 802.1q VLAN= packet. */ >> +#define PKT_TX_IP_CKSUM (0x0002 << 32) /**< IP cksum of TX pkt. comput= ed by NIC. */ One little nit in the patch is does (0x0001 << 32) need to be (0x0001ULL <<= 32)? I have not tested it and just a thought. Thanks ++Keith >> +#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 */ >>=20 >> /* >> - * Bit 14~13 used for L4 packet type with checksum enabled. >> + * Bit 35~34 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 offl= oad 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 timestam= p. */ >> +#define PKT_TX_L4_NO_CKSUM (0x0000 << 32) /**< Disable L4 cksum of TX= pkt. */ >> +#define PKT_TX_TCP_CKSUM (0x0004 << 32) /**< TCP cksum of TX pkt. c= omputed by NIC. */ >> +#define PKT_TX_SCTP_CKSUM (0x0008 << 32) /**< SCTP cksum of TX pkt. = computed by NIC. */ >> +#define PKT_TX_UDP_CKSUM (0x000C << 32) /**< UDP cksum of TX pkt. c= omputed by NIC. */ >> +#define PKT_TX_L4_MASK (0x000C << 32) /**< Mask for L4 cksum offl= oad request. */ >> +/* Bit 36 */ >> +#define PKT_TX_IEEE1588_TMST (0x0010 << 32) /**< TX IEEE1588 packet to = timestamp. */ >>=20 >> /* Use final bit of flags to indicate a control mbuf */ >> #define CTRL_MBUF_FLAG (1ULL << 63) >> --=20 >> 1.9.3 >>=20 Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-= 213-5533