Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp709679pxv; Wed, 14 Jul 2021 13:39:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4X5HsnayeEngvLVaBTlESpZWjZG7bIiLZqxQMV3j+ucFE+QpkzSfg9LGphlrfoKWVIjoS X-Received: by 2002:a17:907:207b:: with SMTP id qp27mr82836ejb.258.1626295162669; Wed, 14 Jul 2021 13:39:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626295162; cv=none; d=google.com; s=arc-20160816; b=DOrLKciHKrbPqY0aeACPM2qktHnxWBhy9TOzRcluGSDcJ4Pq1CLq8YutSeeQc5nfGn qHCmU6rWaqCOxr2irJ1mrxhSEgwaO3EsvNdNg+oDHLS3prGTidrbMPxMRxEb1+5MVSKw hyVeOcC++Dn4Pxq3WAcFPgldt26QowbJvXYrWemDvNH2sqLK8xjzmosvWOAiYYSqGZCh yR44ZrDbC51VtSrTLc7qTW9yA5wapKxsNGQ6aLPjfz7K6imZt2A+q5ChS2Wc3r3YeMZa jrF16m/lO8bxCv3KCyXFUlHpNs4moSuzGy18NeuGHbuu/8khVfUAIbzO0o7DaTUhyPeT w13A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=altrnMbv/SB0Yb2YLSOF3NFD8ceIafb8UlwRDHdGk5c=; b=CizsXmIeUEoVRcaLArDchULL+m5ROLqDbEn/fusgKFy/7Vs+AKs21acNp6gcfea8Bs 9mmcdS1TydlgDsAaTF+evqSSM0RrrNS29l9A45rfM9WNUdfYAzjVr7Gv1lOAAWJHmSTT n7cZLSReESxtii405g8x9+/sRFHJR3EYxbWmoathI4F4tuJbhnKQZkiZ135cAtnQyz1M Io6Dp5QyM2wusDB+6tZV1ZiDwt5QgWxnSQ6o0frqhxe3vM7TpgAtmJG9oqYp4Zcu3/tX bXmMq/qLkcR+kmBtDtc0qaa1BJq7JKVogKIASUsVezkASvUyw+BLMDpGTHPXi66ZiitY ql5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=Kf2bamw4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nd15si577753ejc.47.2021.07.14.13.38.59; Wed, 14 Jul 2021 13:39:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=Kf2bamw4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236618AbhGNUSW (ORCPT + 99 others); Wed, 14 Jul 2021 16:18:22 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:55308 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235375AbhGNUSV (ORCPT ); Wed, 14 Jul 2021 16:18:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=altrnMbv/SB0Yb2YLSOF3NFD8ceIafb8UlwRDHdGk5c=; b=Kf2bamw41gyVk9J93clDShPKGc 7NnRaxZ51iRZoISV69nj9kWVt4wHFdbNTM38lQmeQTWBpYsz8N9t90xMqv4e49tpq6BK1MXXpei/n g2+IGvtR4t5ZmqWRupR2aoiFiWwU2cOZ4zublW+95owFClINB5E8ct9TVd1EIsq+E3Oc=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1m3lHs-00DOVJ-87; Wed, 14 Jul 2021 22:15:20 +0200 Date: Wed, 14 Jul 2021 22:15:20 +0200 From: Andrew Lunn To: Vladimir Oltean Cc: Lino Sanfilippo , woojung.huh@microchip.com, UNGLinuxDriver@microchip.com, vivien.didelot@gmail.com, f.fainelli@gmail.com, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] net: dsa: tag_ksz: dont let the hardware process the layer 4 checksum Message-ID: References: <20210714191723.31294-1-LinoSanfilippo@gmx.de> <20210714191723.31294-3-LinoSanfilippo@gmx.de> <20210714194812.stay3oqyw3ogshhj@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210714194812.stay3oqyw3ogshhj@skbuf> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 14, 2021 at 10:48:12PM +0300, Vladimir Oltean wrote: > Hi Lino, > > On Wed, Jul 14, 2021 at 09:17:23PM +0200, Lino Sanfilippo wrote: > > If the checksum calculation is offloaded to the network device (e.g due to > > NETIF_F_HW_CSUM inherited from the DSA master device), the calculated > > layer 4 checksum is incorrect. This is since the DSA tag which is placed > > after the layer 4 data is seen as a part of the data portion and thus > > errorneously included into the checksum calculation. > > To avoid this, always calculate the layer 4 checksum in software. > > > > Signed-off-by: Lino Sanfilippo > > --- > > This needs to be solved more generically for all tail taggers. Let me > try out a few things tomorrow and come with a proposal. Maybe the skb_linearize() is also a generic problem, since many of the tag drivers are using skb_put()? It looks like skb_linearize() is cheap because checking if the skb is already linear is cheap. So maybe we want to do it unconditionally? Andrew