linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Ben Dooks <ben.dooks@codethink.co.uk>, netdev@vger.kernel.org
Cc: oneukum@suse.com, davem@davemloft.net, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, steve.glendinning@shawell.net,
	linux-kernel@lists.codethink.co.uk
Subject: Re: [PATCH 4/4] usbnet: smsc95xx: check for csum being in last four bytes
Date: Wed, 14 Nov 2018 18:59:02 +0300	[thread overview]
Message-ID: <8b5a1bc6-c762-0e50-c602-fe4a9876d246@cogentembedded.com> (raw)
In-Reply-To: <20181114115022.9584-5-ben.dooks@codethink.co.uk>

On 11/14/2018 02:50 PM, Ben Dooks wrote:

> The manual states that the checksum cannot lie in the last DWORD of the
> transmission, so add a basic check for this and fall back to software
> checksumming the packet.
> 
> This only seems to trigger for ACK packets with no options or data to
> return to the other end, and the use of the tx-alignment option makes
> it more likely to happen.
> 
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> Fixes for v2:
> - Fix spelling of check at Sergei's suggestion
> - Move skb->len check into smsc95xx_can_tx_checksum()
> - Change name of smsc95xx_can_checksum to explicitly say it is tx-csum
> ---
>  drivers/net/usb/smsc95xx.c | 19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
> index 8f7c473f3260..cc78ef78cc93 100644
> --- a/drivers/net/usb/smsc95xx.c
> +++ b/drivers/net/usb/smsc95xx.c
> @@ -1997,6 +1997,23 @@ static u32 smsc95xx_calc_csum_preamble(struct sk_buff *skb)
>  	return (high_16 << 16) | low_16;
>  }
>  
> +/* The TX CSUM won't work if the checksum lies in the last 4 bytes of the
> + * transmission. This is fairly unlikely, only seems to trigger with some
> + * short TCP ACK packets sent.
> + *
> + * Note, this calculation should probably check for the alignment of the
> + * data as well, but a straight check for csum being in the last four bytes
> + * of the packet should be ok for now.
> +*/

   Missed a space before */. 

[...]

MBR, Sergei

  reply	other threads:[~2018-11-14 15:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-14 11:50 SMSC95xx driver updates (round 1) Ben Dooks
2018-11-14 11:50 ` [PATCH 1/4] usbnet: smsc95xx: fix rx packet alignment Ben Dooks
2018-11-14 11:50 ` [PATCH 2/4] usbnet: smsc95xx: simplify tx_fixup code Ben Dooks
2018-11-14 11:50 ` [PATCH 3/4] usbnet: smsc95xx: fix memcpy for accessing rx-data Ben Dooks
2018-11-14 11:50 ` [PATCH 4/4] usbnet: smsc95xx: check for csum being in last four bytes Ben Dooks
2018-11-14 15:59   ` Sergei Shtylyov [this message]
2018-11-14 11:58 ` SMSC95xx driver updates (round 1) Oliver Neukum
2018-11-15 18:06 ` Woojung.Huh
2018-11-16 10:49   ` Ben Dooks
2018-11-17  4:16 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8b5a1bc6-c762-0e50-c602-fe4a9876d246@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=ben.dooks@codethink.co.uk \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@lists.codethink.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oneukum@suse.com \
    --cc=steve.glendinning@shawell.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).