From nobody Sat Nov 23 04:55:22 2024 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013010.outbound.protection.outlook.com [52.101.67.10]) (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 30B231B4F32; Thu, 14 Nov 2024 22:53:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.10 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731624798; cv=fail; b=frZXUZGxgYNLms5WdibHTL2KbQuHyqi7sGCNOThU3o+c1Bc8j4MudfYsgCFysdWgPSqOw0fYfEJx2QrUwWM7UNKDWxHSkdxs42JiA+RNxjJmH9Hqmuwho1TyJ7L9QESpP4XXsOV8vGT3pkJBjvRGUJYLVua2IuK+5hWk1B818UE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731624798; c=relaxed/simple; bh=oknEewV2xVMtzJTDODMiOCPDBkOTwQAdC4P3/r2BxdI=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=gZNb/lxh9R+NdRquq3uKpSvjOzZTKPri8feugf7MpAxODW/i3fM9JDXkaUTZoiYtiKKqvxrCzIWPqcEIXdZFi0NAysLH3f+R/tMG+fIypCN8iJZtsU9pKnuUvg4UL2WGLuT9QfVIjJJQDisXf97LjYwGR/XuNMSzu12LDXQYIuU= 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=M/q3eAz5; arc=fail smtp.client-ip=52.101.67.10 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="M/q3eAz5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Bim/R/MIQz3nQD+OPU6mZEsrHczy/f2NNb5+5/g55MNV9dN70P1WZTELW1Dmfp0sv2Kgu+lzeECL7kjWpVP2STQtiXW0mLqyKDUpLHiEC4Z3jiPJfRsy0BZ2+DwdqI5OAQATHfl0E5bXD9STY0XbfTTuZu4QZh/0QUjq3oszqX/PCVg5NZsWSyg8Y/fb15MEhAwWzA6ErdZ2LXbQA2nm5y6/laqFrn+qFtyQCC2WcBUtbWqnhDJ6lLwFW0CXuDzhtPDOoOgauHf19tV22GnrwWX/0FKCLBGqU6r6bbAzn4nk9h1DbTie4D/IbT8RGO9fzt072GDBIuIlhzjKmB8CgQ== 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=S0okuXE5bsrRrOlA41c2rexmWqw6sMQqJ3MoKe+r0Ws=; b=JdwaH6aogcLvESBeaAM25AWtLfkINg3ySUAq8AEFjD2V12lNvqNbCb7hL3hZq4bGeT+pv+U0z6FRO1vJwXgJ5RY0Xry7OS2YpKt6p9mInrlDS6kOu2u3s28y3EbsoFCufmM1kChktjk6nA3ozEs1BRokiJV2sAAkp/unp8uVn+OCqsBCX2QVo645g4lu++/O5vr7uKbn9e3uBIcGdVjXuNz7xJsBzxaITuqDUT8lYlz/LBPyw5ZRTzPvjCHQKOSC3NgU/eS3R8ZSFff5NyndKKk5x1BQvG7nervZw4CjppWY3bwp+io/iX9TEYJXyUEOvDJ0paJQQ94s8vTvmDn+pA== 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=S0okuXE5bsrRrOlA41c2rexmWqw6sMQqJ3MoKe+r0Ws=; b=M/q3eAz5CMimhbmjhfobDajo0uxzV2UlLUikN9RyLJ+COn2pOvivLi6e3rEpNDHF/RvwoXYgfpr4XpMUfBAQXqx0Y0mqHMeKBB5OI+aF2oLbKA1qQaZmQHxrx+zBiivOusl7RFANlAF1SN7DyRhHMgoDje2upyDoP7oZNPchUtYq5RNoOPPaLdm5BEBKj3fmBChGEjR1CQxaBrjV/mYk8xIE4Mfk+Mv3tojHCds71NwpWhCOaK7rnJmm3IoJ9po97+z4qlKnAFcxtrVdN5RwmVYxvJjFWmqI1/ckEhqbmr4qWF0mwOkWifPN2zyvrK/eqi/UWwjIA15NjjFPoOBEXQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by DUZPR04MB9967.eurprd04.prod.outlook.com (2603:10a6:10:4dd::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.17; Thu, 14 Nov 2024 22:53:14 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.8137.027; Thu, 14 Nov 2024 22:53:14 +0000 From: Frank Li Date: Thu, 14 Nov 2024 17:52:42 -0500 Subject: [PATCH v7 6/6] tools: PCI: Add 'B' option for test doorbell Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241114-ep-msi-v7-6-d4ac7aafbd2c@nxp.com> References: <20241114-ep-msi-v7-0-d4ac7aafbd2c@nxp.com> In-Reply-To: <20241114-ep-msi-v7-0-d4ac7aafbd2c@nxp.com> To: Manivannan Sadhasivam , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Kishon Vijay Abraham I , Bjorn Helgaas , Arnd Bergmann , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, imx@lists.linux.dev, Niklas Cassel , dlemoal@kernel.org, maz@kernel.org, tglx@linutronix.de, jdmason@kudzu.us, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1731624768; l=1850; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=oknEewV2xVMtzJTDODMiOCPDBkOTwQAdC4P3/r2BxdI=; b=9k/vJr6UUB9pNZzPDpHLHIM0mezAXfMKXbugs9YpjsSgJjN+MFI/oSSFlf5lys+74e3Jkh3q9 k9Yx5SJu2KlBdklaDsa/tIv++BjhbR3QETAJ6uEYExaTrc2CCHrhExi X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR03CA0166.namprd03.prod.outlook.com (2603:10b6:a03:338::21) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DUZPR04MB9967:EE_ X-MS-Office365-Filtering-Correlation-Id: dd25aa24-1480-4fb6-0de7-08dd04ff1f5c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|52116014|7416014|376014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?TnhOQnF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SFN5R09sa0RiUnIrWHhhQmNjdVpC?= =?utf-8?Q?HL/ALBUtWfoOj7vQrhBg/Ub56HiHVP52PKba4=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(52116014)(7416014)(376014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SXYyb0R4RGhYNng2VjlJZHhaeko0T0RyMWliWEZESmk5MVhieW5ON2F6WHZq?= =?utf-8?B?Tzg4aHEwci9SejFJMlFGRXBLdys3MFlqb3hjdGV1N2ExWnNOeHNGcEs0c0VN?= =?utf-8?B?a0MwQkZlOHJlUjl1cmRmZ0hpenVING9WVVpZQUR4cEp2YlhmNG0wYUI0eFBF?= =?utf-8?B?QmdxbktpL3pLQzdDQWt1R0xXQWxYNk5zTndaWjF3Z0s1QmFNamNWY0NRRS9y?= =?utf-8?B?SlVUbGt6b0ZyUnc5OHdVYlJvOFBVYlBaMmhvSHkvYklWQW9iU2l6KytwZjlJ?= =?utf-8?B?RlpNNEc4dXFwTUlRa1MxbGM5VUY2V1gzKzgwL1o4aGJRN1JKMzNNTVJGZnh2?= =?utf-8?B?eEJucHVOZjlyREtEYnMrQ3BLQmV0djdRdEkzL2ZWcUtwYmxjU0hHU2tIREJI?= =?utf-8?B?SDhBU05oNHpLSDRUaUNyV3Y2Q0p2QXFDNUJIWHpLOVlMZ0I3LzhUcWVYcnhF?= =?utf-8?B?YXRDT1lHSTQ5SWdCZmxHWjZUZnBncjJmNVJDMERCaEM3L1FzVW1KOUJyVFFZ?= =?utf-8?B?L21zODlrVXlZempkdHkvakljeDNRWmdxcjk2MHdwekdVOHREWEgwSjhES0Np?= =?utf-8?B?cThIYzhDd0FVNk81OHFhY01tR0lmc295O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UG9IZW1pRVh6QTNnY2RRZVNQZk1udmJsUVVjWGdj?= =?utf-8?B?S1B6cUcwc1Z4UGJkaVBzRk1ZZEIxcVoxSm43WUM1bDh3VXU1L0ExK3V2QXZ3?= =?utf-8?B?bEZPc3cxNDM5c2pQMExGQm9BMWEyVmY4Q3RsU3ZuNU9rRWtXZDdqRTRYMDZU?= =?utf-8?B?MHJFRzlwVS9DV1NaYkt4VjNJWEFwbzZSSEdHM1BNNjRVb1lQd0VRN3FFeHlz?= =?utf-8?B?cUMvN0JNVnBpQWM0YlNSYXhQb085c3BXUFJYekpmZmhVZWJKMlFpRytBeC9y?= =?utf-8?B?d2RuN0dDOVJxVnAyakhVS1kxU3Z4VFNmVnJpU3RDL01raVFZbVRGSzZrSDJ6?= =?utf-8?B?TlNKdXNGbW9Pa1NPRlkzc2RmYVA2NUZ1Qi8rMEpCRHFFZVIrVTZiakZ1emFh?= =?utf-8?B?THBmRjNMTGhpVjQrVUM1ckt3N2FnM1NrMkdRYmxRRDdSM1ZvN05aMmtGN1Za?= =?utf-8?B?WjBYcmgxKy93SmVTWHFQS3ptcW4zNWtyWFQ3RlVlZGRpVXE1MEZHS01KZ3pB?= =?utf-8?B?Tys2cmtqa3lRU0xsOEZWbXdtTjRTcit0ZisvYkwvTHUvQ29TMjVHdVlJK2dk?= =?utf-8?Q?PnZc=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd25aa24-1480-4fb6-0de7-08dd04ff1f5c X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2024 22:53:14.6983 (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: fzELQ5OxVBQ+sNN5x6IdbyW3SK/GY8pkAy+pficpgLFMmkux3sy+bBMYljvJcWCVqeBtin3/3hJp0xRd+C/0Aw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DUZPR04MB9967 Add doorbell test support. Tested-by: Niklas Cassel Signed-off-by: Frank Li --- Change from v3 to v7 - none --- tools/pci/pcitest.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c index 470258009ddc2..bbe26ebbfd945 100644 --- a/tools/pci/pcitest.c +++ b/tools/pci/pcitest.c @@ -34,6 +34,7 @@ struct pci_test { bool copy; unsigned long size; bool use_dma; + bool doorbell; }; =20 static int run_test(struct pci_test *test) @@ -147,6 +148,15 @@ static int run_test(struct pci_test *test) fprintf(stdout, "%s\n", result[ret]); } =20 + if (test->doorbell) { + ret =3D ioctl(fd, PCITEST_DOORBELL, 0); + fprintf(stdout, "Ringing doorbell on the EP\t\t"); + if (ret < 0) + fprintf(stdout, "TEST FAILED\n"); + else + fprintf(stdout, "%s\n", result[ret]); + } + fflush(stdout); close(fd); return (ret < 0) ? ret : 1 - ret; /* return 0 if test succeeded */ @@ -172,7 +182,7 @@ int main(int argc, char **argv) /* set default endpoint device */ test->device =3D "/dev/pci-endpoint-test.0"; =20 - while ((c =3D getopt(argc, argv, "D:b:m:x:i:deIlhrwcs:")) !=3D EOF) + while ((c =3D getopt(argc, argv, "D:b:m:x:i:BdeIlhrwcs:")) !=3D EOF) switch (c) { case 'D': test->device =3D optarg; @@ -222,6 +232,9 @@ int main(int argc, char **argv) case 'd': test->use_dma =3D true; continue; + case 'B': + test->doorbell =3D true; + continue; case 'h': default: usage: @@ -241,6 +254,7 @@ int main(int argc, char **argv) "\t-w Write buffer test\n" "\t-c Copy buffer test\n" "\t-s Size of buffer {default: 100KB}\n" + "\t-B Doorbell test\n" "\t-h Print this help message\n", argv[0]); return -EINVAL; --=20 2.34.1