Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp5980410iob; Tue, 10 May 2022 07:54:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaRT9P2cZbmbwHSobYBo+EheXu9sW9cDQG8FAFSaVqhUMBnMcFLnPdCvIEbNsEGxBmC391 X-Received: by 2002:a17:90b:3845:b0:1dc:a733:2ece with SMTP id nl5-20020a17090b384500b001dca7332ecemr378441pjb.220.1652194449948; Tue, 10 May 2022 07:54:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652194449; cv=none; d=google.com; s=arc-20160816; b=zNd2U5msW6oQgh9ajmCrzMneDuEPBeb9LtBEH1WEZJrSAXOh88R0YvLZBDQD0b3uDt xenTkEtzkuJkuYtfnIykR+EPZjgtsdbp4mEO0wTlsDBAi9VhDl7ieu9wQS8lMCbt6MlG WwYYS9ouSbN3UYJxS9Icdudywo7AgeN/seVqYVNSYJUhkRkzhyOgwnawuA6RC9uvpRj2 LP0Q1+Gs0/yFBrt9UhgpUodnhvL7z9/oPMTGDUuZkr1XW5PUsBaicUajbaLXYKcyoFev d/EaeQx+pBjGnXAXfITwoCwxUptmnB3hL1NDMXf718pb0778+HS/i4f7ZdIJjb5YuOj9 M9oQ== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=sHy0F7ac22uwKEpSKuZcvo5GcFLWTTOIEdgJB67ZhmA=; b=LYSnrX5bqOMyWTrpte2nM+ctJ9aNx9kNnmARLckaj65NkmNSqHIUCvlpoZKoUaEnIC lRx+oEtW1+hc4TRmCda5+GBn24SFLKUj+JMvZfa33OT7enW71Pegs0e6+w+l3cOncc4p EH/JtCK+y+V5U/pc5IkGuoqalkZHfn84Tp9ap2Wot6dpwFg0KlFiJo0GV2FgWY6h5KHW B+S5tloFCY9UgQ1Kffv843PoigsC62+YgzcOi6tPCaO+OD7Xm30jOhqzh/bd2FyKUHTe IMHwd3q4B+K6TQKjIM86OJggpYjBMiqYpq1R+ZG1zZmfzmY4B6Q0L0RZkuE98cTYf046 M2gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QHwd05NJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s7-20020a170902ea0700b0015eb4152d68si4229175plg.157.2022.05.10.07.53.55; Tue, 10 May 2022 07:54:09 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QHwd05NJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242160AbiEJNfr (ORCPT + 99 others); Tue, 10 May 2022 09:35:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243036AbiEJNZ1 (ORCPT ); Tue, 10 May 2022 09:25:27 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7F3E722EA63 for ; Tue, 10 May 2022 06:18:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652188716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sHy0F7ac22uwKEpSKuZcvo5GcFLWTTOIEdgJB67ZhmA=; b=QHwd05NJ7mXnRXGDaIgyrVpxkOrrPrEJFcO/gonXlxP3h0zcbhY3qL0FpMVVVv80Iq1DTS kAQWWctPpFapEnllCMWEoEhKE3ZDUCkeB+dv5NC3p55e13UcsX+lTY4lklFfTvPptjcIRJ +vWtd/9Et+Yf+fGCRCqbvdrf2+P06p8= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-631-82-I38puMuyShLbuglGmaw-1; Tue, 10 May 2022 09:18:35 -0400 X-MC-Unique: 82-I38puMuyShLbuglGmaw-1 Received: by mail-wm1-f72.google.com with SMTP id g3-20020a7bc4c3000000b0039409519611so5260029wmk.9 for ; Tue, 10 May 2022 06:18:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=sHy0F7ac22uwKEpSKuZcvo5GcFLWTTOIEdgJB67ZhmA=; b=WKp/UMukfJUQtrJHdEJ+P/V95M0r9UpMCTerbnwBGA/dzW2nb91x2QVrWoUzPjS/CM L1sKEqoZbvnF/0YkX+XkwgrGCJ9zTTMa2VarJwHDxsVjGOUAhaXEjZ6TFoN8a07p34H9 4kSEiX7Jy4IUaJpGrlIHGDcMH1MshSYrDi8alm6/wh6nt79trmH+tz9ZDKFdYl1feLcg bqrKJJli1wHsNnEblXtXBN52LyLUjwqAek1W66GfqOsmkSpwlFHpDW03Oada3W5Vbmlh CJRyLPOJ2u1iaz6dVE9NOLtqXwLo+KUsNcnkwDJhTncniYP/lyd80CXW6u/2U6b5r9TG nGUg== X-Gm-Message-State: AOAM533RPUsrSEhAnHTJBwHJSWc0C1P3/M4qKI1FwRX9teLlz8ocdq41 /zAXsqcsjZx9b6FZxST8M1VGpvDroKmqg6uVitqChaArMZsDAQy+tYx41NeXkMr9Pk8G1gzQkOZ 7IgY31sACrxDovMSQrXrfFRdg X-Received: by 2002:a05:600c:5105:b0:394:7d22:aa93 with SMTP id o5-20020a05600c510500b003947d22aa93mr19997762wms.107.1652188714168; Tue, 10 May 2022 06:18:34 -0700 (PDT) X-Received: by 2002:a05:600c:5105:b0:394:7d22:aa93 with SMTP id o5-20020a05600c510500b003947d22aa93mr19997736wms.107.1652188713913; Tue, 10 May 2022 06:18:33 -0700 (PDT) Received: from gerbillo.redhat.com (146-241-113-89.dyn.eolo.it. [146.241.113.89]) by smtp.gmail.com with ESMTPSA id c2-20020a5d5282000000b0020c5253d8e0sm14119404wrv.44.2022.05.10.06.18.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 May 2022 06:18:33 -0700 (PDT) Message-ID: <21ee77073341cd2b5e0109be5da61d8e981ea50d.camel@redhat.com> Subject: Re: [PATCH] net: macb: Disable macb pad and fcs for fragmented packets From: Paolo Abeni To: Harini Katakam , nicolas.ferre@microchip.com, davem@davemloft.net, claudiu.beznea@microchip.com, kuba@kernel.org, dumazet@google.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, michal.simek@xilinx.com, harinikatakamlinux@gmail.com, radhey.shyam.pandey@xilinx.com Date: Tue, 10 May 2022 15:18:32 +0200 In-Reply-To: <20220509121513.30549-1-harini.katakam@xilinx.com> References: <20220509121513.30549-1-harini.katakam@xilinx.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 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. Paolo