Re: [PATCH net v5] net: stmmac: Prevent DSA tags from breaking COE

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

 



Hi Jakub,

On Fri, 12 Jan 2024, Jakub Kicinski wrote:

> > @@ -4997,7 +5020,7 @@ static void stmmac_dispatch_skb_zc(struct stmmac_priv *priv, u32 queue,
> >  	stmmac_rx_vlan(priv->dev, skb);
> >  	skb->protocol = eth_type_trans(skb, priv->dev);
> >  
> > -	if (unlikely(!coe))
> > +	if (unlikely(!coe) || !stmmac_has_ip_ethertype(skb))
> 
> The lack of Rx side COE checking in this driver is kinda crazy.
> Looking at enh_desc_coe_rdes0() it seems like RDES0_FRAME_TYPE
> may be the indication we need here? 

I don't think that RDES0_FRAME_TYPE would be enough, at least not on its own. 
That bit is set by checking the length/ethertype field to see if is an 
Ethernet II frame or an IEEE802.3 frame. But even Ethernet II frames with non-IP 
ethertypes will not be checksummed. Also protocols with a non-fixed ethertype 
field such as DSA_TAG_PROTO could trigger the bit, or not, depending on what 
they put in the DSA tag.

--
Romain Gantois, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com




[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