diff mbox

[v2] tcp: split tcp_ecn sysctl knob to distinguish between IPv4 and IPv6

Message ID 20130103000009.GG4464@order.stressinduktion.org
State Rejected, archived
Delegated to: David Miller
Headers show

Commit Message

Hannes Frederic Sowa Jan. 3, 2013, midnight UTC
ECN could be more reliable when used with IPv6 (I don't have proofs). For
people who want to try ECN with IPv6 but still have problems connecting
to destinations because of broken IPv4 routers this switch allows one
to enable ECN just for IPv6.

Perhaps ECN could be enabled by default in future.

No code changes since initial submission, just added documentation.

Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
 Documentation/networking/ip-sysctl.txt | 28 +++++++++++++++++++++-------
 include/net/sock.h                     |  1 +
 include/net/tcp.h                      |  8 +++++---
 net/ipv4/syncookies.c                  |  6 ++++--
 net/ipv4/sysctl_net_ipv4.c             |  2 +-
 net/ipv4/tcp_input.c                   |  2 --
 net/ipv4/tcp_ipv4.c                    |  3 ++-
 net/ipv4/tcp_output.c                  |  2 +-
 net/ipv6/syncookies.c                  |  3 ++-
 net/ipv6/sysctl_net_ipv6.c             |  8 ++++++++
 net/ipv6/tcp_ipv6.c                    |  4 +++-
 11 files changed, 48 insertions(+), 19 deletions(-)

Comments

Hannes Frederic Sowa Jan. 3, 2013, 12:28 p.m. UTC | #1
On Thu, Jan 03, 2013 at 01:00:09AM +0100, Hannes Frederic Sowa wrote:
> ECN could be more reliable when used with IPv6 (I don't have proofs). For
> people who want to try ECN with IPv6 but still have problems connecting
> to destinations because of broken IPv4 routers this switch allows one
> to enable ECN just for IPv6.
> 
> Perhaps ECN could be enabled by default in future.
> 
> No code changes since initial submission, just added documentation.

May I ask what lead to the rejection of the patch?


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eric Dumazet Jan. 3, 2013, 12:47 p.m. UTC | #2
On Thu, 2013-01-03 at 01:00 +0100, Hannes Frederic Sowa wrote:
> ECN could be more reliable when used with IPv6 (I don't have proofs). For
> people who want to try ECN with IPv6 but still have problems connecting
> to destinations because of broken IPv4 routers this switch allows one
> to enable ECN just for IPv6.
> 
> Perhaps ECN could be enabled by default in future.
> 
> No code changes since initial submission, just added documentation.
> 
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> ---

It would be nice to make the ecn sysctl per net namespace.

Do you have an idea of how to adapt your patch to get this as well ?



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Jan. 3, 2013, 12:53 p.m. UTC | #3
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Thu, 3 Jan 2013 13:28:44 +0100

> On Thu, Jan 03, 2013 at 01:00:09AM +0100, Hannes Frederic Sowa wrote:
>> ECN could be more reliable when used with IPv6 (I don't have proofs). For
>> people who want to try ECN with IPv6 but still have problems connecting
>> to destinations because of broken IPv4 routers this switch allows one
>> to enable ECN just for IPv6.
>> 
>> Perhaps ECN could be enabled by default in future.
>> 
>> No code changes since initial submission, just added documentation.
> 
> May I ask what lead to the rejection of the patch?

I don't see any value in splitting up ipv4 and ipv6.

I think we should turn the existing knob on unliaterally
by default.  That would be a much better patch.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hannes Frederic Sowa Jan. 3, 2013, 12:57 p.m. UTC | #4
On Thu, Jan 03, 2013 at 04:47:40AM -0800, Eric Dumazet wrote:
> On Thu, 2013-01-03 at 01:00 +0100, Hannes Frederic Sowa wrote:
> > ECN could be more reliable when used with IPv6 (I don't have proofs). For
> > people who want to try ECN with IPv6 but still have problems connecting
> > to destinations because of broken IPv4 routers this switch allows one
> > to enable ECN just for IPv6.
> > 
> > Perhaps ECN could be enabled by default in future.
> > 
> > No code changes since initial submission, just added documentation.
> > 
> > Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> > ---
> 
> It would be nice to make the ecn sysctl per net namespace.
> 
> Do you have an idea of how to adapt your patch to get this as well ?

Currently not, but I will try. :)

Is the direction to split the sysctl ok? Or should it be a unified sysctl for
ipv4/ipv6 and only be separate per namespace?

Thanks!

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hannes Frederic Sowa Jan. 3, 2013, 12:58 p.m. UTC | #5
On Thu, Jan 03, 2013 at 04:53:50AM -0800, David Miller wrote:
> From: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Date: Thu, 3 Jan 2013 13:28:44 +0100
> 
> > On Thu, Jan 03, 2013 at 01:00:09AM +0100, Hannes Frederic Sowa wrote:
> >> ECN could be more reliable when used with IPv6 (I don't have proofs). For
> >> people who want to try ECN with IPv6 but still have problems connecting
> >> to destinations because of broken IPv4 routers this switch allows one
> >> to enable ECN just for IPv6.
> >> 
> >> Perhaps ECN could be enabled by default in future.
> >> 
> >> No code changes since initial submission, just added documentation.
> > 
> > May I ask what lead to the rejection of the patch?
> 
> I don't see any value in splitting up ipv4 and ipv6.
> 
> I think we should turn the existing knob on unliaterally
> by default.  That would be a much better patch.

Oh, I would be happy to do that. :)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eric Dumazet Jan. 3, 2013, 1:13 p.m. UTC | #6
On Thu, 2013-01-03 at 13:57 +0100, Hannes Frederic Sowa wrote:

> Currently not, but I will try. :)
> 
> Is the direction to split the sysctl ok? Or should it be a unified sysctl for
> ipv4/ipv6 and only be separate per namespace?
> 

I fixed some ECN glitches in IPv6 in the past, I am not sure we can
assume IPv6 gear is ECN bug free. In fact it might be the opposite.

So adding a per net sysctl would allow a better tuning for experiments,
and allow some applications to use a private netns and change their
sysctl.



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
stephen hemminger Jan. 3, 2013, 4:22 p.m. UTC | #7
On Thu, 3 Jan 2013 13:58:12 +0100
Hannes Frederic Sowa <hannes@stressinduktion.org> wrote:

> On Thu, Jan 03, 2013 at 04:53:50AM -0800, David Miller wrote:
> > From: Hannes Frederic Sowa <hannes@stressinduktion.org>
> > Date: Thu, 3 Jan 2013 13:28:44 +0100
> > 
> > > On Thu, Jan 03, 2013 at 01:00:09AM +0100, Hannes Frederic Sowa wrote:
> > >> ECN could be more reliable when used with IPv6 (I don't have proofs). For
> > >> people who want to try ECN with IPv6 but still have problems connecting
> > >> to destinations because of broken IPv4 routers this switch allows one
> > >> to enable ECN just for IPv6.
> > >> 
> > >> Perhaps ECN could be enabled by default in future.
> > >> 
> > >> No code changes since initial submission, just added documentation.
> > > 
> > > May I ask what lead to the rejection of the patch?
> > 
> > I don't see any value in splitting up ipv4 and ipv6.
> > 
> > I think we should turn the existing knob on unliaterally
> > by default.  That would be a much better patch.
> 
> Oh, I would be happy to do that. :)

Perhaps, ECN should be a property of the route.
There is RTAX_FEATURE_ECN but it appears to have been lost
as part of the removal of route cache.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hannes Frederic Sowa Jan. 3, 2013, 4:58 p.m. UTC | #8
On Thu, Jan 03, 2013 at 08:22:54AM -0800, Stephen Hemminger wrote:
> On Thu, 3 Jan 2013 13:58:12 +0100
> Hannes Frederic Sowa <hannes@stressinduktion.org> wrote:
> 
> > On Thu, Jan 03, 2013 at 04:53:50AM -0800, David Miller wrote:
> > > From: Hannes Frederic Sowa <hannes@stressinduktion.org>
> > > Date: Thu, 3 Jan 2013 13:28:44 +0100
> > > 
> > > > On Thu, Jan 03, 2013 at 01:00:09AM +0100, Hannes Frederic Sowa wrote:
> > > >> ECN could be more reliable when used with IPv6 (I don't have proofs). For
> > > >> people who want to try ECN with IPv6 but still have problems connecting
> > > >> to destinations because of broken IPv4 routers this switch allows one
> > > >> to enable ECN just for IPv6.
> > > >> 
> > > >> Perhaps ECN could be enabled by default in future.
> > > >> 
> > > >> No code changes since initial submission, just added documentation.
> > > > 
> > > > May I ask what lead to the rejection of the patch?
> > > 
> > > I don't see any value in splitting up ipv4 and ipv6.
> > > 
> > > I think we should turn the existing knob on unliaterally
> > > by default.  That would be a much better patch.
> > 
> > Oh, I would be happy to do that. :)
> 
> Perhaps, ECN should be a property of the route.
> There is RTAX_FEATURE_ECN but it appears to have been lost
> as part of the removal of route cache.

I suggested something like this in the discussion on bufferbloat:
<http://thread.gmane.org/gmane.network.routing.bufferbloat/1086>

Especially if RFC5562 would be implemented one day, this could really be
helpful.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hannes Frederic Sowa Jan. 6, 2013, 1:31 a.m. UTC | #9
On Thu, Jan 03, 2013 at 04:53:50AM -0800, David Miller wrote:
> > On Thu, Jan 03, 2013 at 01:00:09AM +0100, Hannes Frederic Sowa wrote:
> >> ECN could be more reliable when used with IPv6 (I don't have proofs). For
> >> people who want to try ECN with IPv6 but still have problems connecting
> >> to destinations because of broken IPv4 routers this switch allows one
> >> to enable ECN just for IPv6.
> >> 
> >> Perhaps ECN could be enabled by default in future.
> >> 
> >> No code changes since initial submission, just added documentation.
> > 
> > May I ask what lead to the rejection of the patch?
> 
> I don't see any value in splitting up ipv4 and ipv6.
> 
> I think we should turn the existing knob on unliaterally
> by default.  That would be a much better patch.

I wonder if we really should go down this route to turn on ecn by
default or if I should try to come up with a patch which marks non
working ecn paths in the destination cache and suppress ecn for those
connections. Any advice?

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index ac1710e..974fc2b 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -207,11 +207,11 @@  tcp_early_retrans - INTEGER
 	Default: 2
 
 tcp_ecn - INTEGER
-	Control use of Explicit Congestion Notification (ECN) by TCP.
-	ECN is used only when both ends of the TCP connection indicate
-	support for it.  This feature is useful in avoiding losses due
-	to congestion by allowing supporting routers to signal
-	congestion before having to drop packets.
+	Control use of Explicit Congestion Notification (ECN) by TCP
+	over IPv4.  ECN is used only when both ends of the TCP
+	connection indicate support for it.  This feature is useful in
+	avoiding losses due to congestion by allowing supporting
+	routers to signal congestion before having to drop packets.
 	Possible values are:
 		0 Disable ECN.  Neither initiate nor accept ECN.
 		1 Always request ECN on outgoing connection attempts.
@@ -1065,8 +1065,9 @@  delon.nicolas@wanadoo.fr
 
 /proc/sys/net/ipv6/* Variables:
 
-IPv6 has no global variables such as tcp_*.  tcp_* settings under ipv4/ also
-apply to IPv6 [XXX?].
+IPv6 has no global variables such as tcp_*.  Most tcp_* settings under
+ipv4/ also apply to IPv6 (currently the only exception is tcp_ecn)
+[XXX?].
 
 bindv6only - BOOLEAN
 	Default value for IPV6_V6ONLY socket option,
@@ -1077,6 +1078,19 @@  bindv6only - BOOLEAN
 
 	Default: FALSE (as specified in RFC3493)
 
+tcp_ecn - INTEGER
+	Control use of Explicit Congestion Notification (ECN) by TCP
+	over IPv6.  ECN is used only when both ends of the TCP
+	connection indicate support for it.  This feature is useful in
+	avoiding losses due to congestion by allowing supporting
+	routers to signal congestion before having to drop packets.
+	Possible values are:
+		0 Disable ECN.  Neither initiate nor accept ECN.
+		1 Always request ECN on outgoing connection attempts.
+		2 Enable ECN when requested by incomming connections
+		  but do not request ECN on outgoing connections.
+	Default: 2
+
 IPv6 Fragmentation:
 
 ip6frag_high_thresh - INTEGER
diff --git a/include/net/sock.h b/include/net/sock.h
index 182ca99..aa3c30e 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -944,6 +944,7 @@  struct proto {
 	int			*sysctl_rmem;
 	int			max_header;
 	bool			no_autobind;
+	int			ecn;
 
 	struct kmem_cache	*slab;
 	unsigned int		obj_size;
diff --git a/include/net/tcp.h b/include/net/tcp.h
index aed42c7..1202a6d 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -266,7 +266,6 @@  extern int sysctl_tcp_abort_on_overflow;
 extern int sysctl_tcp_max_orphans;
 extern int sysctl_tcp_fack;
 extern int sysctl_tcp_reordering;
-extern int sysctl_tcp_ecn;
 extern int sysctl_tcp_dsack;
 extern int sysctl_tcp_wmem[3];
 extern int sysctl_tcp_rmem[3];
@@ -351,6 +350,7 @@  static inline bool tcp_synq_no_recent_overflow(const struct sock *sk)
 }
 
 extern struct proto tcp_prot;
+extern struct proto tcpv6_prot;
 
 #define TCP_INC_STATS(net, field)	SNMP_INC_STATS((net)->mib.tcp_statistics, field)
 #define TCP_INC_STATS_BH(net, field)	SNMP_INC_STATS_BH((net)->mib.tcp_statistics, field)
@@ -504,7 +504,8 @@  static inline __u32 cookie_v4_init_sequence(struct sock *sk,
 #endif
 
 extern __u32 cookie_init_timestamp(struct request_sock *req);
-extern bool cookie_check_timestamp(struct tcp_options_received *opt, bool *);
+extern bool cookie_check_timestamp(struct tcp_options_received *opt,
+				int sysctl_tcp_ecn, bool *ecn_ok);
 
 /* From net/ipv6/syncookies.c */
 extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb);
@@ -728,7 +729,8 @@  struct tcp_skb_cb {
  * notifications, we disable TCP ECN negociation.
  */
 static inline void
-TCP_ECN_create_request(struct request_sock *req, const struct sk_buff *skb)
+TCP_ECN_create_request(struct request_sock *req,
+		const struct sk_buff *skb, int sysctl_tcp_ecn)
 {
 	const struct tcphdr *th = tcp_hdr(skb);
 
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index b236ef0..64dbfc5 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -232,7 +232,8 @@  static inline struct sock *get_cookie_sock(struct sock *sk, struct sk_buff *skb,
  *
  * return false if we decode an option that should not be.
  */
-bool cookie_check_timestamp(struct tcp_options_received *tcp_opt, bool *ecn_ok)
+bool cookie_check_timestamp(struct tcp_options_received *tcp_opt,
+			int sysctl_tcp_ecn, bool *ecn_ok)
 {
 	/* echoed timestamp, lowest bits contain options */
 	u32 options = tcp_opt->rcv_tsecr & TSMASK;
@@ -278,6 +279,7 @@  struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
 	struct rtable *rt;
 	__u8 rcv_wscale;
 	bool ecn_ok = false;
+	int sysctl_tcp_ecn = sk->sk_prot->ecn;
 	struct flowi4 fl4;
 
 	if (!sysctl_tcp_syncookies || !th->ack || th->rst)
@@ -295,7 +297,7 @@  struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
 	memset(&tcp_opt, 0, sizeof(tcp_opt));
 	tcp_parse_options(skb, &tcp_opt, &hash_location, 0, NULL);
 
-	if (!cookie_check_timestamp(&tcp_opt, &ecn_ok))
+	if (!cookie_check_timestamp(&tcp_opt, sysctl_tcp_ecn, &ecn_ok))
 		goto out;
 
 	ret = NULL;
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index d84400b..f7aac98 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -539,7 +539,7 @@  static struct ctl_table ipv4_table[] = {
 	},
 	{
 		.procname	= "tcp_ecn",
-		.data		= &sysctl_tcp_ecn,
+		.data		= &tcp_prot.ecn,
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index a28e4db..38e1184 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -81,8 +81,6 @@  int sysctl_tcp_sack __read_mostly = 1;
 int sysctl_tcp_fack __read_mostly = 1;
 int sysctl_tcp_reordering __read_mostly = TCP_FASTRETRANS_THRESH;
 EXPORT_SYMBOL(sysctl_tcp_reordering);
-int sysctl_tcp_ecn __read_mostly = 2;
-EXPORT_SYMBOL(sysctl_tcp_ecn);
 int sysctl_tcp_dsack __read_mostly = 1;
 int sysctl_tcp_app_win __read_mostly = 31;
 int sysctl_tcp_adv_win_scale __read_mostly = 1;
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 54139fa..32e012a 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1568,7 +1568,7 @@  int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
 		goto drop_and_free;
 
 	if (!want_cookie || tmp_opt.tstamp_ok)
-		TCP_ECN_create_request(req, skb);
+		TCP_ECN_create_request(req, skb, tcp_prot.ecn);
 
 	if (want_cookie) {
 		isn = cookie_v4_init_sequence(sk, skb, &req->mss);
@@ -2874,6 +2874,7 @@  struct proto tcp_prot = {
 	.rsk_prot		= &tcp_request_sock_ops,
 	.h.hashinfo		= &tcp_hashinfo,
 	.no_autobind		= true,
+	.ecn			= 2,
 #ifdef CONFIG_COMPAT
 	.compat_setsockopt	= compat_tcp_setsockopt,
 	.compat_getsockopt	= compat_tcp_getsockopt,
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 5d45159..0c75961 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -314,7 +314,7 @@  static inline void TCP_ECN_send_syn(struct sock *sk, struct sk_buff *skb)
 	struct tcp_sock *tp = tcp_sk(sk);
 
 	tp->ecn_flags = 0;
-	if (sysctl_tcp_ecn == 1) {
+	if (sk->sk_prot->ecn == 1) {
 		TCP_SKB_CB(skb)->tcp_flags |= TCPHDR_ECE | TCPHDR_CWR;
 		tp->ecn_flags = TCP_ECN_OK;
 	}
diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c
index 4016197..ce19227 100644
--- a/net/ipv6/syncookies.c
+++ b/net/ipv6/syncookies.c
@@ -163,6 +163,7 @@  struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
 	struct dst_entry *dst;
 	__u8 rcv_wscale;
 	bool ecn_ok = false;
+	int sysctl_tcp_ecn = sk->sk_prot->ecn;
 
 	if (!sysctl_tcp_syncookies || !th->ack || th->rst)
 		goto out;
@@ -179,7 +180,7 @@  struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
 	memset(&tcp_opt, 0, sizeof(tcp_opt));
 	tcp_parse_options(skb, &tcp_opt, &hash_location, 0, NULL);
 
-	if (!cookie_check_timestamp(&tcp_opt, &ecn_ok))
+	if (!cookie_check_timestamp(&tcp_opt, sysctl_tcp_ecn, &ecn_ok))
 		goto out;
 
 	ret = NULL;
diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c
index e85c48b..a2e764f 100644
--- a/net/ipv6/sysctl_net_ipv6.c
+++ b/net/ipv6/sysctl_net_ipv6.c
@@ -15,6 +15,7 @@ 
 #include <net/ipv6.h>
 #include <net/addrconf.h>
 #include <net/inet_frag.h>
+#include <net/tcp.h>
 
 static ctl_table ipv6_table_template[] = {
 	{
@@ -24,6 +25,13 @@  static ctl_table ipv6_table_template[] = {
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec
 	},
+	{
+		.procname	= "tcp_ecn",
+		.data		= &tcpv6_prot.ecn,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= proc_dointvec
+	},
 	{ }
 };
 
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 93825dd..98bd8a3 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1027,7 +1027,7 @@  static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
 	treq->rmt_addr = ipv6_hdr(skb)->saddr;
 	treq->loc_addr = ipv6_hdr(skb)->daddr;
 	if (!want_cookie || tmp_opt.tstamp_ok)
-		TCP_ECN_create_request(req, skb);
+		TCP_ECN_create_request(req, skb, tcpv6_prot.ecn);
 
 	treq->iif = sk->sk_bound_dev_if;
 
@@ -1955,6 +1955,7 @@  struct proto tcpv6_prot = {
 	.rsk_prot		= &tcp6_request_sock_ops,
 	.h.hashinfo		= &tcp_hashinfo,
 	.no_autobind		= true,
+	.ecn			= 2,
 #ifdef CONFIG_COMPAT
 	.compat_setsockopt	= compat_tcp_setsockopt,
 	.compat_getsockopt	= compat_tcp_getsockopt,
@@ -1963,6 +1964,7 @@  struct proto tcpv6_prot = {
 	.proto_cgroup		= tcp_proto_cgroup,
 #endif
 };
+EXPORT_SYMBOL(tcpv6_prot);
 
 static const struct inet6_protocol tcpv6_protocol = {
 	.early_demux	=	tcp_v6_early_demux,