Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1262364imm; Thu, 4 Oct 2018 10:36:38 -0700 (PDT) X-Google-Smtp-Source: ACcGV6355MXrnK5ZXKVF/pFILdi56F9mG7oOX+esrDppck+cqd3Fl3QGvZXVKHWSJzU4QSsjgi6y X-Received: by 2002:a63:bc12:: with SMTP id q18-v6mr6440828pge.353.1538674598172; Thu, 04 Oct 2018 10:36:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538674598; cv=none; d=google.com; s=arc-20160816; b=Sepz/rwqNK4QIn67XtUcQM8YP9ZzdIBg0czhWhUByw7avFzWXVlI8JtrnsbMXmu92K zOWRzdCVNk0ys/JS5P+E4VSjfYdQ2g2o+e74MnmzRmNMFdHm445jRdyivae2vqcWrev2 UipgiscIJRL+Gh9DALLrDOgQS+2NGs3Zk07rN4U2JI1QD9vQBOQX1k974LyHY3rKvefC IsuyIAcJw2GxQpTu6aktB5lypZogxrFj0Zwt0X8TqqHOE7d0z/6lxORqucfXg0gXVdb7 smWRwI3Rov6Ip4OdRHKijzoJxN0nOZ/8PoOMjXFXYEhGWLqD2rd5I6cGMmrM37ht5Tmp oDFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:date:cc:to:from:subject :message-id; bh=kUt8Bjv4ECmqa1Duju+5TPvaSgfDFlUXfAWWYbiLsWg=; b=Dxhuqb76J1XJzDkOuZ+VXvcuAM10o/SkTWuHDT9yiT5r5fUTybqpa7CxgABNzCIuMt 9pZaqRrSgArssQWgjYa941j3fBGsL65pkiTCHeRRV28ocrhNc/phR7kNBJKXQEApruYO TKBBNR6Op6rkyZIDUuFEzNi4670mAPkbTecJJ+CoWMuTzYt2+32meiFYnxGhmqpDqMSh vHBeZypjvb4WrM/9j6NYZfBtONvQ6m/Oxs1DHh7Xxoow9FVGRZxowSd7BVSiiSL8cM5N LDtmH9JPnkS5uCENjKPKiwC/v3dKBcAE55z6IvAzjwWHSqFj2f3u+7MYEvI860rMbysq B+4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 7-v6si4933575pgf.273.2018.10.04.10.36.22; Thu, 04 Oct 2018 10:36:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727725AbeJEAaJ (ORCPT + 99 others); Thu, 4 Oct 2018 20:30:09 -0400 Received: from imap1.codethink.co.uk ([176.9.8.82]:49939 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727436AbeJEAaI (ORCPT ); Thu, 4 Oct 2018 20:30:08 -0400 Received: from [148.252.241.226] (helo=xylophone) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1g86uM-00017k-Od; Thu, 04 Oct 2018 17:55:26 +0100 Message-ID: <1538672124.3024.270.camel@codethink.co.uk> Subject: Re: [Linux-kernel] [PATCH 3/4] usbnet: smsc95xx: check for csum being in last four bytes From: Ben Hutchings To: Ben Dooks , netdev@vger.kernel.org Cc: linux-kernel@lists.codethink.co.uk, linux-usb@vger.kernel.org, oneukum@suse.com, linux-kernel@vger.kernel.org, davem@davemloft.net Date: Thu, 04 Oct 2018 17:55:24 +0100 In-Reply-To: <20181002092645.1115-4-ben.dooks@codethink.co.uk> References: <20181002092645.1115-1-ben.dooks@codethink.co.uk> <20181002092645.1115-4-ben.dooks@codethink.co.uk> Organization: Codethink Ltd. Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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