On Tue, Sep 20, 2016 at 4:09 PM, Thomas Graf <tg...@suug.ch> wrote:
> On 09/20/16 at 03:49pm, Tom Herbert wrote:
>> On Tue, Sep 20, 2016 at 3:44 PM, Thomas Graf <tg...@suug.ch> wrote:
>> > On 09/20/16 at 03:00pm, Tom Herbert wrote:
>> >> +static inline int __xdp_hook_run(struct list_head *list_head,
>> >> +                              struct xdp_buff *xdp)
>> >> +{
>> >> +     struct xdp_hook_ops *elem;
>> >> +     int ret = XDP_PASS;
>> >> +
>> >> +     list_for_each_entry(elem, list_head, list) {
>> >> +             ret = elem->hook(elem->priv, xdp);
>> >> +             if (ret != XDP_PASS)
>> >> +                     break;
>> >> +     }
>> >
>> > Walking over a linear list? Really? :-) I thought this was supposed
>> > to be fast, no compromises made.
>>
>> Can you suggest an alternative?
>
> Single BPF program that encodes whatever logic is required. This is
> what BPF is for. If it absolutely has to run two programs in sequence
> then it can still do that even though I really don't see much of a
> point of doing that in a high performance environment.
>
> I'm not even sure yet I understand full purpose of this yet ;-)

This allows other use cases than BPF inserting code into the data
path. This gives XDP potential more utility and more users so that we
can motivate more driver implementations. For instance, I thinks it's
totally reasonable if the nftables guys want to insert some of their
rules to perform early DDOS drop to get the same performance that we
see in XDP.

Tom

Reply via email to