From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 274BD3BEED7; Mon, 5 May 2025 23:23:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746487421; cv=none; b=oDwyfUZ1TB+tDFrDWrM/2Xy+kdYiovFelixLMgAZ1r0cRyJK0hYUS3SRc9Ha6m/zNJtzHU88+eDTHADYujImzig0f80+mkkza7BwMbKt8RFLsSRC9c9k//SCvKGR55ZB9q/wo41hm7mBe2kYNOIPfnpMzfPtc1elIsP/X4QZFPg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746487421; c=relaxed/simple; bh=ej3MdU1zOoJOnH+5G83oWr8cksMgqKvy1/A008AgEGg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Sy+iyAMYeBk360Hein95WqTO7Y58xr5wGT8L2a45+K6wTv1Ds38yuVaKivLrKm/0pJmG5UYbTbycq3pQVFHiJoZWGWepaJ3Ppqm7XiEv/yB8KejWdvavRutUU5znA/MMU22dAH+f5SqJPgJfOpK4uJ15hZl8GhkOMuh4BYOV2SY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=e5eIM//N; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="e5eIM//N" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 878DEC4CEED; Mon, 5 May 2025 23:23:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1746487421; bh=ej3MdU1zOoJOnH+5G83oWr8cksMgqKvy1/A008AgEGg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e5eIM//NUAKw71k91ai4U5q0BsbdzCz5WV0DcOh0wCwbrrMt2xJRxdb+JaP7bIwaB K2gU7dslGp5pp1LFRbwBrTUnac+bBiEECoPbaviQe8P7paZK8Ii8uEdCLwH1OvwefN gqovg9KlWlRLTpyF34iWRMIT060mKArkA0fXmX+m0aiW4KlDseSajWI4NK843zXW8V 5jNsRlNbWFp3UYVlLVe8LzxgKBlKIRfYOoN+SQ8prR3XUceHTd4+7PWJeSyncDmKL/ ILBgSM8LQVqcltfqlTIrEGfhohZtHm9y7zkdoHAOHEviHSUGf06qI0w/UTJZNc5n7+ jdi9bH0OAqn7w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alexei Lazar , Dragos Tatulea , Tariq Toukan , Jakub Kicinski , Sasha Levin , saeedm@nvidia.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, netdev@vger.kernel.org, linux-rdma@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 62/79] net/mlx5: Extend Ethtool loopback selftest to support non-linear SKB Date: Mon, 5 May 2025 19:21:34 -0400 Message-Id: <20250505232151.2698893-62-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250505232151.2698893-1-sashal@kernel.org> References: <20250505232151.2698893-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.4.293 Content-Transfer-Encoding: 8bit From: Alexei Lazar [ Upstream commit 95b9606b15bb3ce1198d28d2393dd0e1f0a5f3e9 ] Current loopback test validation ignores non-linear SKB case in the SKB access, which can lead to failures in scenarios such as when HW GRO is enabled. Linearize the SKB so both cases will be handled. Signed-off-by: Alexei Lazar Reviewed-by: Dragos Tatulea Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20250209101716.112774-15-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c b/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c index bbff8d8ded767..abb88a61e4d98 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c @@ -189,6 +189,9 @@ mlx5e_test_loopback_validate(struct sk_buff *skb, struct udphdr *udph; struct iphdr *iph; + if (skb_linearize(skb)) + goto out; + /* We are only going to peek, no need to clone the SKB */ if (MLX5E_TEST_PKT_SIZE - ETH_HLEN > skb_headlen(skb)) goto out; -- 2.39.5