diff mbox series

[mptcp-next,v9,02/13] mptcp: make mptcp_subflow_set_scheduled inline

Message ID e197d4a85b6670d1ea1d9661709449cd4ac3a864.1730268415.git.tanggeliang@kylinos.cn (mailing list archive)
State Changes Requested
Headers show
Series use bpf_iter in bpf schedulers | expand

Checks

Context Check Description
matttbe/checkpatch success total: 0 errors, 0 warnings, 0 checks, 32 lines checked
matttbe/shellcheck success MPTCP selftests files have not been modified
matttbe/build success Build and static analysis OK
matttbe/KVM_Validation__normal success Success! ✅
matttbe/KVM_Validation__debug success Success! ✅
matttbe/KVM_Validation__btf-normal__only_bpftest_all_ success Success! ✅
matttbe/KVM_Validation__btf-debug__only_bpftest_all_ success Success! ✅

Commit Message

Geliang Tang Oct. 30, 2024, 6:10 a.m. UTC
From: Geliang Tang <tanggeliang@kylinos.cn>

Now mptcp_subflow_set_scheduled() is no longer used in BPF, but only in
kernel. A new mptcp_subflow_set_scheduled() helper will be implemented
in BPF specifically for use with BPF. To avoid compilation errors due
to duplicate names, this function is made inline in kernel and moved into
protocol.h.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
 net/mptcp/protocol.h | 9 +++++++--
 net/mptcp/sched.c    | 6 ------
 2 files changed, 7 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index b4c72a73594f..ab4e88b40efc 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -750,13 +750,18 @@  void mptcp_sched_init(void);
 int mptcp_init_sched(struct mptcp_sock *msk,
 		     struct mptcp_sched_ops *sched);
 void mptcp_release_sched(struct mptcp_sock *msk);
-void mptcp_subflow_set_scheduled(struct mptcp_subflow_context *subflow,
-				 bool scheduled);
 struct sock *mptcp_subflow_get_send(struct mptcp_sock *msk);
 struct sock *mptcp_subflow_get_retrans(struct mptcp_sock *msk);
 int mptcp_sched_get_send(struct mptcp_sock *msk);
 int mptcp_sched_get_retrans(struct mptcp_sock *msk);
 
+static inline void
+mptcp_subflow_set_scheduled(struct mptcp_subflow_context *subflow,
+			    bool scheduled)
+{
+	WRITE_ONCE(subflow->scheduled, scheduled);
+}
+
 static inline u64 mptcp_data_avail(const struct mptcp_sock *msk)
 {
 	return READ_ONCE(msk->bytes_received) - READ_ONCE(msk->bytes_consumed);
diff --git a/net/mptcp/sched.c b/net/mptcp/sched.c
index 6da60e35932f..73a24b9c96ff 100644
--- a/net/mptcp/sched.c
+++ b/net/mptcp/sched.c
@@ -135,12 +135,6 @@  void mptcp_release_sched(struct mptcp_sock *msk)
 	bpf_module_put(sched, sched->owner);
 }
 
-void mptcp_subflow_set_scheduled(struct mptcp_subflow_context *subflow,
-				 bool scheduled)
-{
-	WRITE_ONCE(subflow->scheduled, scheduled);
-}
-
 static void mptcp_sched_data_set_contexts(const struct mptcp_sock *msk,
 					  struct mptcp_sched_data *data)
 {