Re: [PATCH net] net: dpaa: Pad packets to ETH_ZLEN

From: Eric Dumazet
Date: Tue Sep 10 2024 - 04:57:33 EST


On Mon, Sep 9, 2024 at 8:02 PM Sean Anderson <sean.anderson@xxxxxxxxx> wrote:

> OK, I tested both and was able to use
>
> ./pktgen/pktgen_sample01_simple.sh -i net5 -m 7e:de:97:38:53:b9 -d 10.0.0.2 -n 3 -s 59
>
> with a call to `pg_set $DEV "frags 2"` added manually.
>
> This results in the following result
>
> OK: 109(c13+d95) usec, 1 (59byte,0frags)
>
> The original patch causes the nonlinear path to be taken (see with the
> "tx S/G [TOTAL]" statistic) while your suggestion uses the linear path.
> Both work, since there's no problem using the nonlinear path with a
> linear skb.

Maybe it works today, but this allocates an extra page for nothing,
this is an extra burden.

Vast majority of skb_padto() users call it early in ndo_start_xmit(),
let's follow this pattern.