mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Martin KaFai Lau <kafai@fb.com>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
	Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Song Liu <songliubraving@fb.com>,
	linux-kernel@vger.kernel.org, Stanislav Fomichev <sdf@google.com>
Subject: Re: [PATCH for-next v4] cgroup/bpf: fast path skb BPF filtering
Date: Wed, 26 Jan 2022 21:28:46 +0000	[thread overview]
Message-ID: <fbc8acbe-4c12-9c68-0418-51e97457d30b@gmail.com> (raw)
In-Reply-To: <20220126203055.3xre2m276g2q2tkx@kafai-mbp.dhcp.thefacebook.com>

On 1/26/22 20:30, Martin KaFai Lau wrote:
> On Wed, Jan 26, 2022 at 12:22:13AM +0000, Pavel Begunkov wrote:
>>   #define BPF_CGROUP_RUN_PROG_INET_INGRESS(sk, skb)			      \
>>   ({									      \
>>   	int __ret = 0;							      \
>> -	if (cgroup_bpf_enabled(CGROUP_INET_INGRESS))		      \
>> +	if (cgroup_bpf_enabled(CGROUP_INET_INGRESS) && sk &&		      \
>  From reading sk_filter_trim_cap() where this will be called, sk cannot be NULL.
> If yes, the new sk test is not needed.

Well, there is no sane way to verify how it's used considering

EXPORT_SYMBOL(__cgroup_bpf_run_filter_skb);

but can remove the check if nobody cares


> Others lgtm.
> 
>> +	    cgroup_bpf_sock_enabled(sk, CGROUP_INET_INGRESS)) 	      \
>>   		__ret = __cgroup_bpf_run_filter_skb(sk, skb,		      \
>>   						    CGROUP_INET_INGRESS); \
>>   									      \

-- 
Pavel Begunkov

  reply	other threads:[~2022-01-26 21:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26  0:22 Pavel Begunkov
2022-01-26  0:28 ` Stanislav Fomichev
2022-01-26 20:30 ` Martin KaFai Lau
2022-01-26 21:28   ` Pavel Begunkov [this message]
2022-01-27  5:08     ` Alexei Starovoitov
2022-01-27  7:01       ` Martin KaFai Lau
2022-01-27 13:53       ` Pavel Begunkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fbc8acbe-4c12-9c68-0418-51e97457d30b@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=kafai@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sdf@google.com \
    --cc=songliubraving@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®