Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-16 Thread Toke Høiland-Jørgensen
Daniel Borkmann writes: > On 4/16/21 12:22 AM, Andrii Nakryiko wrote: >> On Thu, Apr 15, 2021 at 3:10 PM Daniel Borkmann wrote: >>> On 4/15/21 1:58 AM, Andrii Nakryiko wrote: On Wed, Apr 14, 2021 at 4:32 PM Daniel Borkmann wrote: > On 4/15/21 1:19 AM, Andrii Nakryiko wrote: >

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-15 Thread Daniel Borkmann
On 4/16/21 12:22 AM, Andrii Nakryiko wrote: On Thu, Apr 15, 2021 at 3:10 PM Daniel Borkmann wrote: On 4/15/21 1:58 AM, Andrii Nakryiko wrote: On Wed, Apr 14, 2021 at 4:32 PM Daniel Borkmann wrote: On 4/15/21 1:19 AM, Andrii Nakryiko wrote: On Wed, Apr 14, 2021 at 3:51 PM Toke Høiland-Jørgen

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-15 Thread Andrii Nakryiko
On Thu, Apr 15, 2021 at 3:10 PM Daniel Borkmann wrote: > > On 4/15/21 1:58 AM, Andrii Nakryiko wrote: > > On Wed, Apr 14, 2021 at 4:32 PM Daniel Borkmann > > wrote: > >> On 4/15/21 1:19 AM, Andrii Nakryiko wrote: > >>> On Wed, Apr 14, 2021 at 3:51 PM Toke Høiland-Jørgensen > >>> wrote: >

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-15 Thread Daniel Borkmann
On 4/15/21 1:58 AM, Andrii Nakryiko wrote: On Wed, Apr 14, 2021 at 4:32 PM Daniel Borkmann wrote: On 4/15/21 1:19 AM, Andrii Nakryiko wrote: On Wed, Apr 14, 2021 at 3:51 PM Toke Høiland-Jørgensen wrote: Andrii Nakryiko writes: On Wed, Apr 14, 2021 at 3:58 AM Toke Høiland-Jørgensen wrote:

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-15 Thread Andrii Nakryiko
On Thu, Apr 15, 2021 at 8:57 AM Toke Høiland-Jørgensen wrote: > > Andrii Nakryiko writes: > > > On Wed, Apr 14, 2021 at 3:51 PM Toke Høiland-Jørgensen > > wrote: > >> > >> Andrii Nakryiko writes: > >> > >> > On Wed, Apr 14, 2021 at 3:58 AM Toke Høiland-Jørgensen > >> > wrote: > >> >> > >> >>

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-15 Thread Toke Høiland-Jørgensen
Andrii Nakryiko writes: > On Wed, Apr 14, 2021 at 3:51 PM Toke Høiland-Jørgensen > wrote: >> >> Andrii Nakryiko writes: >> >> > On Wed, Apr 14, 2021 at 3:58 AM Toke Høiland-Jørgensen >> > wrote: >> >> >> >> Andrii Nakryiko writes: >> >> >> >> > On Tue, Apr 6, 2021 at 3:06 AM Toke Høiland-Jø

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-14 Thread Andrii Nakryiko
On Wed, Apr 14, 2021 at 4:32 PM Daniel Borkmann wrote: > > On 4/15/21 1:19 AM, Andrii Nakryiko wrote: > > On Wed, Apr 14, 2021 at 3:51 PM Toke Høiland-Jørgensen > > wrote: > >> Andrii Nakryiko writes: > >>> On Wed, Apr 14, 2021 at 3:58 AM Toke Høiland-Jørgensen > >>> wrote: > Andrii Nakr

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-14 Thread Daniel Borkmann
On 4/15/21 1:19 AM, Andrii Nakryiko wrote: On Wed, Apr 14, 2021 at 3:51 PM Toke Høiland-Jørgensen wrote: Andrii Nakryiko writes: On Wed, Apr 14, 2021 at 3:58 AM Toke Høiland-Jørgensen wrote: Andrii Nakryiko writes: On Tue, Apr 6, 2021 at 3:06 AM Toke Høiland-Jørgensen wrote: Andrii Nakr

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-14 Thread Andrii Nakryiko
On Wed, Apr 14, 2021 at 3:51 PM Toke Høiland-Jørgensen wrote: > > Andrii Nakryiko writes: > > > On Wed, Apr 14, 2021 at 3:58 AM Toke Høiland-Jørgensen > > wrote: > >> > >> Andrii Nakryiko writes: > >> > >> > On Tue, Apr 6, 2021 at 3:06 AM Toke Høiland-Jørgensen > >> > wrote: > >> >> > >> >>

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-14 Thread Toke Høiland-Jørgensen
Andrii Nakryiko writes: > On Wed, Apr 14, 2021 at 3:58 AM Toke Høiland-Jørgensen > wrote: >> >> Andrii Nakryiko writes: >> >> > On Tue, Apr 6, 2021 at 3:06 AM Toke Høiland-Jørgensen >> > wrote: >> >> >> >> Andrii Nakryiko writes: >> >> >> >> > On Sat, Apr 3, 2021 at 10:47 AM Alexei Starovoi

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-14 Thread Andrii Nakryiko
On Wed, Apr 14, 2021 at 3:58 AM Toke Høiland-Jørgensen wrote: > > Andrii Nakryiko writes: > > > On Tue, Apr 6, 2021 at 3:06 AM Toke Høiland-Jørgensen > > wrote: > >> > >> Andrii Nakryiko writes: > >> > >> > On Sat, Apr 3, 2021 at 10:47 AM Alexei Starovoitov > >> > wrote: > >> >> > >> >> On Sa

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-14 Thread Toke Høiland-Jørgensen
Andrii Nakryiko writes: > On Tue, Apr 6, 2021 at 3:06 AM Toke Høiland-Jørgensen wrote: >> >> Andrii Nakryiko writes: >> >> > On Sat, Apr 3, 2021 at 10:47 AM Alexei Starovoitov >> > wrote: >> >> >> >> On Sat, Apr 03, 2021 at 12:38:06AM +0530, Kumar Kartikeya Dwivedi wrote: >> >> > On Sat, Apr 0

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-13 Thread Andrii Nakryiko
On Tue, Apr 6, 2021 at 3:06 AM Toke Høiland-Jørgensen wrote: > > Andrii Nakryiko writes: > > > On Sat, Apr 3, 2021 at 10:47 AM Alexei Starovoitov > > wrote: > >> > >> On Sat, Apr 03, 2021 at 12:38:06AM +0530, Kumar Kartikeya Dwivedi wrote: > >> > On Sat, Apr 03, 2021 at 12:02:14AM IST, Alexei St

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-06 Thread Kumar Kartikeya Dwivedi
On Mon, Apr 05, 2021 at 10:51:09PM IST, Andrii Nakryiko wrote: > > [...] > > if _block variant is just a special ifindex value, then it should be > fine for users to know such a detail (we can leave a comment > mentioning this specifically), especially given it's not a very > popular thing. Almost

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-06 Thread Toke Høiland-Jørgensen
Andrii Nakryiko writes: > On Sat, Apr 3, 2021 at 10:47 AM Alexei Starovoitov > wrote: >> >> On Sat, Apr 03, 2021 at 12:38:06AM +0530, Kumar Kartikeya Dwivedi wrote: >> > On Sat, Apr 03, 2021 at 12:02:14AM IST, Alexei Starovoitov wrote: >> > > On Fri, Apr 2, 2021 at 8:27 AM Kumar Kartikeya Dwived

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-05 Thread Andrii Nakryiko
On Sat, Apr 3, 2021 at 10:47 AM Alexei Starovoitov wrote: > > On Sat, Apr 03, 2021 at 12:38:06AM +0530, Kumar Kartikeya Dwivedi wrote: > > On Sat, Apr 03, 2021 at 12:02:14AM IST, Alexei Starovoitov wrote: > > > On Fri, Apr 2, 2021 at 8:27 AM Kumar Kartikeya Dwivedi > > > wrote: > > > > [...] > >

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-05 Thread Andrii Nakryiko
On Fri, Apr 2, 2021 at 8:27 AM Kumar Kartikeya Dwivedi wrote: > > On Fri, Apr 02, 2021 at 05:49:29AM IST, Daniel Borkmann wrote: > > On 3/31/21 11:44 AM, Kumar Kartikeya Dwivedi wrote: > > > On Wed, Mar 31, 2021 at 02:55:47AM IST, Daniel Borkmann wrote: > > > > Do we even need the _block variant?

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-03 Thread Alexei Starovoitov
On Sat, Apr 03, 2021 at 12:38:06AM +0530, Kumar Kartikeya Dwivedi wrote: > On Sat, Apr 03, 2021 at 12:02:14AM IST, Alexei Starovoitov wrote: > > On Fri, Apr 2, 2021 at 8:27 AM Kumar Kartikeya Dwivedi > > wrote: > > > [...] > > > > All of these things are messy because of tc legacy. bpf tried to f

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-02 Thread Kumar Kartikeya Dwivedi
On Sat, Apr 03, 2021 at 12:02:14AM IST, Alexei Starovoitov wrote: > On Fri, Apr 2, 2021 at 8:27 AM Kumar Kartikeya Dwivedi > wrote: > > [...] > > All of these things are messy because of tc legacy. bpf tried to follow tc > style > with cls and act distinction and it didn't quite work. cls with >

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-02 Thread Alexei Starovoitov
On Fri, Apr 2, 2021 at 8:27 AM Kumar Kartikeya Dwivedi wrote: > > This would be fine, because it's not a fast path or anything, but right now we > return the id using the netlink response, otherwise for query we have to open > the socket, prepare the msg, send and recv again. So it's a minor > op

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-02 Thread Kumar Kartikeya Dwivedi
On Fri, Apr 02, 2021 at 05:49:29AM IST, Daniel Borkmann wrote: > On 3/31/21 11:44 AM, Kumar Kartikeya Dwivedi wrote: > > On Wed, Mar 31, 2021 at 02:55:47AM IST, Daniel Borkmann wrote: > > > Do we even need the _block variant? I would rather prefer to take the > > > chance > > > and make it as simp

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-01 Thread Daniel Borkmann
On 3/31/21 11:44 AM, Kumar Kartikeya Dwivedi wrote: On Wed, Mar 31, 2021 at 02:55:47AM IST, Daniel Borkmann wrote: Do we even need the _block variant? I would rather prefer to take the chance and make it as simple as possible, and only iff really needed extend with other APIs, for example: The

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-03-31 Thread Toke Høiland-Jørgensen
Daniel Borkmann writes: > On 3/30/21 10:39 PM, Andrii Nakryiko wrote: >> On Sun, Mar 28, 2021 at 1:11 AM Kumar Kartikeya Dwivedi >> wrote: >>> On Sun, Mar 28, 2021 at 10:12:40AM IST, Andrii Nakryiko wrote: Is there some succinct but complete enough documentation/tutorial/etc that I can

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-03-31 Thread Kumar Kartikeya Dwivedi
On Wed, Mar 31, 2021 at 02:55:47AM IST, Daniel Borkmann wrote: > Do we even need the _block variant? I would rather prefer to take the chance > and make it as simple as possible, and only iff really needed extend with > other APIs, for example: The block variant can be dropped, I'll use the TC_BLO

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-03-31 Thread Kumar Kartikeya Dwivedi
On Wed, Mar 31, 2021 at 02:41:40AM IST, Toke Høiland-Jørgensen wrote: > Andrii Nakryiko writes: > > > On Sun, Mar 28, 2021 at 1:11 AM Kumar Kartikeya Dwivedi > > wrote: > >> > >> On Sun, Mar 28, 2021 at 10:12:40AM IST, Andrii Nakryiko wrote: > >> > Is there some succinct but complete enough docum

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-03-30 Thread Alexei Starovoitov
On Tue, Mar 30, 2021 at 2:26 PM Daniel Borkmann wrote: > > On 3/30/21 10:39 PM, Andrii Nakryiko wrote: > > On Sun, Mar 28, 2021 at 1:11 AM Kumar Kartikeya Dwivedi > > wrote: > >> On Sun, Mar 28, 2021 at 10:12:40AM IST, Andrii Nakryiko wrote: > >>> Is there some succinct but complete enough docume

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-03-30 Thread Daniel Borkmann
On 3/30/21 10:39 PM, Andrii Nakryiko wrote: On Sun, Mar 28, 2021 at 1:11 AM Kumar Kartikeya Dwivedi wrote: On Sun, Mar 28, 2021 at 10:12:40AM IST, Andrii Nakryiko wrote: Is there some succinct but complete enough documentation/tutorial/etc that I can reasonably read to understand kernel APIs p

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-03-30 Thread Toke Høiland-Jørgensen
Andrii Nakryiko writes: > On Sun, Mar 28, 2021 at 1:11 AM Kumar Kartikeya Dwivedi > wrote: >> >> On Sun, Mar 28, 2021 at 10:12:40AM IST, Andrii Nakryiko wrote: >> > Is there some succinct but complete enough documentation/tutorial/etc >> > that I can reasonably read to understand kernel APIs pro

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-03-30 Thread Andrii Nakryiko
On Sun, Mar 28, 2021 at 1:11 AM Kumar Kartikeya Dwivedi wrote: > > On Sun, Mar 28, 2021 at 10:12:40AM IST, Andrii Nakryiko wrote: > > Is there some succinct but complete enough documentation/tutorial/etc > > that I can reasonably read to understand kernel APIs provided by TC > > (w.r.t. BPF, of co

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-03-29 Thread Vlad Buslov
On Mon 29 Mar 2021 at 15:32, Toke Høiland-Jørgensen wrote: > Vlad Buslov writes: > >> On Thu 25 Mar 2021 at 14:00, Kumar Kartikeya Dwivedi >> wrote: >>> This adds functions that wrap the netlink API used for adding, >>> manipulating, and removing filters and actions. These functions operate >

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-03-29 Thread Toke Høiland-Jørgensen
Vlad Buslov writes: > On Thu 25 Mar 2021 at 14:00, Kumar Kartikeya Dwivedi wrote: >> This adds functions that wrap the netlink API used for adding, >> manipulating, and removing filters and actions. These functions operate >> directly on the loaded prog's fd, and return a handle to the filter an

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-03-29 Thread Vlad Buslov
On Thu 25 Mar 2021 at 14:00, Kumar Kartikeya Dwivedi wrote: > This adds functions that wrap the netlink API used for adding, > manipulating, and removing filters and actions. These functions operate > directly on the loaded prog's fd, and return a handle to the filter and > action using an out p

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-03-28 Thread Kumar Kartikeya Dwivedi
On Sun, Mar 28, 2021 at 10:12:40AM IST, Andrii Nakryiko wrote: > Is there some succinct but complete enough documentation/tutorial/etc > that I can reasonably read to understand kernel APIs provided by TC > (w.r.t. BPF, of course). I'm trying to wrap my head around this and > whether API makes sens

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-03-27 Thread Andrii Nakryiko
On Thu, Mar 25, 2021 at 5:02 AM Kumar Kartikeya Dwivedi wrote: > > This adds functions that wrap the netlink API used for adding, > manipulating, and removing filters and actions. These functions operate > directly on the loaded prog's fd, and return a handle to the filter and > action using an ou

[PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-03-25 Thread Kumar Kartikeya Dwivedi
This adds functions that wrap the netlink API used for adding, manipulating, and removing filters and actions. These functions operate directly on the loaded prog's fd, and return a handle to the filter and action using an out parameter (id for tc_cls, and index for tc_act). The basic featureset i