lkml.org 
[lkml]   [2022]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH for-next v4] cgroup/bpf: fast path skb BPF filtering
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.

Others lgtm.

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

\
 
 \ /
  Last update: 2022-01-26 21:33    [W:0.102 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site