Skip to content

Commit 68ec9ba

Browse files
Geliang Tangintel-lab-lkp
authored andcommitted
Revert "bpf: Acquire and release mptcp socket"
Drop this patch as Martin suggested. From Martin's review [1], this mptcp_sock_acquire() helper was a workaround only to please the verifier, but they were not needed. [1] https://lore.kernel.org/[email protected] Signed-off-by: Geliang Tang <[email protected]>
1 parent d3ce822 commit 68ec9ba

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

net/mptcp/bpf.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -274,23 +274,6 @@ bpf_iter_mptcp_subflow_destroy(struct bpf_iter_mptcp_subflow *it)
274274
{
275275
}
276276

277-
__bpf_kfunc static struct
278-
mptcp_sock *bpf_mptcp_sock_acquire(struct mptcp_sock *msk)
279-
{
280-
struct sock *sk = (struct sock *)msk;
281-
282-
if (sk && refcount_inc_not_zero(&sk->sk_refcnt))
283-
return msk;
284-
return NULL;
285-
}
286-
287-
__bpf_kfunc static void bpf_mptcp_sock_release(struct mptcp_sock *msk)
288-
{
289-
struct sock *sk = (struct sock *)msk;
290-
291-
WARN_ON_ONCE(!sk || !refcount_dec_not_one(&sk->sk_refcnt));
292-
}
293-
294277
__bpf_kfunc struct mptcp_subflow_context *
295278
bpf_mptcp_subflow_ctx_by_pos(const struct mptcp_sched_data *data, unsigned int pos)
296279
{
@@ -311,8 +294,6 @@ BTF_ID_FLAGS(func, bpf_mptcp_subflow_ctx, KF_RET_NULL)
311294
BTF_ID_FLAGS(func, bpf_iter_mptcp_subflow_new, KF_ITER_NEW | KF_TRUSTED_ARGS)
312295
BTF_ID_FLAGS(func, bpf_iter_mptcp_subflow_next, KF_ITER_NEXT | KF_RET_NULL)
313296
BTF_ID_FLAGS(func, bpf_iter_mptcp_subflow_destroy, KF_ITER_DESTROY)
314-
BTF_ID_FLAGS(func, bpf_mptcp_sock_acquire, KF_ACQUIRE | KF_RET_NULL)
315-
BTF_ID_FLAGS(func, bpf_mptcp_sock_release, KF_RELEASE)
316297
BTF_KFUNCS_END(bpf_mptcp_common_kfunc_ids)
317298

318299
static const struct btf_kfunc_id_set bpf_mptcp_common_kfunc_set = {

0 commit comments

Comments
 (0)