]> git.baikalelectronics.ru Git - kernel.git/commit
mptcp: add the address ID assignment bitmap
authorGeliang Tang <geliangtang@gmail.com>
Sat, 9 Jan 2021 00:47:55 +0000 (16:47 -0800)
committerJakub Kicinski <kuba@kernel.org>
Sun, 10 Jan 2021 02:18:43 +0000 (18:18 -0800)
commitbe46762d901e4a6d3455d9552f28e9f7f632f5fc
tree88df5aa2525bea2408b680aef3998f85ed879439
parent0c7c2ac6e1dc5a04cdd8f838f2885f6ded3a9cd9
mptcp: add the address ID assignment bitmap

Currently the address ID set by the netlink PM from user-space is
overridden by the kernel. This patch added the address ID assignment
bitmap to allow user-space to set the address ID.

Use a per netns bitmask id_bitmap (256 bits) to keep track of in-use IDs.
And use next_id to keep track of the highest ID currently in use. If the
user-space provides an ID at endpoint creation time, try to use it. If
already in use, endpoint creation fails. Otherwise pick the first ID
available after the highest currently in use, with wrap-around.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/pm_netlink.c