Skip to content

Commit

Permalink
Revert "mptcp: add sched_data helpers"
Browse files Browse the repository at this point in the history
Drop this patch. bpf_mptcp_subflow_ctx_by_pos and
mptcp_sched_data_set_contexts are uesless now.

Signed-off-by: Geliang Tang <[email protected]>
  • Loading branch information
Geliang Tang authored and intel-lab-lkp committed Dec 10, 2024
1 parent ae752e4 commit 0d13450
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 32 deletions.
8 changes: 0 additions & 8 deletions net/mptcp/bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,6 @@ __bpf_kfunc static void bpf_mptcp_sock_release(struct mptcp_sock *msk)
WARN_ON_ONCE(!sk || !refcount_dec_not_one(&sk->sk_refcnt));
}

__bpf_kfunc struct mptcp_subflow_context *
bpf_mptcp_subflow_ctx_by_pos(const struct mptcp_sched_data *data, unsigned int pos)
{
if (pos >= MPTCP_SUBFLOWS_MAX)
return NULL;
return data->contexts[pos];
}

__bpf_kfunc static bool bpf_mptcp_subflow_queues_empty(struct sock *sk)
{
return tcp_rtx_queue_empty(sk);
Expand Down
2 changes: 0 additions & 2 deletions net/mptcp/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,6 @@ void mptcp_subflow_queue_clean(struct sock *sk, struct sock *ssk);
void mptcp_sock_graft(struct sock *sk, struct socket *parent);
u64 mptcp_wnd_end(const struct mptcp_sock *msk);
void mptcp_set_timeout(struct sock *sk);
struct mptcp_subflow_context *
bpf_mptcp_subflow_ctx_by_pos(const struct mptcp_sched_data *data, unsigned int pos);
struct sock *__mptcp_nmpc_sk(struct mptcp_sock *msk);
bool __mptcp_close(struct sock *sk, long timeout);
void mptcp_cancel_work(struct sock *sk);
Expand Down
22 changes: 0 additions & 22 deletions net/mptcp/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,26 +141,6 @@ void mptcp_subflow_set_scheduled(struct mptcp_subflow_context *subflow,
WRITE_ONCE(subflow->scheduled, scheduled);
}

static 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;
}
data->subflows = i;

for (; i < MPTCP_SUBFLOWS_MAX; i++)
data->contexts[i] = NULL;
}

int mptcp_sched_get_send(struct mptcp_sock *msk)
{
struct mptcp_subflow_context *subflow;
Expand All @@ -187,7 +167,6 @@ int mptcp_sched_get_send(struct mptcp_sock *msk)
data.reinject = false;
if (msk->sched == &mptcp_sched_default || !msk->sched)
return mptcp_sched_default_get_subflow(msk, &data);
mptcp_sched_data_set_contexts(msk, &data);
return msk->sched->get_subflow(msk, &data);
}

Expand All @@ -210,6 +189,5 @@ int mptcp_sched_get_retrans(struct mptcp_sock *msk)
data.reinject = true;
if (msk->sched == &mptcp_sched_default || !msk->sched)
return mptcp_sched_default_get_subflow(msk, &data);
mptcp_sched_data_set_contexts(msk, &data);
return msk->sched->get_subflow(msk, &data);
}

0 comments on commit 0d13450

Please sign in to comment.