From nobody Tue Nov 26 22:40:59 2024 Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010038.outbound.protection.outlook.com [52.101.69.38]) (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 81F181F80C9; Tue, 15 Oct 2024 22:08:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.69.38 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729030104; cv=fail; b=uxI/J0Z4r5HfjavCa+HVxqe574YnX1qsrq1/PipLWQ3AdOlArrZQ877KA/nRANODPdyeS1nwC3EZIERf+gWHKYuZjQiKQeocoXFeOsSOaybe+xK831WWybcHzdUmxRcYTzWL1MZk/wSf1f3iHgEZH/KohA8RWHE3PMLAa2Xptz0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729030104; c=relaxed/simple; bh=oLfeRG2JJa/EVak0ZqRbgfNgEQ6xhDK04ybgk4QBnh0=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=cLrrJ36LvMGMaaNTZZXXaFAV/pOHD/bXkEgTGscFeju7fbIoRnJr4eJYEaGQEuQkzWyUvrJp146eQIjh88N/xlEQVPqiaMqdP7PRwee/95C0AAs7S0EORWyMWtolZYJoAw6srkqe5TH+zClUJkWPvIHOOTfLagCvQhm27cXezoc= 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=KYtdnDXi; arc=fail smtp.client-ip=52.101.69.38 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="KYtdnDXi" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=s8WBViq283QXcCinzg3aplHWoRzFUnl8i3FDBhYiPtKAA9xSSxhDdmjI6DIyF7iXNpjo5MRPjpzMp8fqHSyxYspk0LnzTRM4fYBTr4IEQObc5Zo3Z5dVH4X87XtnaaVCA1mkbmcRdQCl+Z/WjnSeMuHZVI97dd68hTDUNAz8Xy39jCGt5noXY4tcAitreTSlHQw5VKqS+WXZ611lQuks8BkhppqLFg+rhCptvZ1b5sgDHOi0J5HxHoHYaQETpCiKzcbPZqbmFYuwp9g2MCdmrGsXweXdje6P8PU+aM2XBQ/jFHTeLx+Fz7qG4wXV/Yq71ubF4KtGtsN4I1or74GRqw== 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=HRw0nM+ngMAE6u8ALv623oDL1F1mp7li7piBbTWnJ98=; b=w4A3a/zZKuEeGeqz8d/W1Qx4TIbXkAtMNpBOtpd6BPzNhWiN+NEDxoT2vmZui3/cYGqify9UMilIvC3NZLV7//+vCAsvKVhS8q3KRVjcTIPKookdoDE1Ag8EggZ/Zj9YUuFdSsBftCL+ftni5kXZtg4C9Bfv78TV8kVLwyrKAIUoTk0aIJCGxMz3IbpUg0FpHjRLpgfwUCSuYKEGN4RjncaV3ayRL98bPPRElWBwi7t/n3KTn8q04mmwnJOKMJoH4lOUuPPA1sp2ad4mozlkbKHC1IUs0XDaqnYpxaEQcYtMg9RfP+gQeXoPxcZEo4DUP3xU4EtvpqdpaVe8UUEdJw== 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=HRw0nM+ngMAE6u8ALv623oDL1F1mp7li7piBbTWnJ98=; b=KYtdnDXiQaRnKJ9eb98BnsnQx/tg7iTwqStAs+4LOCVuFjsog2VSuR+2P2AwUSWtjdAqmECPATtx8I/NWWbbFU1tmGavZQKfKjaLhhKeggCQSRqJ4BARj0LGAFJICqBpYku6nKGl0976/AI/k3aYBGVhT1LXyXYV5vL68LVkQ6nfQuZPhOVnNEpo+Bv79rbX4EZ03kqpLIpTaqvJwFrB9KZmrk9uZ7+e9Duo/ypvKqFApgqG7DHsFET221fTOfPng0LyNSsdIoyC1KtJVTPMo819spBEd5Cmv69tDvuLPGyzORKxbVmRpQrEIwZyzPZYh0DnG0LTq3fe23zryhGNAQ== 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 DBBPR04MB7788.eurprd04.prod.outlook.com (2603:10a6:10:1e4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.27; Tue, 15 Oct 2024 22:08:21 +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.8069.016; Tue, 15 Oct 2024 22:08:21 +0000 From: Frank Li Date: Tue, 15 Oct 2024 18:07:19 -0400 Subject: [PATCH v3 6/6] tools: PCI: Add 'B' option for test doorbell Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241015-ep-msi-v3-6-cedc89a16c1a@nxp.com> References: <20241015-ep-msi-v3-0-cedc89a16c1a@nxp.com> In-Reply-To: <20241015-ep-msi-v3-0-cedc89a16c1a@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=1729030073; l=1769; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=oLfeRG2JJa/EVak0ZqRbgfNgEQ6xhDK04ybgk4QBnh0=; b=ggtUqSjG0x79ltLdbRziV+1fQMtLGonP7mytNXC8zbANXa9FirOFw5AzTBQStHed8I7eXFU4x 3OLE48THL6dDKyaXkJxOOuEoKxuWLFFdAQrxKVHBU+4XNxPUlWck2K4 X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0059.namprd13.prod.outlook.com (2603:10b6:a03:2c2::34) 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_|DBBPR04MB7788:EE_ X-MS-Office365-Filtering-Correlation-Id: c910bd8f-30d0-47f0-522d-08dced65e172 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|52116014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?TjR4RlFvWUxBSkx0bEZRSGhPU21JY01Fam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zN1WGJwaU80elVUMUh1dz09?= 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)(7416014)(376014)(52116014)(366016)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Z3B3bUwvcWxtQ0tYdFZLMHpvVGJ4b2JUV1lzT0o4U2UrVXIxVU5PYUR5SXds?= =?utf-8?B?bWZhaVpJTmpzOVFrYzdMT2J3WXVrekJ2cllJbUJuaVJxRmJ6U2N3SENMb1B3?= =?utf-8?B?NE4xNWxrTjEycG5MK2ZsQ3JqOU5IR29uTVY3bWw5N3dFL1MyU1V6Z3N6cmJo?= =?utf-8?B?anJscGVTT1cxNjFMWUl4R1dpOUdjVXNNemt6SUc1ekUxRFlTc01BZ29YNzln?= =?utf-8?B?U0ZhbTVkeTloUkZGZDlnYnJhOVlQYVJ5Q0pYVkw0bXpQL1JZV1pZOHc1NGt4?= =?utf-8?B?Vk4vbThZWlJSakhzM3FxcHNqVXhwQjBJcm80NVBZNC9DMXVDWDdjNk1Kb1FZ?= =?utf-8?B?MDVaYTJsNEIrN21DcjJLa0tlaHh4OURzOUJEb3ZrcW1zaTRYMzlGNGpwTXdI?= =?utf-8?B?N2lEdGk2QXpNOUNIU2NQY0Z5YzhuR1paVzJPTEFhbHFZcEpXd25ZMlpSclY5?= =?utf-8?B?WlRlbmprVVR3QkkzY1NNVGdzNzExbHNENk9ENEcwRTV5ZzQ0dzZzWVM3WXd0?= =?utf-8?B?bVpsZ2FQdDVkNG9hOVRIOUgvaSttYkNhdjlvZ3Z5enZMZnRQMks0bXpsYlhX?= =?utf-8?B?aGRJTkQ2R1J5YWFVR1hwZXg4YW5wb2tnUHhWcElMaEZhS1NGUldEcFZaTTc3?= =?utf-8?B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Ymtp?= =?utf-8?B?U1I0Q0R6b3MyQk1ZSGR4ZlZybHlHOWovaGVzTTVjNjFFTFNBeVJyTWQ5UVVo?= =?utf-8?B?ZXh6V1JvaGhQcWZJelpMZ0dNTHhIeitYZ0poMlhNT3IyN0NFOXlxQWpNb2F4?= =?utf-8?B?cWRTWmorTm5aclozcGs4YzZHTVpRK0NrWEJzZlhVVy9FTU9tZ3J1NmlLTFlr?= =?utf-8?B?SUdtallwbm1NYndaWXNWZFBUMnJYTXp6bnY2SE96OFpmNHo1M0ZPZnEzQ3Jm?= =?utf-8?B?MnhMaE4vanhESUdVNEZnVEoreTZwMFNRdVV6bWx0enlyQTBsTGtSL045aDZU?= =?utf-8?B?a0JKNXpoTTBIM0I4YzlOVWhIajFKaTlhbHRSbjdrTUEvM2ZtNnBaYitLTHVp?= =?utf-8?B?N2lKbDczdlhFenZOSTA4aXNuWVhTeWpuL0JOVmdFSmNyYi9FenlCNUlMNzlY?= =?utf-8?B?NzZLWlc0ZEhEWXVCcG9xRVZqUHo3REszVWwxYUdPKzNJU1A0RlMwT0ZlUC9Q?= =?utf-8?B?MnFSZnN4TkpNcUx0dXVNRUh3Nkg4MWN4YnUvUGw3YTFHNm5lYTFSV1RmeS9N?= =?utf-8?Q?42YY=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c910bd8f-30d0-47f0-522d-08dced65e172 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 22:08:21.0568 (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: AQhKV8F1fCrWYN3UEyX2/sm+pn1RkrqftuCWNcMDAkQqoIhbYRrQlocwHyFweNArQobKSIJNG/XEeAWtxYYAwA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7788 Add doorbell test support. Signed-off-by: Frank Li --- 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