diff mbox series

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

Message ID 9a923def3da410c97d08af04c42ca9863bd1f4db.1729676320.git.tanggeliang@kylinos.cn (mailing list archive)
State Superseded, archived
Headers show
Series use bpf_iter in bpf schedulers | expand

Checks

Context Check Description
matttbe/KVM_Validation__normal warning Unstable: 1 failed test(s): selftest_mptcp_join
matttbe/KVM_Validation__debug warning Unstable: 2 failed test(s): packetdrill_regressions selftest_mptcp_join
matttbe/KVM_Validation__btf-normal__only_bpftest_all_ success Success! ✅
matttbe/KVM_Validation__btf-debug__only_bpftest_all_ success Success! ✅
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

Commit Message

Geliang Tang Oct. 23, 2024, 9:40 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 has been implemented
in BPF specifically for use with BPF. To avoid compilation errors due
to duplicate names, this function has been made inline in kernel and
moved to 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)
 {