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>
This commit is contained in:

committed by
David S. Miller

parent
b8d3e4163a
commit
c3a8d94746
@@ -1698,6 +1698,7 @@ out:
|
||||
static int ip6_convert_metrics(struct mx6_config *mxc,
|
||||
const struct fib6_config *cfg)
|
||||
{
|
||||
bool ecn_ca = false;
|
||||
struct nlattr *nla;
|
||||
int remaining;
|
||||
u32 *mp;
|
||||
@@ -1722,7 +1723,7 @@ static int ip6_convert_metrics(struct mx6_config *mxc,
|
||||
char tmp[TCP_CA_NAME_MAX];
|
||||
|
||||
nla_strlcpy(tmp, nla, sizeof(tmp));
|
||||
val = tcp_ca_get_key_by_name(tmp);
|
||||
val = tcp_ca_get_key_by_name(tmp, &ecn_ca);
|
||||
if (val == TCP_CA_UNSPEC)
|
||||
goto err;
|
||||
} else {
|
||||
@@ -1735,8 +1736,12 @@ static int ip6_convert_metrics(struct mx6_config *mxc,
|
||||
__set_bit(type - 1, mxc->mx_valid);
|
||||
}
|
||||
|
||||
mxc->mx = mp;
|
||||
if (ecn_ca) {
|
||||
__set_bit(RTAX_FEATURES - 1, mxc->mx_valid);
|
||||
mp[RTAX_FEATURES - 1] |= DST_FEATURE_ECN_CA;
|
||||
}
|
||||
|
||||
mxc->mx = mp;
|
||||
return 0;
|
||||
err:
|
||||
kfree(mp);
|
||||
|
Reference in New Issue
Block a user