Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1295350ybg; Fri, 18 Oct 2019 15:23:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzvstuT0Fd/chXFcQdsUbR+edvLiTcDdLi/e1CrfQD1dKSVN90Maj3/ZfUBWSTAajJnzJzz X-Received: by 2002:a17:906:360c:: with SMTP id q12mr11045602ejb.168.1571437384873; Fri, 18 Oct 2019 15:23:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571437384; cv=none; d=google.com; s=arc-20160816; b=cfvgab4nayLGNsZVgQjx4lnuiQxzQiU9MmPcsxEQBpdnIZQINhePECkJaZk6BeHqx1 l/NG5GgGpHQ0NMnJcU+IP1EcUV9vi7UFz2rQ/vsVQKEV2VoUCiRjBWp8i/65sRdDSVAG 7tipS4l2oVFCqhMG453u5+PfJoB1FcW7USzG8artoBNJDGBX6F+0RIAkQ3Wn5zNnK6wE WbRu7+v956mgD/id7dQhL0PPPly3ekEmB7BNbeNrEFuRtx0CsTKmdSV56apf+5VIs562 TpOIs4Hqox2+ZyB7Q12KmA1Dtb9qzQEwzipJQ0QETdLdWELK3nh22dTleWTqyaOUWHi1 D3rw== 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:date:cc:to:from:subject:message-id; bh=yolbLXUMa5bAmgpMnwIRPvlGlv4vNHejgEdE4PDJBFk=; b=SC6+iWIV6rC7/q03FPP1VQHXcQ6PAA/HYgh48V5K3ScK37T8BFjRxOoFiDuYTudrvV z40GmUaAuUS75au4SayTSa9uEas/bYN56rOGOMJuXPbGv+306zYYcjQE72D2utxqVqbJ THzDeHnQnjn8kPPL1boowfm3HvTO384bFwujUBDd8Q9qDg/BRrR7Cjczic0u3IdfZnIX sR6hNIaj23YDy9nhdPvr9ISGgyihKVkZZRlB0UrJ6cz4jL2NEu2raNTqoVMx8CNT+n73 HTMBdM/GhV9dZuzvmzMH/wcL8AxSonApZGptOoAuQ3KPFJBYMijRvNoT+UjTViHfpYe/ plRA== 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 r17si5136405edx.257.2019.10.18.15.22.42; Fri, 18 Oct 2019 15:23:04 -0700 (PDT) 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 S2438627AbfJQXff (ORCPT + 99 others); Thu, 17 Oct 2019 19:35:35 -0400 Received: from gate.crashing.org ([63.228.1.57]:38654 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406743AbfJQXff (ORCPT ); Thu, 17 Oct 2019 19:35:35 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x9HNYwHU020037; Thu, 17 Oct 2019 18:34:59 -0500 Message-ID: Subject: Re: [PATCH v2] ftgmac100: Disable HW checksum generation on AST2500 From: Benjamin Herrenschmidt To: Vijay Khemka , "David S. Miller" , Kate Stewart , Sven Van Asbroeck , Mark Brown , Bhupesh Sharma , YueHaibing , Mauro Carvalho Chehab , Luis Chamberlain , Thomas Gleixner , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Cc: "openbmc @ lists . ozlabs . org" , "joel@jms.id.au" , "linux-aspeed@lists.ozlabs.org" , Sai Dasari Date: Fri, 18 Oct 2019 10:34:57 +1100 In-Reply-To: <071cf1eeefcbfc14633a13bc2d15ad7392987a88.camel@kernel.crashing.org> References: <20191011213027.2110008-1-vijaykhemka@fb.com> <3a1176067b745fddfc625bbd142a41913ee3e3a1.camel@kernel.crashing.org> <0C0BC813-5A84-403F-9C48-9447AAABD867@fb.com> <071cf1eeefcbfc14633a13bc2d15ad7392987a88.camel@kernel.crashing.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2019-10-18 at 10:14 +1100, Benjamin Herrenschmidt wrote: > > I don't understand what you are saying. You reported a problem with > IPV6 checksums generation. The HW doesn't support it. What's "not a > matter of unsupported csum" ? > > Your patch uses a *deprecated* bit to tell the network stack to only do > HW checksum generation on IPV4. > > This bit is deprecated for a reason, again, see skbuff.h. The right > approach, *which the driver already does*, is to tell the stack that we > support HW checksuming using NETIF_F_HW_CSUM, and then, in the transmit > handler, to call skb_checksum_help() to have the SW calculate the > checksum if it's not a supported type. > > This is exactly what ftgmac100_prep_tx_csum() does. It only enables HW > checksum generation on supported types and uses skb_checksum_help() > otherwise, supported types being protocol ETH_P_IP and IP protocol > being raw IP, TCP and UDP. > > So this *should* have fallen back to SW for IPV6. So either something > in my code there is making an incorrect assumption, or something is > broken in skb_checksum_help() for IPV6 (which I somewhat doubt) or > something else I can't think of, but setting a *deprecated* flag is > definitely not the right answer, neither is completely disabling HW > checksumming. > > So can you investigate what's going on a bit more closely please ? I > can try myself, though I have very little experience with IPV6 and > probably won't have time before next week. I did get that piece of information from Aspeed: The HW checksum generation is supported if: - The length of UDP header is always 20 bytes. - The length of TCP and IP header have 4 * N bytes (N is 5 to 15). Now these afaik are also the protocol limits, so it *should* work. Or am I missing something or some funky encaspulation/header format that can be used under some circumstances ? Cheers, Ben.