Skip to content

Commit 9dd36d5

Browse files
matttbeintel-lab-lkp
authored andcommitted
mptcp: pm: code reorganisation
Before this patch, the PM code was dispersed in different places: - pm.c had common code for all PMs - pm_netlink.c was supposed to be about the in-kernel PM, but also had exported common helpers, callbacks used by the different PMs, NL events for PM userspace daemon, etc. quite confusing. - pm_userspace.c had userspace PM only code, but using specific in-kernel PM helpers To clarify the code, a reorganisation is suggested here, only by moving code around, and small helper renaming to avoid confusions: - pm_netlink.c now only contains common PM Netlink code: - PM events: this code was already there - shared helpers around Netlink code that were already there as well - shared Netlink commands code from pm.c - pm_kernel.c now contains only code that is specific to the in-kernel PM. Now all functions are either called from: - pm.c: events coming from the core, when this PM is being used - pm_netlink.c: for shared Netlink commands - mptcp_pm_gen.c: for Netlink commands specific to the in-kernel PM - sockopt.c: for the exported counters per netns - (while at it, two checkpatch warnings have been fixed: remove unneeded return, and the duplicated condition before a kfree()) - pm.c got many code from pm_netlink.c: - helpers used from both PMs and not linked to Netlink - callbacks used by different PMs, e.g. ADD_ADDR management - some helpers have been renamed to remove the '_nl' prefix, and they have been marked as 'static'. - protocol.h has been updated accordingly: - some helpers no longer need to be exported - new ones needed to be exported: they have been prefixed if needed. The code around the PM is now less confusing, which should help for the maintenance in the long term. This will certainly impact future backports, but because other cleanups have already done recently, and more are coming to ease the addition of a new path-manager controlled with BPF (struct_ops), doing that now seems to be a good time. Also, many issues around the PM have been fixed a few months ago while increasing the code coverage in the selftests, so such big reorganisation can be done with more confidence now. No behavioural changes intended. Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
1 parent 6207656 commit 9dd36d5

File tree

5 files changed

+2005
-2001
lines changed

5 files changed

+2005
-2001
lines changed

net/mptcp/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ obj-$(CONFIG_MPTCP) += mptcp.o
33

44
mptcp-y := protocol.o subflow.o options.o token.o crypto.o ctrl.o pm.o diag.o \
55
mib.o pm_netlink.o sockopt.o pm_userspace.o fastopen.o sched.o \
6-
mptcp_pm_gen.o
6+
mptcp_pm_gen.o pm_kernel.o
77

88
obj-$(CONFIG_SYN_COOKIES) += syncookies.o
99
obj-$(CONFIG_INET_MPTCP_DIAG) += mptcp_diag.o

0 commit comments

Comments
 (0)