diff options
author | Paolo Abeni <pabeni@redhat.com> | 2021-08-27 03:44:51 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-08-27 11:45:07 +0300 |
commit | a086aebae0ebe37e93ed8f6e686ca0d5c4375b44 (patch) | |
tree | cdc17ec37fc91fbabed2c3f0181294cd37516ddb /net/mptcp/options.c | |
parent | 8d548ea1dd157a40ff5882224795a82a5b9abfe6 (diff) | |
download | linux-a086aebae0ebe37e93ed8f6e686ca0d5c4375b44.tar.xz |
mptcp: better binary layout for mptcp_options_received
This change reorder the mptcp_options_received fields
to shrink the structure a bit and to ensure the most
frequently used fields are all in the first cacheline.
Sub-opt specific flags are moved out of the suboptions area,
and we must now explicitly set them when the relevant
suboption is parsed.
There is a notable exception: 'csum_reqd' is used by both DSS
and MPC suboptions, and keeping such field in the suboptions
flag area will simplfy the next patch.
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mptcp/options.c')
-rw-r--r-- | net/mptcp/options.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/net/mptcp/options.c b/net/mptcp/options.c index f012a71dd996..79b68ae9ef4d 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -83,8 +83,7 @@ static void mptcp_parse_option(const struct sk_buff *skb, if (flags & MPTCP_CAP_CHECKSUM_REQD) mp_opt->csum_reqd = 1; - if (flags & MPTCP_CAP_DENY_JOIN_ID0) - mp_opt->deny_join_id0 = 1; + mp_opt->deny_join_id0 = !!(flags & MPTCP_CAP_DENY_JOIN_ID0); mp_opt->mp_capable = 1; if (opsize >= TCPOLEN_MPTCP_MPC_SYNACK) { @@ -262,6 +261,8 @@ static void mptcp_parse_option(const struct sk_buff *skb, mp_opt->add_addr = 1; mp_opt->addr.id = *ptr++; + mp_opt->addr.port = 0; + mp_opt->ahmac = 0; if (mp_opt->addr.family == AF_INET) { memcpy((u8 *)&mp_opt->addr.addr.s_addr, (u8 *)ptr, 4); ptr += 4; @@ -363,15 +364,12 @@ void mptcp_get_options(const struct sock *sk, mp_opt->mp_capable = 0; mp_opt->mp_join = 0; mp_opt->add_addr = 0; - mp_opt->ahmac = 0; mp_opt->fastclose = 0; - mp_opt->addr.port = 0; mp_opt->rm_addr = 0; mp_opt->dss = 0; mp_opt->mp_prio = 0; mp_opt->reset = 0; mp_opt->csum_reqd = 0; - mp_opt->deny_join_id0 = 0; mp_opt->mp_fail = 0; length = (th->doff * 4) - sizeof(struct tcphdr); |