From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0184AA0542; Tue, 5 Jul 2022 15:45:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D40994021D; Tue, 5 Jul 2022 15:45:16 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2084.outbound.protection.outlook.com [40.107.220.84]) by mails.dpdk.org (Postfix) with ESMTP id A5CE1400D7 for ; Tue, 5 Jul 2022 15:45:15 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=II12Esp5hfF2Q4lHvUR1artD7jGA5aY5RBFM7JGhg23IEIbNV3yNqkih78UYAA/b41Mb+LS8nW+hsljgNMcUpZv2KK0dF54+psy+huakgnFN+x1QXg/3G/GSjjGBk98vnnDehAAcdI+scQ8Snhwe7x9TwLiRYufKYB+Fq5C23P9aE5qRU0GuGe4WN9HcdQhY3DDDEaVQRbPMg0nFES3Gl5AWUWSYRBKhxyCDRAlyMGLGloSpKMvWaoS8jAbQzXoJSgT7K07ava+2HxdHhKO41ckm7pTXo/QrNteSUpyKicBLGcdvk47dkJMb5agaHG4lp2dNINqz9EgQlkt6E5tBXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=oMwkbC4chivfYYeIzmoL+DaFq56xKoaOfRe6QzgG0sg=; b=ZEwqhwEZtKIgsbYrhvFrmC/PwoVj+K+rIhywWJeNY8bLvGr5noAE5E4D+YzRYQl/TB1XxeI+HbPbQ79a6CYXbnjYk/ds/rxyyRfBm4EeXPA4Vyc2fYkwXYyaPEmi5/auYhD/VUJOYlVThQMNaP1uNJmX54JcThC/RphX0qXrnl5r3zA6nioWn6PZrLKZ3du8Q26vg9uLYAFjVWBPgQo1C8CVJOKenIEJRG9JbYjTb47BxmyGJDBhdQOuHX0HfWeo6RTJZb+nvT4Xxdc45Nlx4Z+IYhNv8FpqHRG1/QJzgDXR2jLZWtvKa9aval1iv8rC1CKj+2fhdLJv8iaErux6uw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oMwkbC4chivfYYeIzmoL+DaFq56xKoaOfRe6QzgG0sg=; b=VOn0uUgVEiejtHfdl5DCV/iuGpl7aosww+guvjrQRKpY/33lGiF29w+qFEXiQO0jiPWWTWRx4IrKadrWoMN5OMmB0ltxe8j1pV/3EC0SbZaPHeKIgHtxcef6dpeR7+xhh6rHNrs5Qs1mpIi53PUA78yFjhNSNMYjFrC5qvTCQQwU1gKNkiySP4GTrIXTkacQEnGVe245wGr+tAO2EqHkOhaLuAG7ei4vtDTtF9kPqTpcmEV0D635Z9ubb+WOLNAvLA12Z6C9kCdkVmnflW5fuc4TcW8qUBoMpA6/7rDHcvxmjb9a4Vz8Su7NbemlxHj2uvOdeR5Xs90dM8CE0yHomg== Received: from DS7PR03CA0326.namprd03.prod.outlook.com (2603:10b6:8:2b::28) by MN2PR12MB4360.namprd12.prod.outlook.com (2603:10b6:208:266::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15; Tue, 5 Jul 2022 13:45:13 +0000 Received: from DM6NAM11FT012.eop-nam11.prod.protection.outlook.com (2603:10b6:8:2b:cafe::4c) by DS7PR03CA0326.outlook.office365.com (2603:10b6:8:2b::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14 via Frontend Transport; Tue, 5 Jul 2022 13:45:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.236) by DM6NAM11FT012.mail.protection.outlook.com (10.13.173.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5395.14 via Frontend Transport; Tue, 5 Jul 2022 13:45:12 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Tue, 5 Jul 2022 13:45:11 +0000 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Tue, 5 Jul 2022 06:45:09 -0700 From: Spike Du To: , , , CC: , Subject: [PATCH] vdpa/mlx5: refactor with common interrupt management API Date: Tue, 5 Jul 2022 16:44:51 +0300 Message-ID: <20220705134452.479941-1-spiked@nvidia.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5347107a-3b44-4b39-3438-08da5e8c95cf X-MS-TrafficTypeDiagnostic: MN2PR12MB4360:EE_ X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: p+ZuXhh7/FVCcYxj/DVbu6sTLwIAOnTWNAT4Jx0593JpOhmefuYixMj740+8lu11wbQJTrNvM4TWC1RtjbZVK925ig5X4WLrME5zTm1Ys7Nm0bqNdjQv0emUySTcHf0WpqAMkRx7OBtZ4V27HBrq3q1OV1cq5I5GaYn1pfkKN5YskpHNuVvrztO/t3ImA0V3xrLEIynQ2aa/pdYrYgL/tl7PIIPY1TUXj50LFVI8KA/X9WQrB/05gmCgEmej10rD+lN0y1d8HgS2OuNQCkNr1xrwvE8vLZGHWPBAYW8656+HNt6UVqOOEamcP6+mna/Wo6Bhdi51IGgFnCUXNjG9fRKbHtpaKaIoKxR/t8leRHe+hfy467rTC0CWd01cyJS3hfX70cVq5RmsDZ2clpcMap3dwlWb5NIZ9pQuzHyk3krtKfEBE7DY09Kx7InCyqyVo0qgvYbgIeyM5kyOlLddv0CMYfF0MtpiEu0/GbKBD49+F1bGvwE3Ccmm3BRBc/0yao2e4OOSH9PysNhzSkYTSaTrcDvlRaDREuvpqD3iK9YwV7tKIQMUASDw2r9NvA1YK5l0rBPo5CDNCxce/JWlTVFRfJCloDQvSVLZxpZsSbkntnc93xeTgWHfr2qFd5PHlI086rR8dagRRQ/4vAdNR9mZ3bhkBWruCFErxTbiNTsYf8nWL7QPiuoM9IsI62PSeTVFlxmhFfwfjQ8VQbVqTdBvNLuldHFoI5Ab/e9zHd7drYQfRZ/ibHldIktO7q6p2IHTl3svW9/soe5GUS5R5PPRS5Na5Qb1PWCfFQlSwvFvvrTbePne//LT6yVKDSuvlHmNlPQso3vPf7zFihLqYpjBjmz5J8J/Lup9jYIntf0= X-Forefront-Antispam-Report: CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(136003)(376002)(396003)(39860400002)(346002)(36840700001)(46966006)(40470700004)(81166007)(86362001)(36756003)(36860700001)(83380400001)(16526019)(186003)(47076005)(26005)(2616005)(336012)(41300700001)(356005)(426003)(107886003)(1076003)(6286002)(6666004)(4326008)(110136005)(82740400003)(70586007)(316002)(70206006)(478600001)(8676002)(54906003)(5660300002)(2906002)(40460700003)(55016003)(40480700001)(8936002)(7696005)(82310400005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2022 13:45:12.6757 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5347107a-3b44-4b39-3438-08da5e8c95cf X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.236]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT012.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4360 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Replace vdpa interrupt handle creation logic with common interrupt management API. Signed-off-by: Spike Du --- drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c index ed17fb5..607e290 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c @@ -492,30 +492,13 @@ mlx5_vdpa_virtq_doorbell_setup(struct mlx5_vdpa_virtq *virtq, struct rte_vhost_vring *vq, int index) { - virtq->intr_handle = - rte_intr_instance_alloc(RTE_INTR_INSTANCE_F_SHARED); + virtq->intr_handle = mlx5_os_interrupt_handler_create( + RTE_INTR_INSTANCE_F_SHARED, false, + vq->kickfd, mlx5_vdpa_virtq_kick_handler, virtq); if (virtq->intr_handle == NULL) { - DRV_LOG(ERR, "Fail to allocate intr_handle"); + DRV_LOG(ERR, "Fail to allocate intr_handle for virtq %d.", index); return -1; } - if (rte_intr_fd_set(virtq->intr_handle, vq->kickfd)) - return -1; - if (rte_intr_fd_get(virtq->intr_handle) == -1) { - DRV_LOG(WARNING, "Virtq %d kickfd is invalid.", index); - } else { - if (rte_intr_type_set(virtq->intr_handle, - RTE_INTR_HANDLE_EXT)) - return -1; - if (rte_intr_callback_register(virtq->intr_handle, - mlx5_vdpa_virtq_kick_handler, virtq)) { - (void)rte_intr_fd_set(virtq->intr_handle, -1); - DRV_LOG(ERR, "Failed to register virtq %d interrupt.", - index); - return -1; - } - DRV_LOG(DEBUG, "Register fd %d interrupt for virtq %d.", - rte_intr_fd_get(virtq->intr_handle), index); - } return 0; } -- 1.8.3.1