This adds some basic tests for the low level bpf_tc_* API.
Reviewed-by: Toke Høiland-Jørgensen
Signed-off-by: Kumar Kartikeya Dwivedi
---
.../selftests/bpf/prog_tests/test_tc_bpf.c| 169 ++
.../selftests/bpf/progs/test_tc_bpf_kern.c| 12 ++
2 files changed, 181
info);
if (r < 0)
return r;
... where id corresponds to the bpf_tc_attach_id filled in during an
attach operation.
Reviewed-by: Toke Høiland-Jørgensen
Signed-off-by: Kumar Kartikeya Dwivedi
---
tools/lib/bpf/libbpf.h | 44 ++
tools/lib/bpf/libbpf.map | 3 +
verts the open coded attribute preparation with the
helpers. Note that the only failure the internal call to nlattr_add
could result in the nested helper would be -EMSGSIZE, hence that is what
we return to our caller.
Reviewed-by: Toke Høiland-Jørgensen
Signed-off-by: Kumar Kartikeya Dwivedi
---
is already set up,
we skip the setup and move on with filter creation.
* Other minor changes that came up during the course of discussion and rework.
Kumar Kartikeya Dwivedi (3):
libbpf: add helpers for preparing netlink attributes
libbpf: add low level TC-BPF API
libbpf: add selftests fo
On Tue, Apr 20, 2021 at 02:30:44AM IST, Daniel Borkmann wrote:
> On 4/19/21 2:18 PM, Kumar Kartikeya Dwivedi wrote:
> > This adds functions that wrap the netlink API used for adding,
> > manipulating, and removing traffic control filters. These functions
> > operate directly
This adds some basic tests for the low level bpf_tc_cls_* API.
Reviewed-by: Toke Høiland-Jørgensen
Signed-off-by: Kumar Kartikeya Dwivedi
---
.../selftests/bpf/prog_tests/test_tc_bpf.c| 112 ++
.../selftests/bpf/progs/test_tc_bpf_kern.c| 12 ++
2 files changed, 124
if (r < 0)
return r;
assert(info.class_id == TC_H_MAKE(1UL << 16, 12));
This would be roughly equivalent to doing:
# tc filter change dev lo egress prio handle bpf obj foo.o sec \
classifier classid 1:12
... except a new bpf program will be loaded and
verts the open coded attribute preparation with the
helpers. Note that the only failure the internal call to nlattr_add
could result in the nested helper would be -EMSGSIZE, hence that is what
we return to our caller.
Reviewed-by: Toke Høiland-Jørgensen
Signed-off-by: Kumar Kartikeya Dwivedi
---
Update the header file so we can use the new defines in subsequent
patches. Also make sure they remain up to date.
Reviewed-by: Toke Høiland-Jørgensen
Signed-off-by: Kumar Kartikeya Dwivedi
---
tools/include/uapi/linux/pkt_cls.h | 174 -
tools/lib/bpf/Makefile
isc is already set up,
we skip the setup and move on with filter creation.
* Other minor changes that came up during the course of discussion and rework.
Kumar Kartikeya Dwivedi (4):
tools: pkt_cls.h: sync with kernel sources
libbpf: add helpers for preparing netlink attributes
libbpf: ad
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
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 did
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
> > >
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
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:
> >>
On Wed, Mar 31, 2021 at 10:10:45AM IST, Cong Wang wrote:
> On Mon, Mar 29, 2021 at 3:55 PM Kumar Kartikeya Dwivedi
> wrote:
> > diff --git a/net/sched/act_api.c b/net/sched/act_api.c
> > index b919826939e0..43cceb924976 100644
> > --- a/net/sched/act_api.c
>
reference counting action init")
Signed-off-by: Kumar Kartikeya Dwivedi
---
Changelog:
v2 -> v3
Cleanup new action on rollback after raising refcount (Cong)
v1 -> v2
Remove erroneous tcf_action_put_many call in tcf_exts_validate (Vlad)
Isolate refcount bump to ACT API in replace
On Mon, Mar 29, 2021 at 02:35:12PM IST, Vlad Buslov wrote:
> it seems that there are two ways actions are overwritten/deleted:
>
> 1. Directly through action API, which is still serialized by rtnl lock.
>
> 2. Classifier API, which doesn't use rtnl lock anymore and can execute
> concurrently.
>
> A
is no existing action, so no tcf_exts_destroy callback happens.
This means no code changes for CLS API.
Fixes: cae422f379f3 ("net: sched: use reference counting action init")
Signed-off-by: Kumar Kartikeya Dwivedi
---
Changelog:
v1 -> v2
Remove erroneous tcf_action_put_many call in
On Mon, Mar 29, 2021 at 06:56:02AM IST, Alexei Starovoitov wrote:
> This is up to you. I'm trying to understand the motivation for *_block() apis.
> I'm not taking a stance for/against them.
The block APIs simply attach to a different shared filter block, so in that
sense they just forward to the
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
ll to release the
reference held during insertion. This is only needed in replace mode.
We use a relaxed store as insert will ensure its visibility.
Fixes: cae422f379f3 ("net: sched: use reference counting action init")
Signed-off-by: Kumar Kartikeya Dwivedi
---
include/net/act_api.h |
On Sat, Mar 27, 2021 at 04:55:51AM IST, Andrii Nakryiko wrote:
> On Thu, Mar 25, 2021 at 5:01 AM Kumar Kartikeya Dwivedi
> wrote:
> >
> > Update the header file so we can use the new defines in subsequent
> > patches.
> >
> > Reviewed-by: Toke Høiland-Jørgensen
This adds some basic tests for the low level bpf_tc_* API and its
bpf_program__attach_tc_* wrapper on top.
Reviewed-by: Toke Høiland-Jørgensen
Signed-off-by: Kumar Kartikeya Dwivedi
---
.../selftests/bpf/prog_tests/test_tc_bpf.c| 261 ++
.../selftests/bpf/progs
LL(link))
return PTR_ERR(link);
bpf_link__destroy(link);
Reviewed-by: Toke Høiland-Jørgensen
Signed-off-by: Kumar Kartikeya Dwivedi
---
tools/lib/bpf/libbpf.c | 110 ++-
tools/lib/bpf/libbpf.h | 15 ++
tools/lib/bpf/libbpf.map |
on
tc action del action bpf index
Reviewed-by: Toke Høiland-Jørgensen
Signed-off-by: Kumar Kartikeya Dwivedi
---
tools/lib/bpf/libbpf.h | 118 +++
tools/lib/bpf/libbpf.map | 14 +
tools/lib/bpf/netlink.c | 715 ++-
3 files changed, 841 insertion
verts the open coded attribute preparation with the
helpers. Note that the only failure the internal call to add_nlattr
could result in the nested helper would be -EMSGSIZE, hence that is what
we return to our caller.
Reviewed-by: Toke Høiland-Jørgensen
Signed-off-by: Kumar Kartikeya Dwivedi
---
Update the header file so we can use the new defines in subsequent
patches.
Reviewed-by: Toke Høiland-Jørgensen
Signed-off-by: Kumar Kartikeya Dwivedi
---
tools/include/uapi/linux/pkt_cls.h | 174 -
1 file changed, 170 insertions(+), 4 deletions(-)
diff --git a
k__destroy, which will also cause
the filter/action to be detached if not disconnected.
The individual commits contain a general API summary and examples.
Kumar Kartikeya Dwivedi (5):
tools pkt_cls.h: sync with kernel sources
libbpf: add helpers for preparing netlink attributes
libbpf: add lo
Otherwise, there exists a small window between the opening and closing
of the socket fd where it may leak into processes launched by some other
thread.
Fixes: 949abbe88436 ("libbpf: add function to setup XDP")
Signed-off-by: Kumar Kartikeya Dwivedi
---
Changelog:
v1 -> v2
Tag the
Otherwise, there exists a small window between the opening and closing
of the socket fd where it may leak into processes launched by some other
thread.
Signed-off-by: Kumar Kartikeya Dwivedi
---
tools/lib/bpf/netlink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools
checkpatch warnings from:
5dbdb2d87c29 ("checkpatch: prefer strscpy to strlcpy")
Signed-off-by: Kumar Kartikeya Dwivedi
---
drivers/staging/qlge/qlge_ethtool.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/qlge/qlge_ethtool.c
b/drivers/st
Fixes checkpatch warnings for usage of strlcpy.
Signed-off-by: Kumar Kartikeya Dwivedi
---
drivers/staging/qlge/qlge_ethtool.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/qlge/qlge_ethtool.c
b/drivers/staging/qlge/qlge_ethtool.c
index a28f0254c
33 matches
Mail list logo