Skip to content

Commit 850288c

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 7e56e83 commit 850288c

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
@@ -297,23 +297,6 @@ bpf_iter_mptcp_subflow_destroy(struct bpf_iter_mptcp_subflow *it)
297297
{
298298
}
299299

300-
__bpf_kfunc static struct
301-
mptcp_sock *bpf_mptcp_sock_acquire(struct mptcp_sock *msk)
302-
{
303-
struct sock *sk = (struct sock *)msk;
304-
305-
if (sk && refcount_inc_not_zero(&sk->sk_refcnt))
306-
return msk;
307-
return NULL;
308-
}
309-
310-
__bpf_kfunc static void bpf_mptcp_sock_release(struct mptcp_sock *msk)
311-
{
312-
struct sock *sk = (struct sock *)msk;
313-
314-
WARN_ON_ONCE(!sk || !refcount_dec_not_one(&sk->sk_refcnt));
315-
}
316-
317300
__bpf_kfunc struct mptcp_subflow_context *
318301
bpf_mptcp_subflow_ctx_by_pos(const struct mptcp_sched_data *data, unsigned int pos)
319302
{
@@ -334,8 +317,6 @@ BTF_ID_FLAGS(func, bpf_mptcp_subflow_ctx, KF_RET_NULL)
334317
BTF_ID_FLAGS(func, bpf_iter_mptcp_subflow_new, KF_ITER_NEW | KF_TRUSTED_ARGS)
335318
BTF_ID_FLAGS(func, bpf_iter_mptcp_subflow_next, KF_ITER_NEXT | KF_RET_NULL)
336319
BTF_ID_FLAGS(func, bpf_iter_mptcp_subflow_destroy, KF_ITER_DESTROY)
337-
BTF_ID_FLAGS(func, bpf_mptcp_sock_acquire, KF_ACQUIRE | KF_RET_NULL)
338-
BTF_ID_FLAGS(func, bpf_mptcp_sock_release, KF_RELEASE)
339320
BTF_KFUNCS_END(bpf_mptcp_common_kfunc_ids)
340321

341322
static const struct btf_kfunc_id_set bpf_mptcp_common_kfunc_set = {

0 commit comments

Comments
 (0)