Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1802492ybg; Sat, 19 Oct 2019 02:50:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/YZ1vQMh1tMfejwLY6t1rIFtoU11pTdVllU1OR6LwxcrrYTLHa23j+y29hc0JksV5B5wU X-Received: by 2002:aa7:d905:: with SMTP id a5mr14264966edr.88.1571478613317; Sat, 19 Oct 2019 02:50:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571478613; cv=none; d=google.com; s=arc-20160816; b=qXp99huNWWUno18cEID4AfqCJNbqXZU9GRlEVD1q6dCApi/5VZ/rKo0/1/PO/Q07Er mA37ZxgK0Rcekr0KNwc8xsPrl1+kHMYCxFEmoC4Ko4LvUbMyAmydFV4ODa8+OTT2oPEG wmkuQaGFyEQJBuzXslIPWkZSkNZeZVtHWKhEe2kLw92BWqn0d7Yutm5NJFaOgkETG89d e/fWh4/IJ2BRAboFiNClsHxNJYJjgasEO6DDqAvqtYOzcM0EVk6z19VOiaQKrOhG0yfR pHRSHMt9h6Z3AC6owmOhNFv7sXLQs4AmxgJhHmGhnT7xUkRuirZVaIVpxpkTlQnsoWYE es7Q== 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=9DFioka9elylpxCjon9fns5XIXIzQFZP9RKves+4a2Y=; b=TwquxUHzo6axtxAEF7BXgJDAQwEdxp/BLrAzNJvalWK1eHbEuAXawe/ZNJ9BqByqSZ /JkVDNM/h23IABd3HI2X1YB/DBAT8nrxT/T9rK+zUTEBk4QFQWxURDdohyTqt6xk5lyz jDArXP+xtYgarrbAGHkWPbLj9TeiNn1xHd9sFVaA2MgmoexVmacuEyZO+tKRX1MQNpGN SQcq1ht9TMzLhqqeh+LH+e9SICZqABIFYzL4mtXgRMkV31l5mxURNhIJTqroMKJI92tX UcGlJvSjfnd7xdEc1tCSFwf2G9xkRfh7/uNWcfrfCEswmmUSYwzz6ycpze6iI5pTTtin NS/A== 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 z19si5268410edr.403.2019.10.19.02.49.49; Sat, 19 Oct 2019 02:50:12 -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 S2403914AbfJSADw (ORCPT + 99 others); Fri, 18 Oct 2019 20:03:52 -0400 Received: from gate.crashing.org ([63.228.1.57]:50059 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730521AbfJSADw (ORCPT ); Fri, 18 Oct 2019 20:03:52 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x9J038G6009788; Fri, 18 Oct 2019 19:03:10 -0500 Message-ID: <0ef567e985ce3fe821cbd80265f85a35d16be373.camel@kernel.crashing.org> 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: Sat, 19 Oct 2019 11:03:08 +1100 In-Reply-To: <529EF9B4-DFDE-4DB7-BE26-3AED8D814134@fb.com> References: <20191011213027.2110008-1-vijaykhemka@fb.com> <3a1176067b745fddfc625bbd142a41913ee3e3a1.camel@kernel.crashing.org> <0C0BC813-5A84-403F-9C48-9447AAABD867@fb.com> <071cf1eeefcbfc14633a13bc2d15ad7392987a88.camel@kernel.crashing.org> <9AA81274-01F2-4803-8905-26F0521486CE@fb.com> <529EF9B4-DFDE-4DB7-BE26-3AED8D814134@fb.com> 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 22:50 +0000, Vijay Khemka wrote: > I don't have much understanding of IP Stack but I went through code details and > you are right and found that it should fallback to SW calculation for IPV6 but it doesn't > happen because ftgmac100_hard_start_xmit checks for CHECKSUM_PARTIAL before > setting HW checksum and calling ftgmac100_prep_tx_csum function. And in my > understanding, this value is set CHECKSUM_PARTIAL in IP stack. I looked up IP stack for > IPV6, file net/ipv6/ip6_output.c, function __ip6_append_data: here it sets > CHECKSUM_PARTIAL only for UDP packets not for TCP packets. Please look at line > number 1880. This could be an issue we are seeing here as why > ftgmac100_prep_tx_csum is not getting triggered for IPV6 with TCP. Please correct > me if my understanding is wrong. > Not entirely sure. tcp_v6_send_response() in tcp_ipv6.c does set CHECKSUM_PARTIAL as well. I don't really know how things are being handled in that part of the network stack though. From a driver perspective, if the value of ip_summed is not CHECKSUM_PARTIAL it means we should not have to calculate any checksum. At least that's my understanding here. You may need to add some traces to the driver to see what you get in there, what protocol indication etc... and analyze the corresponding packets with something like tcpdump or wireshark on the other end. Cheers, Ben.