Re: [PATCH net 1/2] net: macb: exclude software FCS from TX byte statistics
From: David Laight
Date: Fri Aug 28 2026 - 09:04:19 EST
On Fri, 28 Aug 2026 10:20:24 +0200
Nicolai Buchwitz <nb@xxxxxxxxxxx> wrote:
> Hi Jakub
>
> On 27.8.2026 20:56, Jakub Kicinski wrote:
> > On Mon, 24 Aug 2026 15:47:02 +0200 Nicolai Buchwitz wrote:
> >> + * @skb_len: skb->len as handed over by the stack, before padding and
> >> + * software FCS, only set for the last buffer of the frame
> >
> > counting pad bytes to ETH_ZLEN as sent is perfectly legit,
> > it's a driver preference. Some don't because HW pads and
> > the driver doesn't want to bother adding a conditional.
> > But it's best if the driver bytes match wire bytes IMO.
>
> Matches what I had in mind for my v2. So the driver bytes would match
> wire bytes minus FCS.
>
> >
> > Either way, you only need u8 or even a flag for this,
> > not a full u32?
>
> Agreed. skb->len at completion should already do the trick (minus
> ETH_FCS_LEN).
> So a flag would be sufficient.
If you make the 'flag' 0 or 4 it will save some maths (and maybe a branch)
in the completion code.
David
>
> Thanks,
> Nicolai
>