Message ID | e6a318f2f4a2d91a3938ec3bfdf1ae1cf2098ebf.1667897099.git.geliang.tang@suse.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
Series | BPF redundant scheduler | expand |
Context | Check | Description |
---|---|---|
matttbe/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 22 lines checked |
matttbe/build | warning | Build error with: make C=1 net/mptcp/sched.o |
matttbe/KVM_Validation__normal | success | Success! ✅ |
matttbe/KVM_Validation__debug | fail | Critical: 2 Call Trace(s) ❌ |
diff --git a/net/mptcp/sched.c b/net/mptcp/sched.c index d295b92a5789..5a910da1452b 100644 --- a/net/mptcp/sched.c +++ b/net/mptcp/sched.c @@ -93,3 +93,22 @@ void mptcp_subflow_set_scheduled(struct mptcp_subflow_context *subflow, { WRITE_ONCE(subflow->scheduled, scheduled); } + +void mptcp_sched_data_set_contexts(const struct mptcp_sock *msk, + struct mptcp_sched_data *data) +{ + struct mptcp_subflow_context *subflow; + int i = 0; + + mptcp_for_each_subflow(msk, subflow) { + if (i == MPTCP_SUBFLOWS_MAX) { + pr_warn_once("too many subflows"); + break; + } + mptcp_subflow_set_scheduled(subflow, false); + data->contexts[i++] = subflow; + } + + for (; i < MPTCP_SUBFLOWS_MAX; i++) + data->contexts[i] = NULL; +}
Add a new helper mptcp_sched_data_set_contexts() to set the subflow pointers array in struct mptcp_sched_data. It will be invoked by the BPF schedulers to export the subflow pointers to the BPF contexts. Signed-off-by: Geliang Tang <geliang.tang@suse.com> --- net/mptcp/sched.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)