Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp335230lqg; Thu, 11 Apr 2024 04:46:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXPc3V3nnsMIU6Z7vRIojdGdG+R8wFT2bMVzsHNzG2JHm/34n/r3pecMT6wYvggn5Od0yd8pkupZutNwpyqishD6xIERVdgOJ+rTW56mw== X-Google-Smtp-Source: AGHT+IHEO1MqQLqo5Sh5II+4budbDLc5n8fhu6AFww1uZ+74dBt6DwlPiwj0nwpNeuavuExt9K6o X-Received: by 2002:a05:6214:d06:b0:69b:290c:c88e with SMTP id 6-20020a0562140d0600b0069b290cc88emr5334963qvh.49.1712836004195; Thu, 11 Apr 2024 04:46:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712836004; cv=pass; d=google.com; s=arc-20160816; b=eLPfNbg95at503Bt31YZJJZMqzk7yiH9qBQdji2lcDHbGKHKDdxz1ctpNyaBTb5FHu oyf7nS0bcGZ1bTyADYMjCN2srxr4lX/R535txuvofvaybNAnUj6FAxD+YSkNOtcWkE0M AacJAqg9aF3dulOk2OMtxMh2nGhsIrqCbOy1a+b9mk7BCKiP51FT26oSRZr6NpPtaFpI TpJeK4hQImHR5UzjgYLiwjt8DN9rM8kUr+Q8n2tLIkrVMTBBeC59/7kQjkowgFW56ewR tdY3oApKZvDwKq2QMoWq0IBwozYS83LmtEstbwEQD8FDRg7Ceg96webrCbqRYFpUx6NS 1/HQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=orvCcc0uC9fqdG+m48F8Q2jy4taPBHetU20MQkO0ZHA=; fh=l55LBwCPu+wSDalSufX0aRSb1ticG861yGU2rLmDH4k=; b=VYpC88W6Wz2na0vFkGzH/uf0eZU75l0Uf5agojLc2BjUI6VtSsPitfElJAwXkwNt3B KWHX3kSm9TLeVy0sg9rClo88ye+lJjr7Mzhul0p+0qmOhXm0kyo6vCQ2rUwp8fqA4bdl LSS1cE2ZPvciVJLsrZ7d9fgVaRSBfn8bfgzTS7uBA/IAYiej6X+Cu7dhXj89waMb8qdz Ug4VJOAICxVtD8uQ7mVzTT2QnxeyQISPiCUuBUd0o8cJIvYpmj6b/OQ/seKVdc1ELQTO kNaOoNkgkuqeed0jpa1tyRJqlXCre/mWQdF81pqs0pSXy0hGfW8aJaXWpfvGKYCyNqWM iDXQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=bp.renesas.com dmarc=pass fromdomain=bp.renesas.com); spf=pass (google.com: domain of linux-kernel+bounces-140372-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140372-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id dr8-20020a05621408e800b0069b14f4eaf9si1319135qvb.155.2024.04.11.04.46.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 04:46:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-140372-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=bp.renesas.com dmarc=pass fromdomain=bp.renesas.com); spf=pass (google.com: domain of linux-kernel+bounces-140372-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140372-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DCB901C21800 for ; Thu, 11 Apr 2024 11:46:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A5A114D443; Thu, 11 Apr 2024 11:45:10 +0000 (UTC) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9D50B147C9D; Thu, 11 Apr 2024 11:45:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712835909; cv=none; b=lY4OCIuidVC5t1NpUxci22PgececBhEv6XZTnC06SP+3NEpFa/Ni20DZnzozASefhgwnXG7cjArMgBn+81U9/j82tRarHVwfkROVg2B6uMNYb2Y6aXD17ElaVipHrQZzQ1MU7T8ha/QDuHmjqtJiQd+SNxY6RFrIIMqOLaT2p84= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712835909; c=relaxed/simple; bh=vnqWqqap9+fQ4BzCnsXTPQ93EcTt8RJgBFAXaAY6kT0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fhmv1usktw67TyYezozZcxud25gJ18T7kNoa+5df+zMg2IA5dKgvxqbUyPst0Vr2nlt8a0zaGFhwd4GcERyMXSPzOvCKNtDoJYFpjgTiAsoclGcJRtIPDAcwuAPFV6vZk1ptwlfvo8oOJngmLJN9JE/6i7tFraaux00hac7L8kU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com; spf=pass smtp.mailfrom=bp.renesas.com; arc=none smtp.client-ip=210.160.252.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bp.renesas.com X-IronPort-AV: E=Sophos;i="6.07,193,1708354800"; d="scan'208";a="201123388" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 11 Apr 2024 20:45:07 +0900 Received: from renesas-deb12.cephei.uk (unknown [10.226.93.85]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id B5E0D4202AC3; Thu, 11 Apr 2024 20:45:03 +0900 (JST) From: Paul Barker To: Sergey Shtylyov , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , Geert Uytterhoeven Cc: Paul Barker , netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net 3/4] net: ravb: Fix GbEth jumbo packet RX checksum handling Date: Thu, 11 Apr 2024 12:44:32 +0100 Message-Id: <20240411114434.26186-4-paul.barker.ct@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240411114434.26186-1-paul.barker.ct@bp.renesas.com> References: <20240411114434.26186-1-paul.barker.ct@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sending a 7kB ping packet to the RZ/G2L in Linux v6.9-rc2 causes the following backtrace: WARNING: CPU: 0 PID: 0 at include/linux/skbuff.h:3127 skb_trim+0x30/0x38 Modules linked in: CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 6.9.0-rc1-00222-gde11614025b1 #3 Hardware name: Renesas SMARC EVK based on r9a07g044l2 (DT) pstate: 20400005 (nzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : skb_trim+0x30/0x38 lr : ravb_rx_csum_gbeth+0x40/0x90 sp : ffff800080003d40 x29: ffff800080003d40 x28: 0000000000000400 x27: ffff00000d0f0000 x26: 0000000000000001 x25: ffff800080003e84 x24: 0000000000000e52 x23: 0000000000000000 x22: ffff00000d0f0960 x21: 000000000000ffff x20: 000000000000f6ff x19: ffff00000cf4cb00 x18: 0000000000000000 x17: ffff7ffffdd4f000 x16: ffff800080000000 x15: e7e6e5e4e3e2e1e0 x14: dfdedddcdbdad9d8 x13: 0000131211100f0e x12: 0d0c0b0a09080706 x11: 0000000013121110 x10: 0000000000000000 x9 : 0000000000000001 x8 : ffff800080003cf0 x7 : 0000000000000000 x6 : ffff00007faf4590 x5 : 000000000010000b x4 : a1a8362deecb53ea x3 : 0000000000000080 x2 : 00000000ffff0000 x1 : 000000000cf4ccfc x0 : ffff00000cf4cb00 Call trace: skb_trim+0x30/0x38 ravb_rx_gbeth+0x56c/0x5cc ravb_poll+0xa0/0x204 __napi_poll+0x38/0x17c net_rx_action+0x124/0x268 __do_softirq+0x100/0x26c ____do_softirq+0x10/0x1c call_on_irq_stack+0x24/0x4c do_softirq_own_stack+0x1c/0x2c irq_exit_rcu+0xbc/0xd8 el1_interrupt+0x38/0x68 el1h_64_irq_handler+0x18/0x24 el1h_64_irq+0x64/0x68 default_idle_call+0x28/0x3c do_idle+0x204/0x25c cpu_startup_entry+0x38/0x3c kernel_init+0x0/0x1d8 start_kernel+0x504/0x5f0 __primary_switched+0x80/0x88 ---[ end trace 0000000000000000 ]--- This is caused by ravb_rx_gbeth() calling ravb_rx_csum_gbeth() with the wrong skb for a packet which spans multiple descriptors. To fix this, use the correct skb. Fixes: c2da9408579d ("ravb: Add Rx checksum offload support for GbEth") Signed-off-by: Paul Barker --- drivers/net/ethernet/renesas/ravb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 028ab5c6aaf7..e1e39f65224c 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -843,7 +843,7 @@ static bool ravb_rx_gbeth(struct net_device *ndev, int *quota, int q) priv->rx_1st_skb->protocol = eth_type_trans(priv->rx_1st_skb, ndev); if (ndev->features & NETIF_F_RXCSUM) - ravb_rx_csum_gbeth(skb); + ravb_rx_csum_gbeth(priv->rx_1st_skb); napi_gro_receive(&priv->napi[q], priv->rx_1st_skb); rx_packets++; -- 2.39.2