Re: [PATCH net v2 1/1] net: stmmac: Prevent DSA tags from breaking COE on stmmac

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 3, 2024 at 10:11 AM Romain Gantois
<romain.gantois@xxxxxxxxxxx> wrote:
> On Tue, 2 Jan 2024, Linus Walleij wrote:
> ...
> > > +static inline bool stmmac_has_ip_ethertype(struct sk_buff *skb)
> > > +{
> > > +       __be16 proto = eth_header_parse_protocol(skb);
> >
> > I made a new function for this in my patch
> > https://lore.kernel.org/netdev/20231222-new-gemini-ethernet-regression-v4-2-a36e71b0f32b@xxxxxxxxxx/
> >
> > I was careful to add if (!pskb_may_pull(skb, ETH_HLEN)) because Eric
> > was very specific about this, I suppose you could get fragment frames that
> > are smaller than an ethernet header.
>
> Okay nice, then I'll rewrite this series to use the new function once your
> changes make it in.

I just rewrote my patch to use eth_header_parse_protocol() instead.
I should not invent a new version of something that already exist.

> > Should we add an if (!pskb_may_pull(skb, ETH_HLEN)) to
> > eth_header_parse_protocol()?
>
> That does sound logical to me but I couldn't tell you what the impact on current
> callers would be. The net maintainers will probably have a better idea of this.

I can propose a separate patch for this with RFC.

Yours,
Linus Walleij





[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux