From patchwork Fri Dec 20 09:18:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 13916407 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011052.outbound.protection.outlook.com [52.101.70.52]) (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 8C19F1A841B for ; Fri, 20 Dec 2024 09:36:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.52 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734687376; cv=fail; b=r2xyj28zfXavW9JSZ4oNdLCtkDLYwtM9fKy4y14IgWuXGmugg7vvRGQuIREeLHahQlAYzZjgPokf/ETaV2o8QOMWWA3/1fxxBOhH+uvtmedrHft9Eri4RoYQSABOcW5veo86qHF6wCzj7uI8YsS8t4resxCsV4YB2jCmCociymg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734687376; c=relaxed/simple; bh=t95/TClJPZIvWeuRdlrksawbmrXagTjQXpsb9SUvOTY=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=PEHkl6LVtSpMdRQXAX+qp6+CISiQp9Dak6YVEwn+lxSZPYRCCvX96P/H6WoXMdkYVhDCRwu468mCbz7FMtpHoBcaU4dPEkkXH0b/3tRqE8BbCHoXzf0f5wNLq/y8LIhN6QpsVAjvK71gMUxX8/0Bsn4IXrkD93zzzwp3dB3TXpU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=k5DpVzoJ; arc=fail smtp.client-ip=52.101.70.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="k5DpVzoJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SiglDt5N7Sk56V3xBD5xN+ct4uLF5pX5fz5r2/iKn6FBAvjT+zR1gfJAvc+VZ5xbXVWDir2zV6Ox1NXfQla7IKeQZvM3vTkUyum6jwyYVItq5wao4DVrNAi1llyxzjgL1qXZwT++vTRPZu1Jnzjb+qNoEoKluR2DmuNnk7KFCAw2bQwfvObjbsWftm1Bkc7t8pXRt8XXnp7Fy1WIL8QxvWFxa2QSVQnS4O4fEmAwcruLgKEZemlrnNmZFZSsw/R7L2LZdvuP2yjQaAjxzDDmKt2IAFJNH9sDJaaWLQi4J/yUWpeAaf6SwgVHSZ3MxNv1QHVsXNsqC0XcBTP8ySR4Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=O/FlyTJUC3wJeeKxFbl/Bj4pj/DLPbPYuLp0tQ+Jd4A=; b=T+vfkOLgkpRf71dP8M1v75fCV6CMfcv2H10+b49XMNK0DbldfyYiVGNf8bGdkRLK+2oXj4OUMVZDosDwcd3b/DBrIqjDaArpryrhw4y1PpNJ4RZhRc+b7Q8TAG74x23dmOinR4SqyG9LZ65t9gWHNbmoaaQtUntjY34jfCq7/MUVN/UozkyVjX6cHXi4LHFkJvBBrV9mu10HQSjoOeId3XF4fxqtpMXos9i+fDy/TTrBWoStB/d6MxBwqbyzcdJe7wufyFoJ4prrT5dQ7CxNWRnctPX0Wb5L8/SJf4OjPHpShFByf9qgTA0BH2tKyiXMYOSevnflLfVLENe/p8EiUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=O/FlyTJUC3wJeeKxFbl/Bj4pj/DLPbPYuLp0tQ+Jd4A=; b=k5DpVzoJkMOp34Ui2dBj50sTohp/iWQlo0+JXNFH+ey6/Zk6R8JWn9r4oKgJAlc+G+BHKwjWBtFnvCaAwl4uX8MYb82Yt3DqZ6c9fwsReNHPNhHz6b+aTY+KhFtysNOdfOaUNAFDYZx4N9r9OWE3ko2Mw/Vg0l1MA7AtncmcNGaNo8tZuMeY8M2UblpdkDBOGg+I45pt6OSF8Mv40E6nysj4Z3FnwG5GOrtFUo4y1Hc6BN/eGmfY5xIisLoWGA56WpLFmcpjIJ1Ljp6okM7gh7hoRjQiRZ76g1znlOBROFxx3yQAaE+spsG+wY36A666RQwy6C+qt5IamB9vN4lQew== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) by VI0PR04MB10292.eurprd04.prod.outlook.com (2603:10a6:800:243::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.14; Fri, 20 Dec 2024 09:36:11 +0000 Received: from PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db]) by PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db%6]) with mapi id 15.20.8272.005; Fri, 20 Dec 2024 09:36:11 +0000 From: Wei Fang To: ast@kernel.org, daniel@iogearbox.net, davem@davemloft.net, kuba@kernel.org, hawk@kernel.org, john.fastabend@gmail.com, andrii@kernel.org, eddyz87@gmail.com, mykolal@fb.com, martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev, kpsingh@kernel.org, sdf@fomichev.me, haoluo@google.com, jolsa@kernel.org, shuah@kernel.org Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev Subject: [PATCH bpf] selftests/bpf: add XDP_UMEM_TX_METADATA_LEN flag to umem_config Date: Fri, 20 Dec 2024 17:18:06 +0800 Message-Id: <20241220091806.1856223-1-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SG2PR03CA0113.apcprd03.prod.outlook.com (2603:1096:4:91::17) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|VI0PR04MB10292:EE_ X-MS-Office365-Filtering-Correlation-Id: d58fb74a-144d-40c1-ebf5-08dd20d9bd4f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|7416014|1800799024|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: nA9mJ7xpVyCgymRuDZhIZwl0EjZKFeSYdjtgPML7RwkM5v4OcPMneDaavVd/V21mGHFze386xV2dbhp3+Cs/NJ+L8m2tHen4vu3bRAH93lv19No4a5A50QPrr3D/goO0g7Q8Lf3YVLUDyvt4ZlvaktuZN9gYPSWjVTyRgHTUQkkjP3DY1g7nNocsdMkbpW7Z6yoXvz49rrCsT7rusaSTQHqeApWjg9Bh5eUpJW/YWsteIpXuyThpCPB8ruwLmQQzW8rQmZ+RMAfzfg0VLRJ6zKM2ZbCeL6A3aYjdnTNjutEtp3OXWw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nr9EHpZKdUeQZBgauCjzn13kd8ZTzAV/Md/3IU+RrSfAiHMVf/j+KMMSPRBI7GWKyzLmlePM//BEX X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8510.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(376014)(7416014)(1800799024)(366016)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: iWWTXCWj+Y50cTeTPYfTUhskwuIBx2MTrNH5lgrs/aKhBhEwaVOUD5lWxv5oX7jj+fDrhB1cyML6fs11lP43tSx5AQTUEnW9r848hIAyt21CdIx7vsp97arS5CJSg9yXeL7U6Bl5yPOAH93l8NVKB57zU+TjpY4O5SlX7RVIoXXKFGszf18zn5FuvDLZHd21aUhIo0k0NyZNzXZJh0PEdr8m4tuU6SllZlm8+u7gUq7VboJcwRjlV9Snlmch9NJNOvNb48XideNoxCvmXqevu5+gWbzuSpGUQr7L+E6i6O2bYLuaYl1DmmCEyZVeaTrgnLCV636lgE9PwAAWHlm3vyKAO588Rv7n30kI4QatplsLVx4eY4e0ut6g5gNvhmgZgKGHrYrXbKD8qyKn7tgp6euTWqK25bnf0onmLwH4GKAOnFExSeMwOZVDICVdAIHNXIZ4mOD3llxAND2hDLj9Nnzwg0X6l46ZPqF6QUuYPZ+mCMBQLbOQCQE5yMU661sE42r8H5A3+WsYsWxWH7d4TTcIjjCGgetjKtBv6oG19WieCEf74jh0o9uYxW5Dp4mH9TqlAaBYvguldpSC1ThZFfMcSMuf5DgbhEFh9cLWZWLyxZLcoT+wpM6SZHtyxTqyG8cdoyOzK5srZo0bfTh+ubbZlroVhQLggMDwCjQWGz/Wqka1jKvY9a6WIdohXDlvNR+yel6E1uFOXuYdnQDwysX2sV7oEQiGfLw0pvI9wgXdNo7QEapxESVU+4ovqVvguZEvP0YBZq0OrSL3VMzqaEtxF0HzPQNKtH3x1YTvXuYkRcFsAxsEkh4rbYvMBr1pHChofAqYGhlmPr6yk6DnRwfA3cnvvoxyysrUPa79CTp2eNJ8o8V81kEBDEp2nIVd8SosspulC0rhZQ4iCz5UePXdNLbV+gqyYRU5xZnZaIS4xSMBhxJzkrYeZ7JJCKzLhBPzU6v/PJXVpNQRzJzXLC7VHGHTZT/qVqElDJYi3uJ2eg9IXH2PBSlKkEjmGvdknGu3Gs3jyA8nTtmMU7Tn44RGZe2fbUtDgO5kIO80gqdEyjjvfYHIOROJOBAWGb+ehUX5S6daVmMli1mCfOyE4mQVdCzybG2Zy9bOqpn+sOXoza9e0yqTBY/WdK4VrKnrjW2Q5q/NzT1e5SWdCoN+oeFWFDLRIPnuoqPgjRWwZq2tSpPjO+O4bzuqmmW2b/hRv4ex2HM0t0Jt98SxrXu14qeK2OfK5v82paqogsM1Uq8OTwKHCE6Gwx5MHNG5ALYDfs0MUG+ysA5ref7Avj/QYXlmmXRA2yLaK6uDKT88PoL137sXcP5g7RcwzqUwRI8xsl7n/6cgJ4A69zY0ett3mtz446RiIqmsaLZok4NDizoTN1kmIiQArJi9zVFpc8zYsLzdIbJdSNLZtqH1Dh8wujXbHN4xH1ekCzLBZ7lPNofeUTeww/0ZbAUlqnuZYYqsZNrhpGwICQnhbt075S3/+dA0oM6z9VgTRPDc8dcWJiD+UO6pfL+XL8JkQJ2Cb/LUJnJ4lpkfyQ7OpX0rKSUw1D662dnCyPalwFoguAubxg3UOfGAQGcGHZ+SCh468jsk X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d58fb74a-144d-40c1-ebf5-08dd20d9bd4f X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2024 09:36:11.5684 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: U5HK5MCV6LPb6JGc/wpCRHgZK/aMLzxyPPghGqm19pZSC5Vxz1k45qzQpVzGZDIU6kUnpvf85E9NVGvgKhccwA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR04MB10292 The Tx metadata test has been broken since the commit d5e726d9143c ("xsk: Require XDP_UMEM_TX_METADATA_LEN to actuate tx_metadata_len"). Because this change requires XDP_UMEM_TX_METADATA_LEN flag to be set, otherwise xsk_buff_pool::tx_metadata_len will be initialized to 0, which means that the driver cannot get Tx metadata and cannot execute AF_XDP Tx metadata hooks. Fixes: d5e726d9143c ("xsk: Require XDP_UMEM_TX_METADATA_LEN to actuate tx_metadata_len") Signed-off-by: Wei Fang --- tools/testing/selftests/bpf/xdp_hw_metadata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/xdp_hw_metadata.c b/tools/testing/selftests/bpf/xdp_hw_metadata.c index 6f9956eed797..ad6c08dfd6c8 100644 --- a/tools/testing/selftests/bpf/xdp_hw_metadata.c +++ b/tools/testing/selftests/bpf/xdp_hw_metadata.c @@ -79,7 +79,7 @@ static int open_xsk(int ifindex, struct xsk *xsk, __u32 queue_id) .fill_size = XSK_RING_PROD__DEFAULT_NUM_DESCS, .comp_size = XSK_RING_CONS__DEFAULT_NUM_DESCS, .frame_size = XSK_UMEM__DEFAULT_FRAME_SIZE, - .flags = XSK_UMEM__DEFAULT_FLAGS, + .flags = XDP_UMEM_TX_METADATA_LEN, .tx_metadata_len = sizeof(struct xsk_tx_metadata), }; __u32 idx = 0;