From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 6FD95A0471 for ; Fri, 21 Jun 2019 16:05:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EC3DA1D53E; Fri, 21 Jun 2019 16:05:40 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by dpdk.org (Postfix) with ESMTP id 0B82A1D39A for ; Fri, 21 Jun 2019 16:05:38 +0200 (CEST) Received: from dkrd1.smartsharesys.local ([192.168.4.88]) by smartserver.smartsharesystems.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 21 Jun 2019 16:05:38 +0200 Received: by dkrd1.smartsharesys.local (Postfix, from userid 1001) id 9893729EBA; Fri, 21 Jun 2019 16:05:38 +0200 (CEST) From: =?utf-8?q?Morten=20Br=C3=B8rup?= To: olivier.matz@6wind.com, shahafs@mellanox.com, yskoh@mellanox.com Cc: dev@dpdk.org, =?utf-8?q?Morten=20Br=C3=B8rup?= Date: Fri, 21 Jun 2019 16:05:38 +0200 Message-Id: <1561125938-4414-1-git-send-email-mb@smartsharesystems.com> X-Mailer: git-send-email 1.5.6 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 21 Jun 2019 14:05:38.0664 (UTC) FILETIME=[677B3680:01D5283A] Subject: [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" 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. -- 1.5.6