lkml.org 
[lkml]   [2021]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH bpf-next 1/2] bpf: Add ifindex to bpf_sk_lookup
On Fri, Oct 15, 2021 at 4:24 AM Mark Pashmfouroush
<markpash@cloudflare.com> wrote:
>
> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
> index 6fc59d61937a..9bd3e8b8a659 100644
> --- a/include/uapi/linux/bpf.h
> +++ b/include/uapi/linux/bpf.h
> @@ -6262,6 +6262,7 @@ struct bpf_sk_lookup {
> __u32 local_ip4; /* Network byte order */
> __u32 local_ip6[4]; /* Network byte order */
> __u32 local_port; /* Host byte order */
> + __u32 ifindex; /* Maps to skb->dev->ifindex */

Is the comment accurate?
The bpf_sk_lookup_kern ifindex is populated with inet_iif(skb).
Which is skb->skb_iif at this point (I think).
skb->dev->ifindex would typically mean destination or egress ifindex.
In __sk_buff we have 'ifindex' and 'ingress_ifindex' to differentiate them.
If it's really dev->ifindex than keeping 'ifindex' name here would be correct,
but looking at how it's populated in inet/udp_lookup makes me wonder
whether it should be named 'ingress_ifindex' instead and comment clarified.

If/when you resubmit please trim cc list to a minimum.

\
 
 \ /
  Last update: 2021-10-21 03:41    [W:0.085 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site