Re: [PATCH bpf-next 1/2] bpf: Add ifindex to bpf_sk_lookup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 15, 2021 at 4:24 AM Mark Pashmfouroush
<markpash@xxxxxxxxxxxxxx> 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.



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux