Subject: Re: [PATCH net-next v3 4/8] bpf: cpumap: reuse skb array instead of a linked list to chain skbs

From: Toke Høiland-Jørgensen <[email-masked]>
Date: Fri, 17 Jan 2025 13:53:02 +0100

Alexander Lobakin <[email-masked]> writes:

> cpumap still uses linked lists to store a list of skbs to pass to the
> stack. Now that we don't use listified Rx in favor of
> napi_gro_receive(), linked list is now an unneeded overhead.
> Inside the polling loop, we already have an array of skbs. Let's reuse
> it for skbs passed to cpumap (generic XDP) and keep there in case of
> XDP_PASS when a program is installed to the map itself. Don't list
> regular xdp_frames after converting them to skbs as well; store them
> in the mentioned array (but *before* generic skbs as the latters have
> lower priority) and call gro_receive_skb() for each array element after
> they're done.
>
> Signed-off-by: Alexander Lobakin <[email-masked]>
> Tested-by: Daniel Xu <[email-masked]>

Clever approach. A little hard to follow all the memmoves, but I think
it checks out given the description above :)

Reviewed-by: Toke Høiland-Jørgensen <[email-masked]>