From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net] net/mlx5e: fix csum adjustments caused by RXFCS Date: Wed, 31 Oct 2018 12:41:31 -0700 (PDT) Message-ID: <20181031.124131.2159865083955807922.davem@davemloft.net> References: <20181030075725.195824-1-edumazet@google.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=euc-kr Content-Transfer-Encoding: 8bit Cc: netdev@vger.kernel.org, eric.dumazet@gmail.com, eranbe@mellanox.com, saeedm@mellanox.com, dmichail@google.com, xiyou.wangcong@gmail.com, pstaszewski@itcare.pl To: edumazet@google.com Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:52812 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725731AbeKAElB (ORCPT ); Thu, 1 Nov 2018 00:41:01 -0400 In-Reply-To: <20181030075725.195824-1-edumazet@google.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Eric Dumazet Date: Tue, 30 Oct 2018 00:57:25 -0700 > As shown by Dmitris, we need to use csum_block_add() instead of csum_add() > when adding the FCS contribution to skb csum. > > Before 4.18 (more exactly commit 88078d98d1bb "net: pskb_trim_rcsum() > and CHECKSUM_COMPLETE are friends"), the whole skb csum was thrown away, > so RXFCS changes were ignored. > > Then before commit d55bef5059dd ("net: fix pskb_trim_rcsum_slow() with > odd trim offset") both mlx5 and pskb_trim_rcsum_slow() bugs were canceling > each other. > > Now we fixed pskb_trim_rcsum_slow() we need to fix mlx5. > > Note that this patch also rewrites mlx5e_get_fcs() to : > > - Use skb_header_pointer() instead of reinventing it. > - Use __get_unaligned_cpu32() to avoid possible non aligned accesses > as Dmitris pointed out. > > Fixes: 902a545904c7 ("net/mlx5e: When RXFCS is set, add FCS data into checksum calculation") > Reported-by: Paweİİ Staszewski > Signed-off-by: Eric Dumazet Applied and queued up for -stable.