Re: [PATCH net-next] net: ethernet: drop skbs with a short linear part in eth_type_trans()

From: Eric Dumazet

Date: Mon Aug 10 2026 - 04:14:27 EST


On Mon, Aug 10, 2026 at 9:59 AM Pengfei Zhang <zhangfeionline@xxxxxxxxx> wrote:
>
> On Fri, Aug 7, 2026 at 6:52 PM Eric Dumazet <edumazet@xxxxxxxxxx> wrote:
> > This is obviously a wrong patch. Please fix faulty drivers instead of
> > adding more code in our fast path.
> >
> > If you use header split, you are supposed to use modern NAPI api, like
> > napi_gro_frags() which will take care of that.
>
> Thanks for the review.
>
> I put the test in eth_type_trans() because I thought the stack should not
> be brought down by a driver handing it a malformed skb. I take your point
> about the cost on the fast path, and that napi_gro_frags() already takes
> care of this.
>
> I will drop the patch. I do not have amd-xgbe or dwc-xlgmac hardware, so
> I will not send an untested driver change; if I can get access to a device
> that behaves this way, I will fix and verify the driver there.

This function is primarily used by Ethernet drivers.

An Ethernet frame must at least contain an Ethernet header.

A frame smaller than that should be dropped early by the NIC.

If a NIC and/or driver provides the upper stack a packet without an
Ethernet header,
the bug is on them.

Let's not add checks in our fast path for a situation that should never happen.