From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9214EA0487 for ; Mon, 1 Jul 2019 15:10:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 21C3C1B96E; Mon, 1 Jul 2019 15:10:40 +0200 (CEST) Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id EB0145B3C for ; Mon, 1 Jul 2019 15:10:38 +0200 (CEST) Received: from lfbn-lil-1-176-160.w90-45.abo.wanadoo.fr ([90.45.26.160] helo=droids-corp.org) by mail.droids-corp.org with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hhw7p-0007qQ-0z; Mon, 01 Jul 2019 15:13:42 +0200 Received: by droids-corp.org (sSMTP sendmail emulation); Mon, 01 Jul 2019 15:10:34 +0200 Date: Mon, 1 Jul 2019 15:10:34 +0200 From: Olivier Matz To: Morten =?iso-8859-1?Q?Br=F8rup?= Cc: shahafs@mellanox.com, yskoh@mellanox.com, dev@dpdk.org Message-ID: <20190701131034.rrng76zz2ewgrkz2@platinum> References: <1561125938-4414-1-git-send-email-mb@smartsharesystems.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1561125938-4414-1-git-send-email-mb@smartsharesystems.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH] IPv6 header TC field is 8 (not 4) bits, and also used as DSCP and ECN. 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" Hi Morten, On Fri, Jun 21, 2019 at 04:05:38PM +0200, Morten Brørup wrote: > IPv4 header TOS field is also used as DSCP and ECN fields. > > Signed-off-by: Morten Brørup > --- > lib/librte_net/rte_ip.h | 10 ++++++++-- > 1 files changed, 8 insertions(+), 2 deletions(-) > > diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h > index ae3b7e7..e69b863 100644 > --- a/lib/librte_net/rte_ip.h > +++ b/lib/librte_net/rte_ip.h > @@ -58,6 +58,10 @@ struct rte_ipv4_hdr { > */ > #define RTE_IPV4_IHL_MULTIPLIER (4) > > +/* Type of Service fields */ > +#define RTE_IPV4_HDR_DSCP_MASK (0xfc) > +#define RTE_IPV4_HDR_ECN_MASK (0x03) > + > /* Fragment Offset * Flags. */ > #define RTE_IPV4_HDR_DF_SHIFT 14 > #define RTE_IPV4_HDR_MF_SHIFT 13 > @@ -354,8 +358,10 @@ struct rte_ipv6_hdr { > /* IPv6 vtc_flow: IPv / TC / flow_label */ > #define RTE_IPV6_HDR_FL_SHIFT 0 > #define RTE_IPV6_HDR_TC_SHIFT 20 > -#define RTE_IPV6_HDR_FL_MASK ((1u << RTE_IPV6_HDR_TC_SHIFT) - 1) > -#define RTE_IPV6_HDR_TC_MASK (0xf << RTE_IPV6_HDR_TC_SHIFT) > +#define RTE_IPV6_HDR_FL_MASK ((1u << RTE_IPV6_HDR_TC_SHIFT) - 1) > +#define RTE_IPV6_HDR_TC_MASK (0xff << RTE_IPV6_HDR_TC_SHIFT) > +#define RTE_IPV6_HDR_DSCP_MASK (0xfc << RTE_IPV6_HDR_TC_SHIFT) > +#define RTE_IPV6_HDR_ECN_MASK (0x03 << RTE_IPV6_HDR_TC_SHIFT) > > /** > * Process the pseudo-header checksum of an IPv6 header. The changes look good to me. Can I however suggest to split the patch in 2 as below? - net: fix definition of ipv6 traffic class mask - net: add definition for dscp and ecn masks I see that you already CC'd mlx5 maintainers, as the driver uses the RTE_IPV6_HDR_TC_MASK definition. Also, it looks that it may conflict with this patch: https://mails.dpdk.org/archives/dev/2019-July/136575.html It is maybe preferable to integrate your patchset first, then rebase Fan's patchset on top of it. Thanks, Olivier