Thread (8 messages) flat view 8 messages, 2 authors, 2020-06-23

Re: [PATCH bpf-next 3/3] bpf, netns: Keep a list of attached bpf_link's

From: Andrii Nakryiko <hidden>
Date: 2020-06-23 06:26:53
Also in: bpf

On Mon, Jun 22, 2020 at 9:04 AM Jakub Sitnicki [off-list ref] wrote:
To support multi-prog link-based attachments for new netns attach types, we
need to keep track of more than one bpf_link per attach type. Hence,
convert net->bpf.links into a list, that currently can be either empty or
have just one item.

Instead of reusing bpf_prog_list from bpf-cgroup, we link together
bpf_netns_link's themselves. This makes list management simpler as we don't
have to allocate, initialize, and later release list elements. We can do
this because multi-prog attachment will be available only for bpf_link, and
we don't need to build a list of programs attached directly and indirectly
via links.

No functional changes intended.

Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
---
Acked-by: Andrii Nakryiko <redacted>
 include/net/netns/bpf.h    |  2 +-
 kernel/bpf/net_namespace.c | 42 +++++++++++++++++++++-----------------
 2 files changed, 24 insertions(+), 20 deletions(-)
[...]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help