Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp973831iob; Fri, 13 May 2022 18:13:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhYDWHqLVtula6cuZ3mQlRTqb3mp5XOJstNejms8QZefoq/FImAhpm7yYxoVJpyTIQVrL7 X-Received: by 2002:a05:6000:1206:b0:20c:84e7:b4df with SMTP id e6-20020a056000120600b0020c84e7b4dfmr5993889wrx.131.1652490833333; Fri, 13 May 2022 18:13:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652490833; cv=none; d=google.com; s=arc-20160816; b=L4YUjR4nFELhde3vOZugqxvghE2K9u6UNpMQnMPIJ7nWcYHMiyHpXxaMNpWu7j2L8g InG0CiR1cGBnMdC14nswCbvnbHg4In1naiSBhX6DCxH4sZKUa6yXX+Mc/NI05ryA3s56 ZuE/Ay1qaHymUKzTJlnA6clF+GGxofvuyW/+GPaiGhL3iTkpEkged/VjlQqbwrQ8ZBHz XTCQvzPuZ/LalUC4gAo1ZzpgHM3O36RaI0PfXZbDwMCp18DQda1DSsMLaAyIHE+yU/qF jPs9LC8PpqJIL2fpb4nKLWoRXimHrasnuuIqotBZ5UXvx2g5oZgacV7CSPbIroCelry6 SByw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=urqKIY6wbrX9qTaxg8+9On2NY1NO3U/j/TDUVp4wC6Y=; b=Bvs3rYKHcx6jNjaEiqJV9frhPba7XfeLCfYtAR1bxLLTSubNpBqbUgnG0v/6pPaHwI VSP7wlu/D+3wQ85I9rx5OrvihYEirY5LrlsF5MzaL3S5Ml7esYZQB8tQ8HvCUD7hLFZt aSVSzafTBPUhS7cDi9jpLnjBUGVAbx88DPCtjgxHo30Q0Vg6rFpj1kDKc11R3rcGVE3V rSIBt8hW6a1+DictxhzJJ/qwyxJOo6CDt4CjDltdpLq1r9P6cQGHdU9ox5pCiEgmHD7O RZCosdfKFqZSSPmT8DUcwely7PuU2p/4uMpwHDZoodb1JqdSpFBcJqp15a6VVsa8Qjc5 13jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E8fLQzpQ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id x4-20020a05600c21c400b0039438c204bcsi3557872wmj.97.2022.05.13.18.13.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 18:13:53 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E8fLQzpQ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 369D03A4C7B; Fri, 13 May 2022 16:45:00 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356066AbiELPp1 (ORCPT + 99 others); Thu, 12 May 2022 11:45:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355771AbiELPpY (ORCPT ); Thu, 12 May 2022 11:45:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD1C264734; Thu, 12 May 2022 08:45:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 23C6D61F0A; Thu, 12 May 2022 15:45:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0C54C385B8; Thu, 12 May 2022 15:45:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652370322; bh=DD2xdLhXWSgHygwViWrC+JPg+DvdP1KdqEAZISrgsLE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=E8fLQzpQszdxSpiGQ65QWq7DvwYlrfrN47FGDOwRSWFRCpif0/oQv3+gCXv+DvGJm EBmLeUXRee/dc3a/he7JT/2pfQYXgOqFwKLF19OsVLLcThSKuXz9XMWbjvqTJIkD2x ZLJZjt18/H342ovoSBtczpldKaMPL/SyAFhq7eoNcvL0+TebKMar7wdG9l24vRtXLm kI/wd7HW5xHeusx2PaUCMnV6wdt9vVpxKjTZ234Ahv+UtsdXdY/7fCpgChEWR1hE9S EFkTI8sM9+Qg+zBnruAucNiukrziCEPWGO2zZRVtQhkJDCV6LOkPOmbIHO7gzqFiqt E1Cm2XFMayXhQ== Date: Thu, 12 May 2022 08:45:20 -0700 From: Jakub Kicinski To: Harini Katakam Cc: Harini Katakam , Nicolas Ferre , David Miller , Claudiu Beznea , dumazet@google.com, Paolo Abeni , netdev , Linux Kernel Mailing List , Michal Simek , Radhey Shyam Pandey Subject: Re: [PATCH v2] net: macb: Disable macb pad and fcs for fragmented packets Message-ID: <20220512084520.0cdb9dd1@kernel.org> In-Reply-To: References: <20220510162809.5511-1-harini.katakam@xilinx.com> <20220511154024.5e231704@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 12 May 2022 12:26:15 +0530 Harini Katakam wrote: > On Thu, May 12, 2022 at 4:10 AM Jakub Kicinski wrote: > > On Tue, 10 May 2022 21:58:09 +0530 Harini Katakam wrote: > > > data_len in skbuff represents bytes resident in fragment lists or > > > unmapped page buffers. For such packets, when data_len is non-zero, > > > skb_put cannot be used - this will throw a kernel bug. Hence do not > > > use macb_pad_and_fcs for such fragments. > > > > > > Fixes: 653e92a9175e ("net: macb: add support for padding and fcs computation") > > > Signed-off-by: Harini Katakam > > > Signed-off-by: Michal Simek > > > Signed-off-by: Radhey Shyam Pandey > > > Reviewed-by: Claudiu Beznea > > > > I'm confused. When do we *have to* compute the FCS? > > > > This commit seems to indicate that we can't put the FCS so it's okay to > > ask the HW to do it. But that's backwards. We should ask the HW to > > compute the FCS whenever possible, to save the CPU cycles. > > > > Is there an unstated HW limitation here? > > Thanks for the review. The top level summary is that there CSUM > offload is enabled by > via NETIF_F_HW_CSUM (and universally in IP registers) and then > selectively disabled for > certain packets (using NOCRC bit in buffer descriptors) where the > application intentionally > performs CSUM and HW should not replace it, for ex. forwarding usecases. > I'm modifying this list of exceptions with this patch. > > This was due to HW limitation (see > https://www.spinics.net/lists/netdev/msg505065.html). > Further to this, Claudiu added macb_pad_and_fcs support. Please see > comment starting > with "It was reported in" below: > https://lists.openwall.net/netdev/2018/10/30/76 > > Hope this helps. > I'll fix the nit and send another version. So the NOCRC bit controls both ethernet and transport protocol checksums? The CRC in the name is a little confusing. Are you sure commit 403dc16796f5 ("cadence: force nonlinear buffers to be cloned") does not fix the case you're trying to address?