From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26440C282C0 for ; Wed, 23 Jan 2019 15:02:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C7A8021850 for ; Wed, 23 Jan 2019 15:02:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cogentembedded-com.20150623.gappssmtp.com header.i=@cogentembedded-com.20150623.gappssmtp.com header.b="ZZaZzs3l" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726101AbfAWPCB (ORCPT ); Wed, 23 Jan 2019 10:02:01 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:40711 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725896AbfAWPCB (ORCPT ); Wed, 23 Jan 2019 10:02:01 -0500 Received: by mail-lf1-f67.google.com with SMTP id v5so1797523lfe.7 for ; Wed, 23 Jan 2019 07:02:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/yLmq2n5DKJMWdj6suREw8eiKjUzl/P3EPHowaxkJls=; b=ZZaZzs3l+DA3ZtsMkJzcxYiz7RuHAcs9r6hBTG7A3QXP56xGksykh4ZTY1BsgMd0h5 mbMy/Ae/9zBV/DNGNxDZmUmYxVUgwSoDavYVUxcDISalCadIRgNIF3NFDAYOcKi2aSZg e9f14o5Y8RyGSqQJu26iCuF6ItRmkXRQSMbvhSevToiR62FsB4gzCZBh081+q6kIjlIF 7TMv+pSirkxX0Sw3YRo8AJpJ7YF7+0/xTsosJCKmo1/Ik+bbNCiFjsu6jkkceReaTAWA LxBCopIOZKlBEXBkd4/Yb9hjoD7zgcQbV/6ZoC/FWomua69jsDBnXr0aoXckKdUS+inC bh7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=/yLmq2n5DKJMWdj6suREw8eiKjUzl/P3EPHowaxkJls=; b=E4ItVpfWmEckRFUWDzWFtadFC9/RIQdP0tjoOPW9yUD0lH/vNpnO6XejXwPC2PeWxj t9Pfjbr5sQYLQoTm6njy/egE+MiBMFPEg/acxvcLKsHkDRB5Ig1VcEAdCCJoX9XxCuuJ +esp9krZF/gIDIGslP51ntl1fs4wmACVa2soYg5iB8rocDhndZaEA4/D3okfEyp+SBbT 7bgLss1+1U33yaUxw2726/26a7Hu3lB8JLORaGt488ZZOOGW2jED2CtrFpEogK7kaHWf dW8ua5YJuR74yq3Eerh3gjCE/e50jAS4osjfTL1Q4lU0J1ZvV0a/XHwVxxxaVJ6GBXu0 melg== X-Gm-Message-State: AJcUukdPpMgW2EyuQzrORICHkCmccIfUZY1ZQhr9JTejmuzSlIIHlGTg XKkL6nC1SEZkQTsWyEfY4FuEhw== X-Google-Smtp-Source: ALg8bN7xKZ4bs0jTH/9RDgtWWeV5tRKBeEYXDHNDHASmaIBZyuwwI7m1ihWiBB7wNEYvMwDaFQq6rw== X-Received: by 2002:a19:5a05:: with SMTP id o5mr2290180lfb.140.1548255719516; Wed, 23 Jan 2019 07:01:59 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.84.180]) by smtp.gmail.com with ESMTPSA id y23-v6sm543577ljk.95.2019.01.23.07.01.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 07:01:58 -0800 (PST) Subject: Re: [PATCH v2 net] ravb: expand rx descriptor data to accommodate hw checksum To: Simon Horman , David Miller Cc: Magnus Damm , netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org References: <20190123111452.27845-1-horms+renesas@verge.net.au> From: Sergei Shtylyov Organization: Cogent Embedded Message-ID: Date: Wed, 23 Jan 2019 18:01:57 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20190123111452.27845-1-horms+renesas@verge.net.au> Content-Type: text/plain; charset=utf-8 Content-Language: en-MW Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 01/23/2019 02:14 PM, Simon Horman wrote: > EtherAVB may provide a checksum of packet data appended to packet data. In > order to allow this checksum to be received by the host descriptor data > needs to be enlarged by 2 bytes to accommodate the checksum. > > In the case of MTU-sized packets without a VLAN tag the > checksum were already accommodated by virtue of the space reserved for the > VLAN tag. However, a packet of MTU-size with a VLAN tag consumed all > packet data space provided by a descriptor leaving no space for the > trailing checksum. > > This was not detected by the driver which incorrectly used the last two > bytes of packet data as the checksum and truncate the packet by two bytes. > This resulted all such packets being dropped. > > A work around is to disable RX checksum offload > # ethtool -K eth0 rx off > > This patch resolves this problem by increasing the size available for > packet data in RX descriptors by two bytes. > > Tested on R-Car E3 (r8a77990) ES1.0 based Ebisu-4D board > > v2 > * Use sizeof(__sum16) directly rather than adding a driver-local > #define for the size of the checksum provided by the hw (2 bytes). > > Fixes: 4d86d3818627 ("ravb: RX checksum offload") > Signed-off-by: Simon Horman Reviewed-by: Sergei Shtylyov [...] MBR, Sergei