From: David Ahern <dsahern@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: John Fastabend <john.fastabend@gmail.com>,
"Md. Islam" <mislam4@kent.edu>,
netdev@vger.kernel.org, David Miller <davem@davemloft.net>,
stephen@networkplumber.org, agaceph@gmail.com,
Pavel Emelyanov <xemul@openvz.org>,
Eric Dumazet <edumazet@google.com>,
brouer@redhat.com
Subject: Re: [PATCH v15 ] net/veth/XDP: Line-rate packet forwarding in kernel
Date: Tue, 3 Apr 2018 19:09:09 -0600 [thread overview]
Message-ID: <8c697e49-30c5-2eca-5422-a87cef11b04c@gmail.com> (raw)
In-Reply-To: <20180403173701.t35u2p4qkgyqkr32@ast-mbp.dhcp.thefacebook.com>
On 4/3/18 11:37 AM, Alexei Starovoitov wrote:
> On Tue, Apr 03, 2018 at 11:14:00AM -0600, David Ahern wrote:
>> On 4/3/18 11:06 AM, Alexei Starovoitov wrote:
>>>> For 3 and 4 above I was referring to the route lookup part of it; sorry
>>>> for not being clear.
>>>>
>>>> For example, eth1 is enslaved to bond1 which is in VRF red. The lookup
>>>> needs to go to the table associated with the VRF. That is not known by
>>>> just looking at eth1. The code exists to walk the upper layers and do
>>>> the effective translations, just need to cover those cases.
>>>>
>>>> The VLAN part of it is a bit more difficult - ingress device for the
>>>> lookup should be eth1.100 for example not eth1, and then if eth1.100 is
>>>> enslaved to a VRF, ...
>>>>
>>>> None of it is that complex, just need to walk through the various use
>>>> cases and make sure bpf_ipv4_fwd_lookup and bpf_ipv6_fwd_lookup can do
>>>> the right thing for these common use cases.
>>> I'm a bit lost here. Why this is a concern?
>>> 'index' as argument that bpf prog is passing into the helper.
>>> The clsbpf program may choose to pass ifindex of the netdev
>>> it's attached to or some other one.
>>> In your patch you have:
>>> +BPF_CALL_3(bpf_ipv4_fwd_lookup, int, index, const struct iphdr *, iph,
>>> + struct ethhdr *, eth)
>>> +{
>>> + struct flowi4 fl4 = {
>>> + .daddr = iph->daddr,
>>> + .saddr = iph->saddr,
>>> + .flowi4_iif = index,
>>> + .flowi4_tos = iph->tos & IPTOS_RT_MASK,
>>> + .flowi4_scope = RT_SCOPE_UNIVERSE,
>>> + };
>>>
>>> As you saying there is concern with .flowi4_iif = index line ?
>>
>> yes. BPF / XDP programs are installed on the bottom device ... e.g.,
>> eth1. The L3 lookup is not necessarily done on that device index.
>
> right, but I still don't see any problem with this helper and vlans.
> If xdp program passes incorrect ifindex, it's program's mistake.
> If clsbpf attached to vlan passed good ifindex, the lookup will
> happen in the correct scope, but even in this case the prog
> can pass whatever ifindex it wants.
>
I'll find some time update the bpf forwarding helpers and look at these
other cases in the next few weeks.
next prev parent reply other threads:[~2018-04-04 1:09 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-02 0:47 [PATCH v15 ] net/veth/XDP: Line-rate packet forwarding in kernel Md. Islam
2018-04-02 16:51 ` Stephen Hemminger
2018-04-02 18:03 ` John Fastabend
2018-04-02 18:09 ` David Ahern
2018-04-02 18:16 ` Alexei Starovoitov
2018-04-03 15:07 ` David Ahern
2018-04-03 16:41 ` John Fastabend
2018-04-03 16:45 ` David Miller
2018-04-03 17:00 ` David Ahern
2018-04-03 17:06 ` Alexei Starovoitov
2018-04-03 17:14 ` David Ahern
2018-04-03 17:37 ` Alexei Starovoitov
2018-04-04 1:09 ` David Ahern [this message]
2018-04-03 18:21 ` Jesper Dangaard Brouer
2018-04-04 1:16 ` David Ahern
2018-04-04 3:15 ` Md. Islam
2018-04-06 2:55 ` David Ahern
2018-04-10 4:27 ` Md. Islam
2018-04-04 6:16 ` Jesper Dangaard Brouer
2018-04-04 21:09 ` Md. Islam
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=8c697e49-30c5-2eca-5422-a87cef11b04c@gmail.com \
--to=dsahern@gmail.com \
--cc=agaceph@gmail.com \
--cc=alexei.starovoitov@gmail.com \
--cc=brouer@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=john.fastabend@gmail.com \
--cc=mislam4@kent.edu \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
--cc=xemul@openvz.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;
as well as URLs for NNTP newsgroup(s).