]> git.baikalelectronics.ru Git - kernel.git/commit
mptcp: optimize out option generation
authorPaolo Abeni <pabeni@redhat.com>
Tue, 24 Aug 2021 23:26:13 +0000 (16:26 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 25 Aug 2021 10:02:34 +0000 (11:02 +0100)
commit4d49c94aca7940a775ff92fe6af4e47a66e06d29
tree709380b8d0f05236e65cff9552b847647b150bee
parente7ccd2a98a4d1d22d0c7610330f5e3971331c9bc
mptcp: optimize out option generation

Currently we have several protocol constraints on MPTCP options
generation (e.g. MPC and MPJ subopt are mutually exclusive)
and some additional ones required by our implementation
(e.g. almost all ADD_ADDR variant are mutually exclusive with
everything else).

We can leverage the above to optimize the out option generation:
we check DSS/MPC/MPJ presence in a mutually exclusive way,
avoiding many unneeded conditionals in the common cases.

Additionally extend the existing constraints on ADD_ADDR opt on
all subvariants, so that it becomes fully mutually exclusive with
the above and we can skip another conditional statement for the
common case.

This change is also needed by 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>
net/mptcp/options.c
net/mptcp/protocol.h