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=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 08052C282C4 for ; Tue, 12 Feb 2019 17:28:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D625520700 for ; Tue, 12 Feb 2019 17:28:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730416AbfBLR2L (ORCPT ); Tue, 12 Feb 2019 12:28:11 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:55074 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728165AbfBLR2L (ORCPT ); Tue, 12 Feb 2019 12:28:11 -0500 Received: from localhost (96-89-128-221-static.hfc.comcastbusiness.net [96.89.128.221]) (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 03DAF14C3D469; Tue, 12 Feb 2019 09:28:10 -0800 (PST) Date: Tue, 12 Feb 2019 09:28:10 -0800 (PST) Message-Id: <20190212.092810.2278214887970417721.davem@davemloft.net> To: tariqt@mellanox.com Cc: netdev@vger.kernel.org, eranbe@mellanox.com, saeedm@mellanox.com, edumazet@google.com Subject: Re: [PATCH net V2] net/mlx4_en: Force CHECKSUM_NONE for short ethernet frames From: David Miller In-Reply-To: <1549901057-2614-1-git-send-email-tariqt@mellanox.com> References: <1549901057-2614-1-git-send-email-tariqt@mellanox.com> X-Mailer: Mew version 6.8 on Emacs 26.1 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, 12 Feb 2019 09:28:11 -0800 (PST) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Tariq Toukan Date: Mon, 11 Feb 2019 18:04:17 +0200 > From: Saeed Mahameed > > When an ethernet frame is padded to meet the minimum ethernet frame > size, the padding octets are not covered by the hardware checksum. > Fortunately the padding octets are usually zero's, which don't affect > checksum. However, it is not guaranteed. For example, switches might > choose to make other use of these octets. > This repeatedly causes kernel hardware checksum fault. > > Prior to the cited commit below, skb checksum was forced to be > CHECKSUM_NONE when padding is detected. After it, we need to keep > skb->csum updated. However, fixing up CHECKSUM_COMPLETE requires to > verify and parse IP headers, it does not worth the effort as the packets > are so small that CHECKSUM_COMPLETE has no significant advantage. > > Future work: when reporting checksum complete is not an option for > IP non-TCP/UDP packets, we can actually fallback to report checksum > unnecessary, by looking at cqe IPOK bit. > > Fixes: 88078d98d1bb ("net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends") > Cc: Eric Dumazet > Signed-off-by: Saeed Mahameed > Signed-off-by: Tariq Toukan Applied and queued up for -stable.