Re: [Linux-kernel] [PATCH 3/4] usbnet: smsc95xx: check for csum being in last four bytes
From: Ben Hutchings
Date: Thu Oct 04 2018 - 13:35:55 EST
On Tue, 2018-10-02 at 10:26 +0100, Ben Dooks wrote:
[...]
> @@ -2031,7 +2045,8 @@ static struct sk_buff *smsc95xx_tx_fixup(struct usbnet *dev,
> > Â }
> Â
> Â if (csum) {
> - if (skb->len <= 45) {
> + /* note, csum does not work if csum in last DWORD of packet */
> + if (skb->len <= 45 || !smsc95xx_can_checksum(skb)) {
It would make more sense to move the length check into
smsc95xx_can_checksum() as well.
Ben.
> Â /* workaround - hardware tx checksum does not work
> Â Â* properly with extremely small packets */
> Â long csstart = skb_checksum_start_offset(skb);
--
Ben Hutchings, Software Developer  Codethink Ltd
https://www.codethink.co.uk/ Dale House, 35 Dale Street
Manchester, M1 2HF, United Kingdom