From: John Fastabend <john.fastabend@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
Mark Pashmfouroush <markpash@cloudflare.com>
Cc: "Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Andrii Nakryiko" <andrii@kernel.org>,
"Martin KaFai Lau" <kafai@fb.com>,
"Song Liu" <songliubraving@fb.com>, "Yonghong Song" <yhs@fb.com>,
"John Fastabend" <john.fastabend@gmail.com>,
"KP Singh" <kpsingh@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
"Jakub Kicinski" <kuba@kernel.org>,
"Hideaki YOSHIFUJI" <yoshfuji@linux-ipv6.org>,
"David Ahern" <dsahern@kernel.org>,
"Shuah Khan" <shuah@kernel.org>,
"Florent Revest" <revest@chromium.org>,
"Brendan Jackman" <jackmanb@google.com>,
"Joe Stringer" <joe@cilium.io>,
"Jesper Dangaard Brouer" <brouer@redhat.com>,
"Hangbin Liu" <liuhangbin@gmail.com>,
"Toke Høiland-Jørgensen" <toke@redhat.com>,
"Lorenz Bauer" <lmb@cloudflare.com>,
"Dave Marchevsky" <davemarchevsky@fb.com>,
"Luke Nelson" <luke.r.nels@gmail.com>,
"Björn Töpel" <bjorn@kernel.org>,
"Network Development" <netdev@vger.kernel.org>,
bpf <bpf@vger.kernel.org>, LKML <linux-kernel@vger.kernel.org>,
"open list:KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@vger.kernel.org>
Subject: Re: [PATCH bpf-next 1/2] bpf: Add ifindex to bpf_sk_lookup
Date: Thu, 21 Oct 2021 12:07:52 -0700 [thread overview]
Message-ID: <6171ba88e5825_663a720836@john-XPS-13-9370.notmuch> (raw)
In-Reply-To: <CAADnVQ+_MysCNnaPZd550wQaohtWTikmgnsysoZhnNpwPgv23A@mail.gmail.com>
Alexei Starovoitov wrote:
> 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.
At least in the tcp cases its coming from inet_iif which is either
the rtable or skb->skb_iif. Agree would be nice to fixup the comment.
Thanks.
next prev parent reply other threads:[~2021-10-21 19:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-15 11:23 [PATCH bpf-next 0/2] Get ifindex in BPF_SK_LOOKUP prog type Mark Pashmfouroush
2021-10-15 11:23 ` [PATCH bpf-next 1/2] bpf: Add ifindex to bpf_sk_lookup Mark Pashmfouroush
2021-10-21 1:39 ` Alexei Starovoitov
2021-10-21 19:07 ` John Fastabend [this message]
2021-10-21 19:00 ` John Fastabend
2021-10-15 11:23 ` [PATCH bpf-next 2/2] selftests/bpf: Add tests for accessing ifindex in bpf_sk_lookup Mark Pashmfouroush
2021-10-21 19:09 ` John Fastabend
2021-10-15 14:17 ` [PATCH bpf-next 0/2] Get ifindex in BPF_SK_LOOKUP prog type Lorenz Bauer
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=6171ba88e5825_663a720836@john-XPS-13-9370.notmuch \
--to=john.fastabend@gmail.com \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=brouer@redhat.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=davemarchevsky@fb.com \
--cc=dsahern@kernel.org \
--cc=jackmanb@google.com \
--cc=joe@cilium.io \
--cc=kafai@fb.com \
--cc=kpsingh@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=liuhangbin@gmail.com \
--cc=lmb@cloudflare.com \
--cc=luke.r.nels@gmail.com \
--cc=markpash@cloudflare.com \
--cc=netdev@vger.kernel.org \
--cc=revest@chromium.org \
--cc=shuah@kernel.org \
--cc=songliubraving@fb.com \
--cc=toke@redhat.com \
--cc=yhs@fb.com \
--cc=yoshfuji@linux-ipv6.org \
/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