From: "Morten Brørup" <mb@smartsharesystems.com>
To: olivier.matz@6wind.com, shahafs@mellanox.com, yskoh@mellanox.com,
roy.fan.zhang@intel.com
Cc: dev@dpdk.org, "Morten Brørup" <mb@smartsharesystems.com>
Subject: [dpdk-dev] [PATCH] net: add definition for dscp and ecn masks
Date: Mon, 1 Jul 2019 15:59:04 +0200 [thread overview]
Message-ID: <1561989544-12806-1-git-send-email-mb@smartsharesystems.com> (raw)
Added definitions of DSCP and ECN masks.
Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
---
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 059ec80..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 (0xff << 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
next reply other threads:[~2019-07-01 13:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-01 13:59 Morten Brørup [this message]
2019-07-02 9:32 ` Olivier Matz
2019-07-02 19:30 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1561989544-12806-1-git-send-email-mb@smartsharesystems.com \
--to=mb@smartsharesystems.com \
--cc=dev@dpdk.org \
--cc=olivier.matz@6wind.com \
--cc=roy.fan.zhang@intel.com \
--cc=shahafs@mellanox.com \
--cc=yskoh@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).