diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2015-08-31 09:58:47 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-08-31 15:34:00 -0400 |
commit | c3a8d9474684d391b0afc3970d9b249add15ec07 (patch) | |
tree | f12130b61955f4471ebd61474244ecf9ebdc0858 /net/ipv6/route.c | |
parent | b8d3e4163a3562d7cba486687904383e78e7dd6a (diff) |
tcp: use dctcp if enabled on the route to the initiator
Currently, the following case doesn't use DCTCP, even if it should:
A responder has f.e. Cubic as system wide default, but for a specific
route to the initiating host, DCTCP is being set in RTAX_CC_ALGO. The
initiating host then uses DCTCP as congestion control, but since the
initiator sets ECT(0), tcp_ecn_create_request() doesn't set ecn_ok,
and we have to fall back to Reno after 3WHS completes.
We were thinking on how to solve this in a minimal, non-intrusive
way without bloating tcp_ecn_create_request() needlessly: lets cache
the CA ecn option flag in RTAX_FEATURES. In other words, when ECT(0)
is set on the SYN packet, set ecn_ok=1 iff route RTAX_FEATURES
contains the unexposed (internal-only) DST_FEATURE_ECN_CA. This allows
to only do a single metric feature lookup inside tcp_ecn_create_request().
Joint work with Florian Westphal.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r-- | net/ipv6/route.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 8771530df45e..f45cac6f8356 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -1698,6 +1698,7 @@ out: | |||
1698 | static int ip6_convert_metrics(struct mx6_config *mxc, | 1698 | static int ip6_convert_metrics(struct mx6_config *mxc, |
1699 | const struct fib6_config *cfg) | 1699 | const struct fib6_config *cfg) |
1700 | { | 1700 | { |
1701 | bool ecn_ca = false; | ||
1701 | struct nlattr *nla; | 1702 | struct nlattr *nla; |
1702 | int remaining; | 1703 | int remaining; |
1703 | u32 *mp; | 1704 | u32 *mp; |
@@ -1722,7 +1723,7 @@ static int ip6_convert_metrics(struct mx6_config *mxc, | |||
1722 | char tmp[TCP_CA_NAME_MAX]; | 1723 | char tmp[TCP_CA_NAME_MAX]; |
1723 | 1724 | ||
1724 | nla_strlcpy(tmp, nla, sizeof(tmp)); | 1725 | nla_strlcpy(tmp, nla, sizeof(tmp)); |
1725 | val = tcp_ca_get_key_by_name(tmp); | 1726 | val = tcp_ca_get_key_by_name(tmp, &ecn_ca); |
1726 | if (val == TCP_CA_UNSPEC) | 1727 | if (val == TCP_CA_UNSPEC) |
1727 | goto err; | 1728 | goto err; |
1728 | } else { | 1729 | } else { |
@@ -1735,8 +1736,12 @@ static int ip6_convert_metrics(struct mx6_config *mxc, | |||
1735 | __set_bit(type - 1, mxc->mx_valid); | 1736 | __set_bit(type - 1, mxc->mx_valid); |
1736 | } | 1737 | } |
1737 | 1738 | ||
1738 | mxc->mx = mp; | 1739 | if (ecn_ca) { |
1740 | __set_bit(RTAX_FEATURES - 1, mxc->mx_valid); | ||
1741 | mp[RTAX_FEATURES - 1] |= DST_FEATURE_ECN_CA; | ||
1742 | } | ||
1739 | 1743 | ||
1744 | mxc->mx = mp; | ||
1740 | return 0; | 1745 | return 0; |
1741 | err: | 1746 | err: |
1742 | kfree(mp); | 1747 | kfree(mp); |