From: David Ahern <dsahern@gmail.com>
To: Daniel Borkmann <daniel@iogearbox.net>,
netdev@vger.kernel.org, borkmann@iogearbox.net, ast@kernel.org
Cc: davem@davemloft.net, shm@cumulusnetworks.com,
roopa@cumulusnetworks.com, brouer@redhat.com, toke@toke.dk,
john.fastabend@gmail.com
Subject: Re: [bpf-next v1 8/9] bpf: Provide helper to do lookups in kernel FIB table
Date: Thu, 3 May 2018 18:47:39 -0600 [thread overview]
Message-ID: <48fc7c60-c31e-65c6-758f-21fd9f15330c@gmail.com> (raw)
In-Reply-To: <df3ac0c5-de3c-f47d-2d8b-1b3b42a51187@iogearbox.net>
On 5/3/18 6:45 PM, Daniel Borkmann wrote:
>> + .ret_type = RET_INTEGER,
>> + .arg1_type = ARG_PTR_TO_CTX,
>> + .arg2_type = ARG_PTR_TO_MEM,
>> + .arg3_type = ARG_CONST_SIZE,
>> + .arg4_type = ARG_ANYTHING,
>> +};
>> +
>> +BPF_CALL_4(bpf_skb_fib_lookup, struct sk_buff *, skb,
>> + struct bpf_fib_lookup *, params, int, plen, u32, flags)
>> +{
>> + if (plen < sizeof(*params))
>> + return -EINVAL;
>> +
>> + switch (params->family) {
>> +#if IS_ENABLED(CONFIG_INET)
>> + case AF_INET:
>> + return bpf_ipv4_fib_lookup(dev_net(skb->dev), params, flags);
>> +#endif
>> +#if IS_ENABLED(CONFIG_IPV6)
>> + case AF_INET6:
>> + return bpf_ipv6_fib_lookup(dev_net(skb->dev), params, flags);
>> +#endif
>> + }
>> + return -ENOTSUPP;
>> +}
>> +
>> +static const struct bpf_func_proto bpf_skb_fib_lookup_proto = {
>> + .func = bpf_skb_fib_lookup,
>> + .gpl_only = true,
>> + .pkt_access = true,
>
> ... this should both not be marked as pkt_access = true. What this means is that
> arg2, which is the struct bpf_fib_lookup, could come from the raw packet buffer.
leftover from the first version which did pass in the packet. Will remove.
next prev parent reply other threads:[~2018-05-04 0:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-03 3:53 [bpf-next v1 0/9] bpf: Add helper to do FIB lookups David Ahern
2018-05-03 3:53 ` [bpf-next v1 1/9] net/ipv6: Rename fib6_lookup to fib6_node_lookup David Ahern
2018-05-03 3:53 ` [bpf-next v1 2/9] net/ipv6: Rename rt6_multipath_select David Ahern
2018-05-03 3:53 ` [bpf-next v1 3/9] net/ipv6: Extract table lookup from ip6_pol_route David Ahern
2018-05-03 3:53 ` [bpf-next v1 4/9] net/ipv6: Refactor fib6_rule_action David Ahern
2018-05-03 3:53 ` [bpf-next v1 5/9] net/ipv6: Add fib6_lookup David Ahern
2018-05-03 3:53 ` [bpf-next v1 6/9] net/ipv6: Update fib6 tracepoint to take fib6_info David Ahern
2018-05-03 3:53 ` [bpf-next v1 7/9] net/ipv6: Add fib lookup stubs for use in bpf helper David Ahern
2018-05-03 3:53 ` [bpf-next v1 8/9] bpf: Provide helper to do lookups in kernel FIB table David Ahern
2018-05-04 0:45 ` Daniel Borkmann
2018-05-04 0:47 ` David Ahern [this message]
2018-05-03 3:53 ` [bpf-next v1 9/9] samples/bpf: Add example of ipv4 and ipv6 forwarding in XDP David Ahern
2018-05-08 5:33 ` [lkp-robot] [samples/bpf] a0bad08afa: kernel_selftests.test_tcpbpf_user.fail kernel test robot
2018-05-03 15:40 ` [bpf-next v1 0/9] bpf: Add helper to do FIB lookups David Miller
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=48fc7c60-c31e-65c6-758f-21fd9f15330c@gmail.com \
--to=dsahern@gmail.com \
--cc=ast@kernel.org \
--cc=borkmann@iogearbox.net \
--cc=brouer@redhat.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=john.fastabend@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=roopa@cumulusnetworks.com \
--cc=shm@cumulusnetworks.com \
--cc=toke@toke.dk \
/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).