Thread (13 messages) flat view 13 messages, 4 authors, 2020-01-10

Re: [PATCH bpf-next 1/2] xdp: Move devmap bulk queue into struct net_device

From: Toke Høiland-Jørgensen <hidden>
Date: 2020-01-10 15:26:39
Also in: bpf

Björn Töpel [off-list ref] writes:
On Fri, 10 Jan 2020 at 15:22, Toke Høiland-Jørgensen [off-list ref] wrote:
quoted
From: Toke Høiland-Jørgensen <redacted>

Commit 96360004b862 ("xdp: Make devmap flush_list common for all map
instances"), changed devmap flushing to be a global operation instead of a
per-map operation. However, the queue structure used for bulking was still
allocated as part of the containing map.

This patch moves the devmap bulk queue into struct net_device. The
motivation for this is reusing it for the non-map variant of XDP_REDIRECT,
which will be changed in a subsequent commit.

We defer the actual allocation of the bulk queue structure until the
NETDEV_REGISTER notification devmap.c. This makes it possible to check for
ndo_xdp_xmit support before allocating the structure, which is not possible
at the time struct net_device is allocated. However, we keep the freeing in
free_netdev() to avoid adding another RCU callback on NETDEV_UNREGISTER.

Because of this change, we lose the reference back to the map that
originated the redirect, so change the tracepoint to always return 0 as the
map ID and index. Otherwise no functional change is intended with this
patch.
Nice work, Toke!
Thanks!
I'm getting some checkpatch warnings (>80 char lines), other than
that:
Oh, right, totally forgot to run checkpatch; will fix and respin :)

-Toke
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help