Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4776043ybl; Tue, 4 Feb 2020 01:38:40 -0800 (PST) X-Google-Smtp-Source: APXvYqxpu86ZL/up3N+tfXIX3JdkbL4VfikJLvQGkJhEiCA2sobv9cbya0FZBQgxTRqv+jHzCM48 X-Received: by 2002:aca:ebc3:: with SMTP id j186mr2778174oih.15.1580809120018; Tue, 04 Feb 2020 01:38:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580809120; cv=none; d=google.com; s=arc-20160816; b=cJIuQfZ15b6at3DBjbDLxB+PfrXg9cJiR7IS89ZkSu3fUooLbwxZR4zT5Ko/lrvRtz gkS0jsGufbIyXUpmseEiHtqUqwVd8efQcNQhWGOs1IWme2Bv4kMgki6wq1ROL26/o1DB 6aQgjoe6cPK93J6mBURH+2RDWW1mgpaWU+QjEH6Ell9cVwC2a0FPKtzKCfkTLXBjNeoR 1SpeeS8oY00KFpuTAHIieJxE/sLpfTMKwUVBjbeQtWOcpmVzdVKTfMR/PkqatCCsRVNT cz+N6yuiXettMaEr9kB1Xuu7YoeiiChMVyEaXQPvxYABVwBS+09fHNd9DV+J/zSTYsCa QNWQ== 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 :references:in-reply-to:from:subject:cc:to:message-id:date; bh=KNee4MYVcE50hN2aWr89yV9E0kTePfJlh/MjxKilU6o=; b=mBdXRLOOmNxXh5Z9w//buOnGUh4ko4zX/ibtsPKbjQv2O8GkFqRqpMQVLo8mEYFSSd lRSA9zcOdrxpFbyubDBuWuyACE6CCeiGRXFAA1t6oaSLc5aurSkTVJ+D7hube4Zyu0H4 NMzDIETJmXR1qqYUi88y1co6WAO7fYV0yFmuY5mPmEdYPJ4NLSEZ/rQdmrvx/tpXDPbz ITlQIf+tRylFx+94oCCvQm+QlEZiRpDRFEKZ2xg1sEevuXC2WpQX9CuflCLLyQwcQMM6 M3hcoH2LTZC9UXhzal2pkhxMBWL3KX3d4CT3Qi8x7JthQc8hGE39Y5j6gy7V2Pg/4kjH pyUg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c5si11633396otp.108.2020.02.04.01.38.28; Tue, 04 Feb 2020 01:38:40 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726832AbgBDJh0 (ORCPT + 99 others); Tue, 4 Feb 2020 04:37:26 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:41344 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726230AbgBDJhZ (ORCPT ); Tue, 4 Feb 2020 04:37:25 -0500 Received: from localhost (unknown [IPv6:2001:982:756:1:57a7:3bfd:5e85:defb]) (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 905B41577F51A; Tue, 4 Feb 2020 01:37:23 -0800 (PST) Date: Tue, 04 Feb 2020 10:37:18 +0100 (CET) Message-Id: <20200204.103718.1343105885567379294.davem@davemloft.net> To: harini.katakam@xilinx.com Cc: nicolas.ferre@microchip.com, claudiu.beznea@microchip.com, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, michal.simek@xilinx.com, harinikatakamlinux@gmail.com Subject: Re: [PATCH v2 1/2] net: macb: Remove unnecessary alignment check for TSO From: David Miller In-Reply-To: <1580735882-7429-2-git-send-email-harini.katakam@xilinx.com> References: <1580735882-7429-1-git-send-email-harini.katakam@xilinx.com> <1580735882-7429-2-git-send-email-harini.katakam@xilinx.com> X-Mailer: Mew version 6.8 on Emacs 26.3 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]); Tue, 04 Feb 2020 01:37:25 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Harini Katakam Date: Mon, 3 Feb 2020 18:48:01 +0530 > The IP TSO implementation does NOT require the length to be a > multiple of 8. That is only a requirement for UFO as per IP > documentation. > > Fixes: 1629dd4f763c ("cadence: Add LSO support.") > Signed-off-by: Harini Katakam > --- > v2: > Added Fixes tag Several problems with this. The subject talks about alignemnt check, but you are not changing the alignment check. Instead you are modifying the linear buffer check: > @@ -1792,7 +1792,7 @@ static netdev_features_t macb_features_check(struct sk_buff *skb, > /* Validate LSO compatibility */ > > /* there is only one buffer */ > - if (!skb_is_nonlinear(skb)) > + if (!skb_is_nonlinear(skb) || (ip_hdr(skb)->protocol != IPPROTO_UDP)) > return features; So either your explanation is wrong or the code change is wrong. Furthermore, if you add this condition then there is now dead code below this. The code that checks for example: /* length of header */ hdrlen = skb_transport_offset(skb); if (ip_hdr(skb)->protocol == IPPROTO_TCP) hdrlen += tcp_hdrlen(skb); will never trigger this IPPROTO_TCP condition after your change. A lot of things about this patch do not add up.