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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED 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 27D3EC00449 for ; Fri, 5 Oct 2018 21:53:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D36FC208E7 for ; Fri, 5 Oct 2018 21:53:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D36FC208E7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=davemloft.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727317AbeJFEx4 (ORCPT ); Sat, 6 Oct 2018 00:53:56 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:46968 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725772AbeJFEx4 (ORCPT ); Sat, 6 Oct 2018 00:53:56 -0400 Received: from localhost (c-67-183-145-105.hsd1.wa.comcast.net [67.183.145.105]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 928F513ADF96A; Fri, 5 Oct 2018 14:53:17 -0700 (PDT) Date: Fri, 05 Oct 2018 14:53:16 -0700 (PDT) Message-Id: <20181005.145316.1347310522019003432.davem@davemloft.net> To: maxime.chevallier@bootlin.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, antoine.tenart@bootlin.com, thomas.petazzoni@bootlin.com, gregory.clement@bootlin.com, miquel.raynal@bootlin.com, nadavh@marvell.com, stefanc@marvell.com, ymarkman@marvell.com, mw@semihalf.com Subject: Re: [PATCH net v2] net: mvpp2: Extract the correct ethtype from the skb for tx csum offload From: David Miller In-Reply-To: <20181005070440.3294-1-maxime.chevallier@bootlin.com> References: <20181005070440.3294-1-maxime.chevallier@bootlin.com> X-Mailer: Mew version 6.7 on Emacs 26 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 05 Oct 2018 14:53:18 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maxime Chevallier Date: Fri, 5 Oct 2018 09:04:40 +0200 > When offloading the L3 and L4 csum computation on TX, we need to extract > the l3_proto from the ethtype, independently of the presence of a vlan > tag. > > The actual driver uses skb->protocol as-is, resulting in packets with > the wrong L4 checksum being sent when there's a vlan tag in the packet > header and checksum offloading is enabled. > > This commit makes use of vlan_protocol_get() to get the correct ethtype > regardless the presence of a vlan tag. > > Fixes: 3f518509dedc ("ethernet: Add new driver for Marvell Armada 375 network unit") > Signed-off-by: Maxime Chevallier > --- > V2: Use htons on values that can be swapped at compile-time, following > Yan's comment. Fix the "Fixes" tag and a typo, following Sergei's comment. Applied and queued up for -stable.