From: Gerrit Renker <gerrit@erg.abdn.ac.uk>
To: dccp@vger.kernel.org
Cc: netdev@vger.kernel.org, Gerrit Renker <gerrit@erg.abdn.ac.uk>
Subject: dccp-test-tree [PATCH 4/10] net: Hack to enable IPv6 ECN support
Date: Sun, 9 Aug 2009 21:48:41 +0200 [thread overview]
Message-ID: <1249847327-6792-5-git-send-email-gerrit@erg.abdn.ac.uk> (raw)
In-Reply-To: <1249847327-6792-4-git-send-email-gerrit@erg.abdn.ac.uk>
ECN is not currently supported on inet6 sockets.
This is a hack to copy over the ECN bits when ECN-capable transport
has been enabled on the inet_sk socket.
This allows to support DCCPv6 ECN support, but needs to be revised:
* the inet_sock already has an u8 `tos' field for the DSCP/ECN bits;
* the same field is present as u8 `tclass' field in ipv6_pinfo;
* the DS field (RFC 2474) and the ECN bits (RFC 3168) are AF-independent,
so TOS/Traffic Class could be made AF-independent;
* sockets that include ipv6_pinfo also include struct inet_sock.
Ideally there should be one field, e.g. `inet->dsfield', but doing
this requires some more careful analysis, since inet_sk(sk)->tos and
inet6_sk(sk)->tclass are referenced all over the source code.
Leaving this for the moment, to be completed later.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
---
include/net/inet_ecn.h | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
--- a/include/net/inet_ecn.h
+++ b/include/net/inet_ecn.h
@@ -46,9 +46,13 @@ static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner)
(label) &= ~htonl(INET_ECN_MASK << 20); \
} while (0)
+/*
+ * XXX Hack: copy over the ECN bits from inet_sk to inet6_sk.
+ * This should be replaced by a single `dsfield' in inet
+ */
#define IP6_ECN_flow_xmit(sk, label) do { \
- if (INET_ECN_is_capable(inet6_sk(sk)->tclass)) \
- (label) |= htonl(INET_ECN_ECT_0 << 20); \
+ IP6_ECN_flow_init(label); \
+ (label) |= htonl((inet_sk(sk)->tos & INET_ECN_MASK) << 20); \
} while (0)
static inline int IP_ECN_set_ce(struct iphdr *iph)
--
1.6.0.rc2
next prev parent reply other threads:[~2009-08-09 19:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <dccp_test_tree_sending_ecn_for_review>
2009-08-09 19:48 ` [PATCH 0/10]: DCCPv4/6 support for ECN/ECT(0) Gerrit Renker
2009-08-09 19:48 ` dccp-test-tree [PATCH 1/10]: Put the ECN bits into the dccp_skb_cb Gerrit Renker
2009-08-09 19:48 ` dccp-test-tree [PATCH 2/10] Add sysctl to toggle the local support for ECN Gerrit Renker
2009-08-09 19:48 ` dccp-test-tree [PATCH 3/10] Add feature-negotiation handler for ECN-Incapable feature Gerrit Renker
2009-08-09 19:48 ` Gerrit Renker [this message]
2009-08-09 19:48 ` dccp-test-tree [PATCH 5/10] net: Mask out ECN bits when setting TOS/TCLASS Gerrit Renker
2009-08-09 19:48 ` dccp-test-tree [PATCH 6/10] Extend the loss interval code to support ECN events Gerrit Renker
2009-08-09 19:48 ` dccp-test-tree [PATCH 7/10] Extend the packet-history code to support ECN-marked-CE events Gerrit Renker
2009-08-09 19:48 ` dccp-test-tree [PATCH 8/10] ccid-2: Ack Vector ECN support Gerrit Renker
2009-08-09 19:48 ` dccp-test-tree [PATCH 9/10] Userspace support for modifying the ECN bits of Data/DataAck packets Gerrit Renker
2009-08-09 19:48 ` dccp-test-tree [PATCH 10/10] Userspace support for reading ECN bits Gerrit Renker
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=1249847327-6792-5-git-send-email-gerrit@erg.abdn.ac.uk \
--to=gerrit@erg.abdn.ac.uk \
--cc=dccp@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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