Re: [PATCH bpf v2] bpf: Run generic devmap egress prog on private skb
From: sun jian
Date: Wed Jun 10 2026 - 21:18:13 EST
On Wed, Jun 10, 2026 at 10:50 PM Jakub Kicinski <kuba@xxxxxxxxxx> wrote:
>
> On Wed, 10 Jun 2026 12:52:21 +0200 Toke Høiland-Jørgensen wrote:
> > > @@ -700,12 +700,22 @@ int dev_map_enqueue_multi(struct xdp_frame *xdpf, struct net_device *dev_rx,
> > > int dev_map_generic_redirect(struct bpf_dtab_netdev *dst, struct sk_buff *skb,
> > > const struct bpf_prog *xdp_prog)
> > > {
> > > + struct sk_buff *nskb;
> >
> > nit: this definition could go inside the if statement block below, to
> > make it obvious that nskb is not used outside that branch.
>
> Or maybe move the copy inside dev_map_bpf_prog_run_skb() since it only
> has one caller and already checks if prog is NULL?
Hi Toke, Jakub, Jiayuan,
Thanks for the reviews and suggestions.
I'll prepare a v3 that splits the selftest into a separate patch, makes the
DEVMAP_HASH keys deterministic in the last-destination test, and fixes the
Fixes tag to point at the generic devmap egress-program support commit.
I'll also look at moving the private-copy step closer to
dev_map_bpf_prog_run_skb(), as Jakub suggested.
Thanks,
Sun Jian