Re: [Cake] issue with Cake and bpf filter

2018-08-22 Thread Jonathan Morton
> On 22 Aug, 2018, at 12:06 am, Pete Heist wrote: > > when fq_codel is the qdisc, the eBPF action is only called "once in a while” One difference between fq_codel and Cake is that the former - which has no shaper - will "bypass" packets when it's empty and there's no back-pressure filling it.

Re: [Cake] 900mbit tbf + fq_codel vs cake on the apu2

2018-08-22 Thread Pete Heist
The APU hardware begs for smp support... > On Aug 4, 2018, at 11:31 PM, Dave Taht wrote: > > can't achieve full throughput. > > root@apu2:/etc/sqm# tc qdisc replace dev enp3s0 handle 10: root tbf > burst 64k rate 9 latency 60ms > root@apu2:/etc/sqm# tc qdisc add dev enp3s0 parent 10:0

Re: [Cake] [bpf-next RFC 2/3] flow_dissector: implements eBPF parser

2018-08-22 Thread Toke Høiland-Jørgensen
Pete Heist writes: > The eBPF verifier seems fragile to me, where I’d be moving lines of > code around and getting different error messages in an alien tongue. Well, it operates on the byte code and errs on the side of safety. I.e., if it can't prove your program is safe it is going to reject

Re: [Cake] [bpf-next RFC 2/3] flow_dissector: implements eBPF parser

2018-08-22 Thread Pete Heist
The eBPF verifier seems fragile to me, where I’d be moving lines of code around and getting different error messages in an alien tongue. I might need to move to some later code than what comes with Ubuntu 18.04. This example is helpful to have though, thanks... > On Aug 18, 2018, at 7:19 PM,

Re: [Cake] issue with Cake and bpf filter

2018-08-22 Thread Pete Heist
> On Aug 22, 2018, at 8:17 AM, Jonathan Morton wrote: > >> On 22 Aug, 2018, at 12:06 am, Pete Heist wrote: >> >> when fq_codel is the qdisc, the eBPF action is only called "once in a while” > > One difference between fq_codel and Cake is that the former - which has no > shaper - will

Re: [Cake] issue with Cake and bpf filter

2018-08-22 Thread Toke Høiland-Jørgensen
Pete Heist writes: >> On Aug 22, 2018, at 8:17 AM, Jonathan Morton wrote: >> >>> On 22 Aug, 2018, at 12:06 am, Pete Heist wrote: >>> >>> when fq_codel is the qdisc, the eBPF action is only called "once in a while” >> >> One difference between fq_codel and Cake is that the former - which >>

Re: [Cake] issue with Cake and bpf filter

2018-08-22 Thread Toke Høiland-Jørgensen
Pete Heist writes: >> On Aug 21, 2018, at 11:17 PM, Toke Høiland-Jørgensen wrote: >>> >>> Well that’s good timing for me as I’m wrapping up a small utility/eBPF >>> to classify an arbitrary username to either MAC or IP. Here’s the work >>> in progress, which is not done yet as flow fairness is

[Cake] [PATCH] sch_cake: Fix TC filter flow override and expand it to hosts as well

2018-08-22 Thread Toke Høiland-Jørgensen
The TC filter flow mapping override completely skipped the call to cake_hash(); however that meant that the internal state was not being updated, which ultimately leads to deadlocks in some configurations. Fix that by passing the overridden flow ID into cake_hash() instead so it can react

Re: [Cake] issue with Cake and bpf filter

2018-08-22 Thread Toke Høiland-Jørgensen
Jonathan Morton writes: >> On 22 Aug, 2018, at 12:51 pm, Pete Heist wrote: >> >> "math between pkt pointer and 4294901760 is not allowed" > > As a possible clue here, 4294901760 == (2^32) - (2^16). > > I suspect both errors are being caused by the call to memcpy(). This > potentially inlines a

Re: [Cake] [bpf-next RFC 2/3] flow_dissector: implements eBPF parser

2018-08-22 Thread Daniel Borkmann
On 08/22/2018 11:25 AM, Toke Høiland-Jørgensen wrote: > Pete Heist writes: > >> The eBPF verifier seems fragile to me, where I’d be moving lines of >> code around and getting different error messages in an alien tongue. > > Well, it operates on the byte code and errs on the side of safety.

Re: [Cake] [bpf-next RFC 2/3] flow_dissector: implements eBPF parser

2018-08-22 Thread Pete Heist
> On Aug 22, 2018, at 11:25 AM, Toke Høiland-Jørgensen wrote: > > Pete Heist writes: > >> The eBPF verifier seems fragile to me, where I’d be moving lines of >> code around and getting different error messages in an alien tongue. > > Well, it operates on the byte code and errs on the side of

Re: [Cake] issue with Cake and bpf filter

2018-08-22 Thread Toke Høiland-Jørgensen
Toke Høiland-Jørgensen writes: >>Lastly, if anyone has time to review even just a little code for what >>is or is not good or idiomatic C, post an issue and I’d appreciate it. >>Yes, I yield to the ‘goto’ proponents when it comes to error handling >>and resource de-allocation. :) > > I'll take a

Re: [Cake] issue with Cake and bpf filter

2018-08-22 Thread Pete Heist
> On Aug 22, 2018, at 11:37 AM, Toke Høiland-Jørgensen wrote: > > Pete Heist writes: > >>> On Aug 22, 2018, at 8:17 AM, Jonathan Morton wrote: >>> >>> One difference between fq_codel and Cake is that the former - which >>> has no shaper - will "bypass" packets when it's empty and there's

Re: [Cake] issue with Cake and bpf filter

2018-08-22 Thread Jonathan Morton
> On 22 Aug, 2018, at 12:51 pm, Pete Heist wrote: > > "math between pkt pointer and 4294901760 is not allowed" As a possible clue here, 4294901760 == (2^32) - (2^16). I suspect both errors are being caused by the call to memcpy(). This potentially inlines a substantial amount of code which

Re: [Cake] 900mbit tbf + fq_codel vs cake on the apu2

2018-08-22 Thread Pete Heist
> On Aug 22, 2018, at 5:10 PM, Dave Taht wrote: > > adding a basic shaper to fq_codel itself is kind of trivial. You need > to check if you are shaping > > this was 40% faster than tbf + fq_codel in the good ole days and I Aha, ok, I didn't there was that much to be gained in serial

Re: [Cake] 900mbit tbf + fq_codel vs cake on the apu2

2018-08-22 Thread Dave Taht
adding a basic shaper to fq_codel itself is kind of trivial. You need to check if you are shaping https://github.com/dtaht/sch_tart/blob/master/sch_tart.c#L329 Calculate the next start time: https://github.com/dtaht/sch_tart/blob/master/sch_tart.c#L392 and calc the rate in setup and init the

Re: [Cake] 900mbit tbf + fq_codel vs cake on the apu2

2018-08-22 Thread Dave Taht
On Wed, Aug 22, 2018 at 9:08 AM Pete Heist wrote: > > > > On Aug 22, 2018, at 5:10 PM, Dave Taht wrote: > > > > adding a basic shaper to fq_codel itself is kind of trivial. You need > > to check if you are shaping > > > > this was 40% faster than tbf + fq_codel in the good ole days and I > >

Re: [Cake] [bpf-next RFC 2/3] flow_dissector: implements eBPF parser

2018-08-22 Thread Pete Heist
> On Aug 22, 2018, at 12:41 PM, Daniel Borkmann wrote: > > On 08/22/2018 11:25 AM, Toke Høiland-Jørgensen wrote: >> Pete Heist writes: >> >> Well, it operates on the byte code and errs on the side of safety. I.e., >> if it can't prove your program is safe it is going to reject it. Which >>