Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6188566iob; Tue, 10 May 2022 12:21:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXtRQzTDSj5lD3chbjwCdGtGQWWE2v94d+J/wv/cLZRr6j00ozZzlxv6FNrsODj1XwQxDM X-Received: by 2002:a05:6870:fba4:b0:ed:509b:8a33 with SMTP id kv36-20020a056870fba400b000ed509b8a33mr932283oab.123.1652210504350; Tue, 10 May 2022 12:21:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652210504; cv=none; d=google.com; s=arc-20160816; b=p3Cgw8d0H80XYhkh40a7SxfdyFTbROCAy6+AhZxzpNHmfj8dOKbbyCrYciSisGPbk6 EDhfBqrlKJj87ghZgfwWdY8G5nQOJFUhD8p5qsyX0+fAgL0RS42Z1KTj1s+ApneJuRJw FEuQan8DKmDERQk1FKQLU8qIG+CNSaG0igpyf/TU/u+Pxvf8wruPacVshSaIQ9jtLJhb /5o1YjFO1HMOTZjCKgh6H2D214m+WDsiR6dG+JeAes3kxTcSu57k6JXGosE57w/JrIC8 DspXqYQh3rgn9Vdi3MYfdQZgIL8G+ipJY42wQ3NZq0fbLGt+vrK/waklJ5PGAVVNV6di mnVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=ETH0SXQwXqTw7S/Rt3mpUjs/svhKnIJybMWlENZs/nk=; b=ngux/4Yb1WoFdBWDgAQtLOBzyGdxNGcDQdqxTK2KE19Di2GjWbisaKL7RlUTGOkEn9 E9/juySyo40M8SedcpVKG8v91K2Zj8PDhiazX8eowVyXmM+Hbr/j95ZDDG6DBGLYyP1x nJafl9B1XX7IGgo8U3IxBNskHDIXKb7Unpmr7ALLc15aDLxvlXyfqn9yqjxEDnC42eUE ERycyaM7vris2ugh7TTbtv7YZZj10mew4HZ8bRr84POJYxgTJGST9K5E0sHwek0dR+aT c4PwDiOS43cRJpqM2GgdhLDoiZf3MAn8Kg53GgJKYHN/X/tRRNqV1iiZL9hMfEhfSI5N QEVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xilinx.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s19-20020a056830439300b006063087baf4si64247otv.1.2022.05.10.12.21.29; Tue, 10 May 2022 12:21:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xilinx.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344867AbiEJOgW (ORCPT + 99 others); Tue, 10 May 2022 10:36:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343872AbiEJOHR (ORCPT ); Tue, 10 May 2022 10:07:17 -0400 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C0E31157F7; Tue, 10 May 2022 06:41:19 -0700 (PDT) Received: by mail-wr1-f48.google.com with SMTP id b19so23867014wrh.11; Tue, 10 May 2022 06:41:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ETH0SXQwXqTw7S/Rt3mpUjs/svhKnIJybMWlENZs/nk=; b=W/aTyxriX/AFi1WA1W/ReMB7iksCkA8NLGBwdaBf+72UciSNQvK1W2XOesDUt7lQcF pALoanvrfBLaDgBMNs+um+z9TQzUgIuUNodOvsToU45SRyiWtcglZMiCuqySECo+Ztif glZzYVTxzZDTz95HlFhnGSwR18jVRL79PeNp9HV1Oh3j3QYv9nk1MCxpI//RsNdgtTCN r9K3i5mXjq/TIuGDOjappSM610R3RoIKaFIh6S51xF1Xf3ejcEmzgIC5BJ2EIAO2AtbP 6a/Us2gUkIaUQSdgP9tWiUS+uWZnHnh5YIjRwQvjkB90WWibhir2pULHDEGOGblygnGB nyqg== X-Gm-Message-State: AOAM531Mqa8/Sm6N2IiIFuq0jrvlJQahJyVC/kg81JML5E9csfIXc79O 8fPEtM0Z0BQd5vEZe7gCXm5e4Ws4tN9JFhMtf3M= X-Received: by 2002:adf:d213:0:b0:20a:d703:154f with SMTP id j19-20020adfd213000000b0020ad703154fmr19112799wrh.604.1652190078045; Tue, 10 May 2022 06:41:18 -0700 (PDT) MIME-Version: 1.0 References: <20220509121513.30549-1-harini.katakam@xilinx.com> <21ee77073341cd2b5e0109be5da61d8e981ea50d.camel@redhat.com> In-Reply-To: <21ee77073341cd2b5e0109be5da61d8e981ea50d.camel@redhat.com> From: Harini Katakam Date: Tue, 10 May 2022 19:11:06 +0530 Message-ID: Subject: Re: [PATCH] net: macb: Disable macb pad and fcs for fragmented packets To: Paolo Abeni Cc: Harini Katakam , Nicolas Ferre , David Miller , Claudiu Beznea , Jakub Kicinski , dumazet@google.com, netdev , Linux Kernel Mailing List , Michal Simek , Radhey Shyam Pandey Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 Hi Paolo, On Tue, May 10, 2022 at 6:48 PM Paolo Abeni wrote: > > On Mon, 2022-05-09 at 17:45 +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. > > > > Signed-off-by: Harini Katakam > > Signed-off-by: Michal Simek > > Signed-off-by: Radhey Shyam Pandey > > This looks like a fix suitable for the net tree. Please add a relevant > 'Fixes' tag. > > > --- > > drivers/net/ethernet/cadence/macb_main.c | 7 +++++-- > > 1 file changed, 5 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c > > index 6434e74c04f1..0b03305ad6a0 100644 > > --- a/drivers/net/ethernet/cadence/macb_main.c > > +++ b/drivers/net/ethernet/cadence/macb_main.c > > @@ -1995,7 +1995,8 @@ static unsigned int macb_tx_map(struct macb *bp, > > ctrl |= MACB_BF(TX_LSO, lso_ctrl); > > ctrl |= MACB_BF(TX_TCP_SEQ_SRC, seq_ctrl); > > if ((bp->dev->features & NETIF_F_HW_CSUM) && > > - skb->ip_summed != CHECKSUM_PARTIAL && !lso_ctrl) > > + skb->ip_summed != CHECKSUM_PARTIAL && !lso_ctrl && > > + (skb->data_len == 0)) > > ctrl |= MACB_BIT(TX_NOCRC); > > } else > > /* Only set MSS/MFS on payload descriptors > > This chunk looks unrelated to the commit message ?!? only the next one > looks relevant. Thanks for the review. This code is related to the commit message. macb_pad_and_fcs is performed on the same packets on which TX_NOCRC is set (instruct HW not to perform CRC and perform CRC in SW). This is the patch which added both: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/drivers/net/ethernet/cadence?id=653e92a9175ea7ed67efe209c725222051a3713d I'll mention the same in Fixes tag and also add Claudiu's review tag. Regards, Harini