[Cake] codel in ebpf?

Dave Taht dave.taht at gmail.com
Thu Aug 2 20:22:43 EDT 2018


On Thu, Aug 2, 2018 at 1:04 PM Toke Høiland-Jørgensen <toke at toke.dk> wrote:
>
> Dave Taht <dave.taht at gmail.com> writes:
>
> > On Wed, Aug 1, 2018 at 10:25 AM Dave Taht <dave.taht at gmail.com> wrote:
> >>
> >> I wonder if ebpf has opcode space for an invsqrt?
> >
> > bpf_ktime_get_ns() exists...
> >
> > one thing that I don't know if bpf can do is read/write the
> > skb->tstamp field. The plan would be to rigorously write it (if not
> > supplied by hw) on all ingress ports and check it on all egress ports.
>
> An XDP eBPF program (run at earliest possible ingress) has access to a
> buffer of arbitrary data that is attached to the skb and that can be
> read from later eBPF programs. So it doesn't need to muck with
> skb->tstamp for this.

It does? All I see is maps. If you clone or otherwise split the
packet, what happens?

> > That said, every time I've tried to do something in ebpf I hit a
> > limitation I'd not thunk of yet.
>
> Yeah, the whole XDP/eBPF system is somewhat of a work in progress ;)
>
> > For example, where can you attach the egress filter?
> >
> > My thought would be to use a bfifo > bpf -> bql, but from what little
> > I understand, it's bpf -> bfifo -> bql
>
> Yeah, it is. Don't think there's a way to run an eBPF program after the
> qdisc...

Well, it seems possible to move this typical part of an ebpf specific qdisc
from ingress to egress. Gawd knows what that would break, but, essentially....

      filter = rcu_dereference_bh(q->filter_list);

retry: skb = dequeue();

     ...
      if(filter) {
         *qerr = NET_XMIT_SUCCESS | __NET_XMIT_BYPASS;
        result = tcf_classify(skb, filter, &res, false);
        switch (result) {
              case TC_ACT_SHOT: clean up stuff; goto retry;
        }
...


> -Toke



-- 

Dave Täht
CEO, TekLibre, LLC
http://www.teklibre.com
Tel: 1-669-226-2619


More information about the Cake mailing list