[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200804014312.549760-2-liuhangbin@gmail.com>
Date: Tue, 4 Aug 2020 09:43:11 +0800
From: Hangbin Liu <liuhangbin@...il.com>
To: netdev@...r.kernel.org
Cc: Guillaume Nault <gnault@...hat.com>,
Petr Machata <pmachata@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Roopa Prabhu <roopa@...ulusnetworks.com>,
David Ahern <dsahern@...nel.org>,
Andreas Karis <akaris@...hat.com>, stable@...r.kernel.org,
Hangbin Liu <liuhangbin@...il.com>
Subject: [PATCHv2 net 1/2] net: add IP_DSCP_MASK
In RFC1349 it defined TOS field like
0 1 2 3 4 5 6 7
+-----+-----+-----+-----+-----+-----+-----+-----+
| PRECEDENCE | TOS | MBZ |
+-----+-----+-----+-----+-----+-----+-----+-----+
But this has been obsoleted by RFC2474, and updated by RFC3168 later.
Now the DS Field should be like
0 1 2 3 4 5 6 7
+-----+-----+-----+-----+-----+-----+-----+-----+
| DS FIELD, DSCP | ECN FIELD |
+-----+-----+-----+-----+-----+-----+-----+-----+
DSCP: differentiated services codepoint
ECN: Explicit Congestion Notification
So the old IPTOS_TOS_MASK 0x1E should be updated. But since
changed the value will break UAPI, let's add a new value
IP_DSCP_MASK 0xFC as a replacement.
v2: remove IP_DSCP() definition as it's duplicated with RT_DSCP().
Signed-off-by: Hangbin Liu <liuhangbin@...il.com>
---
include/uapi/linux/in_route.h | 1 +
include/uapi/linux/ip.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/include/uapi/linux/in_route.h b/include/uapi/linux/in_route.h
index 0cc2c23b47f8..26ba4efb054d 100644
--- a/include/uapi/linux/in_route.h
+++ b/include/uapi/linux/in_route.h
@@ -29,5 +29,6 @@
#define RTCF_NAT (RTCF_DNAT|RTCF_SNAT)
#define RT_TOS(tos) ((tos)&IPTOS_TOS_MASK)
+#define RT_DSCP(tos) ((tos)&IP_DSCP_MASK)
#endif /* _LINUX_IN_ROUTE_H */
diff --git a/include/uapi/linux/ip.h b/include/uapi/linux/ip.h
index e42d13b55cf3..699a86038b9f 100644
--- a/include/uapi/linux/ip.h
+++ b/include/uapi/linux/ip.h
@@ -38,6 +38,7 @@
#define IPTOS_PREC_PRIORITY 0x20
#define IPTOS_PREC_ROUTINE 0x00
+#define IP_DSCP_MASK 0xFC
/* IP options */
#define IPOPT_COPY 0x80
--
2.25.4
Powered by blists - more mailing lists