get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/112775/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 112775,
    "url": "http://patches.dpdk.org/api/patches/112775/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220615144341.399152-3-spiked@nvidia.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20220615144341.399152-3-spiked@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220615144341.399152-3-spiked@nvidia.com",
    "date": "2022-06-15T14:43:37",
    "name": "[v9,2/6] common/mlx5: share interrupt management",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2ecf84e70a856def831614af05586561431de7c8",
    "submitter": {
        "id": 2637,
        "url": "http://patches.dpdk.org/api/people/2637/?format=api",
        "name": "Spike Du",
        "email": "spiked@nvidia.com"
    },
    "delegate": {
        "id": 3268,
        "url": "http://patches.dpdk.org/api/users/3268/?format=api",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@nvidia.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220615144341.399152-3-spiked@nvidia.com/mbox/",
    "series": [
        {
            "id": 23541,
            "url": "http://patches.dpdk.org/api/series/23541/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=23541",
            "date": "2022-06-15T14:43:36",
            "name": "introduce per-queue available descriptor threshold and host shaper",
            "version": 9,
            "mbox": "http://patches.dpdk.org/series/23541/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/112775/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/112775/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 78674A0548;\n\tWed, 15 Jun 2022 16:44:19 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6820342B7E;\n\tWed, 15 Jun 2022 16:44:12 +0200 (CEST)",
            "from NAM11-CO1-obe.outbound.protection.outlook.com\n (mail-co1nam11on2072.outbound.protection.outlook.com [40.107.220.72])\n by mails.dpdk.org (Postfix) with ESMTP id A146B40F19\n for <dev@dpdk.org>; Wed, 15 Jun 2022 16:44:10 +0200 (CEST)",
            "from BN1PR10CA0022.namprd10.prod.outlook.com (2603:10b6:408:e0::27)\n by BYAPR12MB3350.namprd12.prod.outlook.com (2603:10b6:a03:ab::21)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Wed, 15 Jun\n 2022 14:44:06 +0000",
            "from BN8NAM11FT038.eop-nam11.prod.protection.outlook.com\n (2603:10b6:408:e0:cafe::5) by BN1PR10CA0022.outlook.office365.com\n (2603:10b6:408:e0::27) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.16 via Frontend\n Transport; Wed, 15 Jun 2022 14:44:06 +0000",
            "from mail.nvidia.com (12.22.5.234) by\n BN8NAM11FT038.mail.protection.outlook.com (10.13.176.246) with Microsoft SMTP\n Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id\n 15.20.5332.12 via Frontend Transport; Wed, 15 Jun 2022 14:44:06 +0000",
            "from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com\n (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.32;\n Wed, 15 Jun 2022 14:44:05 +0000",
            "from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com\n (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 15 Jun\n 2022 07:44:01 -0700"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=TpqnAY/TnX2KdEdkjrhM58iIX1qX1x7zahudBhMAZc75/KdJwuObxIvAtxUML5LFQbt6TwcfbCHV2Rum2Ux6LdMXxvlbM+yS4azodEQM22y7V0cRp+i3JyBJj6AEr2b5XlIEYBR9lfBRFUyys7GQwrs8Uothq6Deec3T9rEdaOndDsX/8HOFY82T9/+6uESIOMFBKpS1Js1jXyiYFZXb7/R97ptqgwQTVbNfL1g3w/45vLg7UCD4bwB2KfnpUSgUawFLe/UUgJYV/LRgN4t5IIpW/NZvPWyMaH16DJqfVh4zdA+jxMTGYggMkoEe2N1RyCBHIhXV3EPHrroCTJiZfA==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n 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;\n bh=aB2I2ZT42vK90MQMP1qxXohvBxZP+CTaB6oLNeqH3Hg=;\n b=WwFg3+87yH8rajkEY9nYe+HwzXkfBGDQiJQvp37yYVLrkO69mxIqUPhUSwFGuFjTuMR29YuLAiqJ0/YppB6W1QiNZktgIDKm6Fv598POX5O1fhmCoS+mdnKodpBJM++1Lk61lgPU5PCt3xbulWsAg+5Y1Y61qDUtSjZf3YoBtmmF/YkzflCUDtmkKDFbmqEbmxZdIP//1VnhOkTl8R2rVeA2NPMCrJAAfQcOuO1fnoAcrX0FeG1+P6mV8L9eCfdaJvnPv6bu9AX4lwqJCP3Wzj1QJC3sT/a2V7WH/1FXITIDhjz41WoEwFH7IXmCKNUiPGgJk0Hnn+JA5DC0rYrLmw==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 12.22.5.234) smtp.rcpttodomain=networkplumber.org smtp.mailfrom=nvidia.com;\n dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com;\n dkim=none (message not signed); arc=none",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;\n s=selector2;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=aB2I2ZT42vK90MQMP1qxXohvBxZP+CTaB6oLNeqH3Hg=;\n b=BJrkIeipHPocaloTg1GV5Ny2xSPNIkNDjWWv/80vZFij3RQL6I9tCKsIBlNhv1EtN9iJxzyCNusn6o8J3w7TdDcMffAIfwvi1GhjzHtV0HIRgO8i/2ZAI+hYL80YFSMoecsCOUAM4zcmLcGhJRfKS6vnBIjbGg6rC7mETUQ+31TkVwwXKiRfbfiMR6iRKyd/x9OwnfGSlhzL6FiizY63OW/0l9FgGf1azvZf5oK58XREqSJEFUXie6kRknOaWIai3DxwfYyhhEGf3nyWRgkFSf2LJUyiCApfYvEElToj+gwZW7Bnnk9a8eY4xFkijuSo94+m0EVq2E7KyozhtNCkqw==",
        "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 12.22.5.234)\n smtp.mailfrom=nvidia.com; dkim=none (message not signed)\n header.d=none;dmarc=pass action=none header.from=nvidia.com;",
        "Received-SPF": "Pass (protection.outlook.com: domain of nvidia.com designates\n 12.22.5.234 as permitted sender) receiver=protection.outlook.com;\n client-ip=12.22.5.234; helo=mail.nvidia.com; pr=C",
        "From": "Spike Du <spiked@nvidia.com>",
        "To": "<matan@nvidia.com>, <viacheslavo@nvidia.com>, <orika@nvidia.com>,\n <thomas@monjalon.net>, Shahaf Shuler <shahafs@nvidia.com>, Ray Kinsella\n <mdr@ashroe.eu>, Neil Horman <nhorman@tuxdriver.com>",
        "CC": "<andrew.rybchenko@oktetlabs.ru>, <stephen@networkplumber.org>,\n <mb@smartsharesystems.com>, <dev@dpdk.org>, <rasland@nvidia.com>",
        "Subject": "[PATCH v9 2/6] common/mlx5: share interrupt management",
        "Date": "Wed, 15 Jun 2022 17:43:37 +0300",
        "Message-ID": "<20220615144341.399152-3-spiked@nvidia.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20220615144341.399152-1-spiked@nvidia.com>",
        "References": "<20220615125836.391771-2-spiked@nvidia.com>\n <20220615144341.399152-1-spiked@nvidia.com>",
        "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\n rnnvmail201.nvidia.com (10.129.68.8)",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-Office365-Filtering-Correlation-Id": "99a3f5f8-8386-402d-2c84-08da4edd7fa7",
        "X-MS-TrafficTypeDiagnostic": "BYAPR12MB3350:EE_",
        "X-LD-Processed": "43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr",
        "X-Microsoft-Antispam-PRVS": "\n <BYAPR12MB33505E0C9F2C8FE2A1214B91A8AD9@BYAPR12MB3350.namprd12.prod.outlook.com>",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n UpLzmoRKrsfIObBXvqNA7J4jQoMJJ+Y7yEqayakFFmNiblPxKNewlouLiY06PZsp7yphQ6Pz09CgcTNDRQ5VBkEvDflZbsgYcwP/R/GB8fU4x4CFKrT9v7T+y1eP1/KswYvBcmfPHX+7JatPrsXskatK6GpqA+rVgtE5r6gahPz+GYgZFeZW6XRyA9loElH76N1HwdNV6WjrosfLmXbFtfHJ7zF8cIpsJ43ydqZqzT1Pmf+dQLhNZTWWsnzz8mk336cgFIOUnP+7ygeDQMvyjsKUJZxKjO5TzbHoUGrMbb4BTGvWwV+m4fzSPUbK1R6LpamFhrZ5hA8WnES7r2pPSotmujUyhblNP/LNADXkvNqBLSyxJvY5GNJPvylubfjLpQ3wKDB6jKfK3iyDdXuOkJn+Xfoise/LMyJOI8bUzuqdjpsP9h06GAGaN1HkEiQ3AQLtKKRwH17LZdsw3G68P9eUH82WdwTeaRVb4ihS3hcH/rIxD8msIafjE9SJmP0aqoGJhV47NaZJmUzI6m/MQ3dT13AyssBEHe3tJ3Csvnjcgo2TNj/SRGMsXAvvUxO4mGfOGprk3PBGT25X/5EyOqU6Joz5egN8nB8E6Xw55Da35j46uNRuGFW8YMATqjYTP86DOPgxfZz4ez3fI4tPyM9onrBi2yO/G2DGOew5gNM8Cy9Owr4h6grBA/SkAxjhO7AT9rmI9LwtpAFawNjtqQ==",
        "X-Forefront-Antispam-Report": "CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE;\n SFS:(13230016)(4636009)(40470700004)(46966006)(36840700001)(110136005)(54906003)(30864003)(82310400005)(5660300002)(2906002)(508600001)(55016003)(8936002)(36860700001)(316002)(6666004)(70586007)(4326008)(70206006)(8676002)(83380400001)(7696005)(40460700003)(36756003)(356005)(81166007)(86362001)(107886003)(1076003)(47076005)(336012)(16526019)(186003)(2616005)(26005)(6286002)(426003)(36900700001);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "Nvidia.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "15 Jun 2022 14:44:06.0872 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 99a3f5f8-8386-402d-2c84-08da4edd7fa7",
        "X-MS-Exchange-CrossTenant-Id": "43083d15-7273-40c1-b7db-39efd9ccc17a",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.234];\n Helo=[mail.nvidia.com]",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n BN8NAM11FT038.eop-nam11.prod.protection.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "BYAPR12MB3350",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "There are many duplicate code of creating and initializing rte_intr_handle.\nAdd a new mlx5_os API to do this, replace all PMD related code with this\nAPI.\n\nSigned-off-by: Spike Du <spiked@nvidia.com>\n---\n drivers/common/mlx5/linux/mlx5_common_os.c   | 131 ++++++++++++++++++++++++++\n drivers/common/mlx5/linux/mlx5_common_os.h   |  11 +++\n drivers/common/mlx5/version.map              |   2 +\n drivers/common/mlx5/windows/mlx5_common_os.h |  24 +++++\n drivers/net/mlx5/linux/mlx5_ethdev_os.c      |  71 --------------\n drivers/net/mlx5/linux/mlx5_os.c             | 132 ++++++---------------------\n drivers/net/mlx5/linux/mlx5_socket.c         |  53 ++---------\n drivers/net/mlx5/mlx5.h                      |   2 -\n drivers/net/mlx5/mlx5_txpp.c                 |  28 ++----\n drivers/net/mlx5/windows/mlx5_ethdev_os.c    |  22 -----\n drivers/vdpa/mlx5/mlx5_vdpa_virtq.c          |  48 ++--------\n 11 files changed, 217 insertions(+), 307 deletions(-)",
    "diff": "diff --git a/drivers/common/mlx5/linux/mlx5_common_os.c b/drivers/common/mlx5/linux/mlx5_common_os.c\nindex d40cfd5..f10a981 100644\n--- a/drivers/common/mlx5/linux/mlx5_common_os.c\n+++ b/drivers/common/mlx5/linux/mlx5_common_os.c\n@@ -11,6 +11,7 @@\n #endif\n #include <dirent.h>\n #include <net/if.h>\n+#include <fcntl.h>\n \n #include <rte_errno.h>\n #include <rte_string_fns.h>\n@@ -964,3 +965,133 @@\n \t\tclaim_zero(mlx5_glue->dereg_mr(pmd_mr->obj));\n \tmemset(pmd_mr, 0, sizeof(*pmd_mr));\n }\n+\n+/**\n+ * Rte_intr_handle create and init helper.\n+ *\n+ * @param[in] mode\n+ *   interrupt instance can be shared between primary and secondary\n+ *   processes or not.\n+ * @param[in] set_fd_nonblock\n+ *   Whether to set fd to O_NONBLOCK.\n+ * @param[in] fd\n+ *   Fd to set in created intr_handle.\n+ * @param[in] cb\n+ *   Callback to register for intr_handle.\n+ * @param[in] cb_arg\n+ *   Callback argument for cb.\n+ *\n+ * @return\n+ *  - Interrupt handle on success.\n+ *  - NULL on failure, with rte_errno set.\n+ */\n+struct rte_intr_handle *\n+mlx5_os_interrupt_handler_create(int mode, bool set_fd_nonblock, int fd,\n+\t\t\t\t rte_intr_callback_fn cb, void *cb_arg)\n+{\n+\tstruct rte_intr_handle *tmp_intr_handle;\n+\tint ret, flags;\n+\n+\ttmp_intr_handle = rte_intr_instance_alloc(mode);\n+\tif (!tmp_intr_handle) {\n+\t\trte_errno = ENOMEM;\n+\t\tgoto err;\n+\t}\n+\tif (set_fd_nonblock) {\n+\t\tflags = fcntl(fd, F_GETFL);\n+\t\tret = fcntl(fd, F_SETFL, flags | O_NONBLOCK);\n+\t\tif (ret) {\n+\t\t\trte_errno = errno;\n+\t\t\tgoto err;\n+\t\t}\n+\t}\n+\tret = rte_intr_fd_set(tmp_intr_handle, fd);\n+\tif (ret)\n+\t\tgoto err;\n+\tret = rte_intr_type_set(tmp_intr_handle, RTE_INTR_HANDLE_EXT);\n+\tif (ret)\n+\t\tgoto err;\n+\tret = rte_intr_callback_register(tmp_intr_handle, cb, cb_arg);\n+\tif (ret) {\n+\t\trte_errno = -ret;\n+\t\tgoto err;\n+\t}\n+\treturn tmp_intr_handle;\n+err:\n+\tif (tmp_intr_handle)\n+\t\trte_intr_instance_free(tmp_intr_handle);\n+\treturn NULL;\n+}\n+\n+/* Safe unregistration for interrupt callback. */\n+static void\n+mlx5_intr_callback_unregister(const struct rte_intr_handle *handle,\n+\t\t\t      rte_intr_callback_fn cb_fn, void *cb_arg)\n+{\n+\tuint64_t twait = 0;\n+\tuint64_t start = 0;\n+\n+\tdo {\n+\t\tint ret;\n+\n+\t\tret = rte_intr_callback_unregister(handle, cb_fn, cb_arg);\n+\t\tif (ret >= 0)\n+\t\t\treturn;\n+\t\tif (ret != -EAGAIN) {\n+\t\t\tDRV_LOG(INFO, \"failed to unregister interrupt\"\n+\t\t\t\t      \" handler (error: %d)\", ret);\n+\t\t\tMLX5_ASSERT(false);\n+\t\t\treturn;\n+\t\t}\n+\t\tif (twait) {\n+\t\t\tstruct timespec onems;\n+\n+\t\t\t/* Wait one millisecond and try again. */\n+\t\t\tonems.tv_sec = 0;\n+\t\t\tonems.tv_nsec = NS_PER_S / MS_PER_S;\n+\t\t\tnanosleep(&onems, 0);\n+\t\t\t/* Check whether one second elapsed. */\n+\t\t\tif ((rte_get_timer_cycles() - start) <= twait)\n+\t\t\t\tcontinue;\n+\t\t} else {\n+\t\t\t/*\n+\t\t\t * We get the amount of timer ticks for one second.\n+\t\t\t * If this amount elapsed it means we spent one\n+\t\t\t * second in waiting. This branch is executed once\n+\t\t\t * on first iteration.\n+\t\t\t */\n+\t\t\ttwait = rte_get_timer_hz();\n+\t\t\tMLX5_ASSERT(twait);\n+\t\t}\n+\t\t/*\n+\t\t * Timeout elapsed, show message (once a second) and retry.\n+\t\t * We have no other acceptable option here, if we ignore\n+\t\t * the unregistering return code the handler will not\n+\t\t * be unregistered, fd will be closed and we may get the\n+\t\t * crush. Hanging and messaging in the loop seems not to be\n+\t\t * the worst choice.\n+\t\t */\n+\t\tDRV_LOG(INFO, \"Retrying to unregister interrupt handler\");\n+\t\tstart = rte_get_timer_cycles();\n+\t} while (true);\n+}\n+\n+/**\n+ * Rte_intr_handle destroy helper.\n+ *\n+ * @param[in] intr_handle\n+ *   Rte_intr_handle to destroy.\n+ * @param[in] cb\n+ *   Callback which is registered to intr_handle.\n+ * @param[in] cb_arg\n+ *   Callback argument for cb.\n+ *\n+ */\n+void\n+mlx5_os_interrupt_handler_destroy(struct rte_intr_handle *intr_handle,\n+\t\t\t\t  rte_intr_callback_fn cb, void *cb_arg)\n+{\n+\tif (rte_intr_fd_get(intr_handle) >= 0)\n+\t\tmlx5_intr_callback_unregister(intr_handle, cb, cb_arg);\n+\trte_intr_instance_free(intr_handle);\n+}\ndiff --git a/drivers/common/mlx5/linux/mlx5_common_os.h b/drivers/common/mlx5/linux/mlx5_common_os.h\nindex 27f1192..479bb3c 100644\n--- a/drivers/common/mlx5/linux/mlx5_common_os.h\n+++ b/drivers/common/mlx5/linux/mlx5_common_os.h\n@@ -15,6 +15,7 @@\n #include <rte_log.h>\n #include <rte_kvargs.h>\n #include <rte_devargs.h>\n+#include <rte_interrupts.h>\n \n #include \"mlx5_autoconf.h\"\n #include \"mlx5_glue.h\"\n@@ -299,4 +300,14 @@\n int\n mlx5_get_device_guid(const struct rte_pci_addr *dev, uint8_t *guid, size_t len);\n \n+__rte_internal\n+struct rte_intr_handle *\n+mlx5_os_interrupt_handler_create(int mode, bool set_fd_nonblock, int fd,\n+\t\t\t\t rte_intr_callback_fn cb, void *cb_arg);\n+\n+__rte_internal\n+void\n+mlx5_os_interrupt_handler_destroy(struct rte_intr_handle *intr_handle,\n+\t\t\t\t  rte_intr_callback_fn cb, void *cb_arg);\n+\n #endif /* RTE_PMD_MLX5_COMMON_OS_H_ */\ndiff --git a/drivers/common/mlx5/version.map b/drivers/common/mlx5/version.map\nindex a23a30a..413dec1 100644\n--- a/drivers/common/mlx5/version.map\n+++ b/drivers/common/mlx5/version.map\n@@ -153,5 +153,7 @@ INTERNAL {\n \tmlx5_mr_mempool2mr_bh;\n \tmlx5_mr_mempool_populate_cache;\n \n+\tmlx5_os_interrupt_handler_create; # WINDOWS_NO_EXPORT\n+\tmlx5_os_interrupt_handler_destroy; # WINDOWS_NO_EXPORT\n \tlocal: *;\n };\ndiff --git a/drivers/common/mlx5/windows/mlx5_common_os.h b/drivers/common/mlx5/windows/mlx5_common_os.h\nindex ee7973f..e9e9108 100644\n--- a/drivers/common/mlx5/windows/mlx5_common_os.h\n+++ b/drivers/common/mlx5/windows/mlx5_common_os.h\n@@ -9,6 +9,7 @@\n #include <sys/types.h>\n \n #include <rte_errno.h>\n+#include <rte_interrupts.h>\n \n #include \"mlx5_autoconf.h\"\n #include \"mlx5_glue.h\"\n@@ -253,4 +254,27 @@\n __rte_internal\n int mlx5_os_umem_dereg(void *pumem);\n \n+static inline struct rte_intr_handle *\n+mlx5_os_interrupt_handler_create(int mode, bool set_fd_nonblock, int fd,\n+\t\t\t\t rte_intr_callback_fn cb, void *cb_arg)\n+{\n+\t(void)mode;\n+\t(void)set_fd_nonblock;\n+\t(void)fd;\n+\t(void)cb;\n+\t(void)cb_arg;\n+\trte_errno = ENOTSUP;\n+\treturn NULL;\n+}\n+\n+static inline void\n+mlx5_os_interrupt_handler_destroy(struct rte_intr_handle *intr_handle,\n+\t\t\t\t  rte_intr_callback_fn cb, void *cb_arg)\n+{\n+\t(void)intr_handle;\n+\t(void)cb;\n+\t(void)cb_arg;\n+}\n+\n+\n #endif /* RTE_PMD_MLX5_COMMON_OS_H_ */\ndiff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c\nindex 8d30ad0..760eaed 100644\n--- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c\n+++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c\n@@ -881,77 +881,6 @@ struct ethtool_link_settings {\n \t}\n }\n \n-/*\n- * Unregister callback handler safely. The handler may be active\n- * while we are trying to unregister it, in this case code -EAGAIN\n- * is returned by rte_intr_callback_unregister(). This routine checks\n- * the return code and tries to unregister handler again.\n- *\n- * @param handle\n- *   interrupt handle\n- * @param cb_fn\n- *   pointer to callback routine\n- * @cb_arg\n- *   opaque callback parameter\n- */\n-void\n-mlx5_intr_callback_unregister(const struct rte_intr_handle *handle,\n-\t\t\t      rte_intr_callback_fn cb_fn, void *cb_arg)\n-{\n-\t/*\n-\t * Try to reduce timeout management overhead by not calling\n-\t * the timer related routines on the first iteration. If the\n-\t * unregistering succeeds on first call there will be no\n-\t * timer calls at all.\n-\t */\n-\tuint64_t twait = 0;\n-\tuint64_t start = 0;\n-\n-\tdo {\n-\t\tint ret;\n-\n-\t\tret = rte_intr_callback_unregister(handle, cb_fn, cb_arg);\n-\t\tif (ret >= 0)\n-\t\t\treturn;\n-\t\tif (ret != -EAGAIN) {\n-\t\t\tDRV_LOG(INFO, \"failed to unregister interrupt\"\n-\t\t\t\t      \" handler (error: %d)\", ret);\n-\t\t\tMLX5_ASSERT(false);\n-\t\t\treturn;\n-\t\t}\n-\t\tif (twait) {\n-\t\t\tstruct timespec onems;\n-\n-\t\t\t/* Wait one millisecond and try again. */\n-\t\t\tonems.tv_sec = 0;\n-\t\t\tonems.tv_nsec = NS_PER_S / MS_PER_S;\n-\t\t\tnanosleep(&onems, 0);\n-\t\t\t/* Check whether one second elapsed. */\n-\t\t\tif ((rte_get_timer_cycles() - start) <= twait)\n-\t\t\t\tcontinue;\n-\t\t} else {\n-\t\t\t/*\n-\t\t\t * We get the amount of timer ticks for one second.\n-\t\t\t * If this amount elapsed it means we spent one\n-\t\t\t * second in waiting. This branch is executed once\n-\t\t\t * on first iteration.\n-\t\t\t */\n-\t\t\ttwait = rte_get_timer_hz();\n-\t\t\tMLX5_ASSERT(twait);\n-\t\t}\n-\t\t/*\n-\t\t * Timeout elapsed, show message (once a second) and retry.\n-\t\t * We have no other acceptable option here, if we ignore\n-\t\t * the unregistering return code the handler will not\n-\t\t * be unregistered, fd will be closed and we may get the\n-\t\t * crush. Hanging and messaging in the loop seems not to be\n-\t\t * the worst choice.\n-\t\t */\n-\t\tDRV_LOG(INFO, \"Retrying to unregister interrupt handler\");\n-\t\tstart = rte_get_timer_cycles();\n-\t} while (true);\n-}\n-\n /**\n  * Handle DEVX interrupts from the NIC.\n  * This function is probably called from the DPDK host thread.\ndiff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c\nindex a821153..0741028 100644\n--- a/drivers/net/mlx5/linux/mlx5_os.c\n+++ b/drivers/net/mlx5/linux/mlx5_os.c\n@@ -2494,40 +2494,6 @@\n \tmlx5_pmd_socket_uninit();\n }\n \n-static int\n-mlx5_os_dev_shared_handler_install_lsc(struct mlx5_dev_ctx_shared *sh)\n-{\n-\tint nlsk_fd, flags, ret;\n-\n-\tnlsk_fd = mlx5_nl_init(NETLINK_ROUTE, RTMGRP_LINK);\n-\tif (nlsk_fd < 0) {\n-\t\tDRV_LOG(ERR, \"Failed to create a socket for Netlink events: %s\",\n-\t\t\trte_strerror(rte_errno));\n-\t\treturn -1;\n-\t}\n-\tflags = fcntl(nlsk_fd, F_GETFL);\n-\tret = fcntl(nlsk_fd, F_SETFL, flags | O_NONBLOCK);\n-\tif (ret != 0) {\n-\t\tDRV_LOG(ERR, \"Failed to make Netlink event socket non-blocking: %s\",\n-\t\t\tstrerror(errno));\n-\t\trte_errno = errno;\n-\t\tgoto error;\n-\t}\n-\trte_intr_type_set(sh->intr_handle_nl, RTE_INTR_HANDLE_EXT);\n-\trte_intr_fd_set(sh->intr_handle_nl, nlsk_fd);\n-\tif (rte_intr_callback_register(sh->intr_handle_nl,\n-\t\t\t\t       mlx5_dev_interrupt_handler_nl,\n-\t\t\t\t       sh) != 0) {\n-\t\tDRV_LOG(ERR, \"Failed to register Netlink events interrupt\");\n-\t\trte_intr_fd_set(sh->intr_handle_nl, -1);\n-\t\tgoto error;\n-\t}\n-\treturn 0;\n-error:\n-\tclose(nlsk_fd);\n-\treturn -1;\n-}\n-\n /**\n  * Install shared asynchronous device events handler.\n  * This function is implemented to support event sharing\n@@ -2539,76 +2505,47 @@\n void\n mlx5_os_dev_shared_handler_install(struct mlx5_dev_ctx_shared *sh)\n {\n-\tint ret;\n-\tint flags;\n \tstruct ibv_context *ctx = sh->cdev->ctx;\n+\tint nlsk_fd;\n \n-\tsh->intr_handle = rte_intr_instance_alloc(RTE_INTR_INSTANCE_F_SHARED);\n-\tif (sh->intr_handle == NULL) {\n-\t\tDRV_LOG(ERR, \"Fail to allocate intr_handle\");\n-\t\trte_errno = ENOMEM;\n+\tsh->intr_handle = mlx5_os_interrupt_handler_create\n+\t\t(RTE_INTR_INSTANCE_F_SHARED, true,\n+\t\t ctx->async_fd, mlx5_dev_interrupt_handler, sh);\n+\tif (!sh->intr_handle) {\n+\t\tDRV_LOG(ERR, \"Failed to allocate intr_handle.\");\n \t\treturn;\n \t}\n-\trte_intr_fd_set(sh->intr_handle, -1);\n-\n-\tflags = fcntl(ctx->async_fd, F_GETFL);\n-\tret = fcntl(ctx->async_fd, F_SETFL, flags | O_NONBLOCK);\n-\tif (ret) {\n-\t\tDRV_LOG(INFO, \"failed to change file descriptor async event\"\n-\t\t\t\" queue\");\n-\t} else {\n-\t\trte_intr_fd_set(sh->intr_handle, ctx->async_fd);\n-\t\trte_intr_type_set(sh->intr_handle, RTE_INTR_HANDLE_EXT);\n-\t\tif (rte_intr_callback_register(sh->intr_handle,\n-\t\t\t\t\tmlx5_dev_interrupt_handler, sh)) {\n-\t\t\tDRV_LOG(INFO, \"Fail to install the shared interrupt.\");\n-\t\t\trte_intr_fd_set(sh->intr_handle, -1);\n-\t\t}\n+\tnlsk_fd = mlx5_nl_init(NETLINK_ROUTE, RTMGRP_LINK);\n+\tif (nlsk_fd < 0) {\n+\t\tDRV_LOG(ERR, \"Failed to create a socket for Netlink events: %s\",\n+\t\t\trte_strerror(rte_errno));\n+\t\treturn;\n \t}\n-\tsh->intr_handle_nl = rte_intr_instance_alloc\n-\t\t\t\t\t\t(RTE_INTR_INSTANCE_F_SHARED);\n+\tsh->intr_handle_nl = mlx5_os_interrupt_handler_create\n+\t\t(RTE_INTR_INSTANCE_F_SHARED, true,\n+\t\t nlsk_fd, mlx5_dev_interrupt_handler_nl, sh);\n \tif (sh->intr_handle_nl == NULL) {\n \t\tDRV_LOG(ERR, \"Fail to allocate intr_handle\");\n-\t\trte_errno = ENOMEM;\n \t\treturn;\n \t}\n-\trte_intr_fd_set(sh->intr_handle_nl, -1);\n-\tif (mlx5_os_dev_shared_handler_install_lsc(sh) < 0) {\n-\t\tDRV_LOG(INFO, \"Fail to install the shared Netlink event handler.\");\n-\t\trte_intr_fd_set(sh->intr_handle_nl, -1);\n-\t}\n \tif (sh->cdev->config.devx) {\n #ifdef HAVE_IBV_DEVX_ASYNC\n-\t\tsh->intr_handle_devx =\n-\t\t\trte_intr_instance_alloc(RTE_INTR_INSTANCE_F_SHARED);\n-\t\tif (!sh->intr_handle_devx) {\n-\t\t\tDRV_LOG(ERR, \"Fail to allocate intr_handle\");\n-\t\t\trte_errno = ENOMEM;\n-\t\t\treturn;\n-\t\t}\n-\t\trte_intr_fd_set(sh->intr_handle_devx, -1);\n+\t\tstruct mlx5dv_devx_cmd_comp *devx_comp;\n+\n \t\tsh->devx_comp = (void *)mlx5_glue->devx_create_cmd_comp(ctx);\n-\t\tstruct mlx5dv_devx_cmd_comp *devx_comp = sh->devx_comp;\n+\t\tdevx_comp = sh->devx_comp;\n \t\tif (!devx_comp) {\n \t\t\tDRV_LOG(INFO, \"failed to allocate devx_comp.\");\n \t\t\treturn;\n \t\t}\n-\t\tflags = fcntl(devx_comp->fd, F_GETFL);\n-\t\tret = fcntl(devx_comp->fd, F_SETFL, flags | O_NONBLOCK);\n-\t\tif (ret) {\n-\t\t\tDRV_LOG(INFO, \"failed to change file descriptor\"\n-\t\t\t\t\" devx comp\");\n+\t\tsh->intr_handle_devx = mlx5_os_interrupt_handler_create\n+\t\t\t(RTE_INTR_INSTANCE_F_SHARED, true,\n+\t\t\t devx_comp->fd,\n+\t\t\t mlx5_dev_interrupt_handler_devx, sh);\n+\t\tif (!sh->intr_handle_devx) {\n+\t\t\tDRV_LOG(ERR, \"Failed to allocate intr_handle.\");\n \t\t\treturn;\n \t\t}\n-\t\trte_intr_fd_set(sh->intr_handle_devx, devx_comp->fd);\n-\t\trte_intr_type_set(sh->intr_handle_devx,\n-\t\t\t\t\t RTE_INTR_HANDLE_EXT);\n-\t\tif (rte_intr_callback_register(sh->intr_handle_devx,\n-\t\t\t\t\tmlx5_dev_interrupt_handler_devx, sh)) {\n-\t\t\tDRV_LOG(INFO, \"Fail to install the devx shared\"\n-\t\t\t\t\" interrupt.\");\n-\t\t\trte_intr_fd_set(sh->intr_handle_devx, -1);\n-\t\t}\n #endif /* HAVE_IBV_DEVX_ASYNC */\n \t}\n }\n@@ -2624,24 +2561,13 @@\n void\n mlx5_os_dev_shared_handler_uninstall(struct mlx5_dev_ctx_shared *sh)\n {\n-\tint nlsk_fd;\n-\n-\tif (rte_intr_fd_get(sh->intr_handle) >= 0)\n-\t\tmlx5_intr_callback_unregister(sh->intr_handle,\n-\t\t\t\t\t      mlx5_dev_interrupt_handler, sh);\n-\trte_intr_instance_free(sh->intr_handle);\n-\tnlsk_fd = rte_intr_fd_get(sh->intr_handle_nl);\n-\tif (nlsk_fd >= 0) {\n-\t\tmlx5_intr_callback_unregister\n-\t\t\t(sh->intr_handle_nl, mlx5_dev_interrupt_handler_nl, sh);\n-\t\tclose(nlsk_fd);\n-\t}\n-\trte_intr_instance_free(sh->intr_handle_nl);\n+\tmlx5_os_interrupt_handler_destroy(sh->intr_handle,\n+\t\t\t\t\t  mlx5_dev_interrupt_handler, sh);\n+\tmlx5_os_interrupt_handler_destroy(sh->intr_handle_nl,\n+\t\t\t\t\t  mlx5_dev_interrupt_handler_nl, sh);\n #ifdef HAVE_IBV_DEVX_ASYNC\n-\tif (rte_intr_fd_get(sh->intr_handle_devx) >= 0)\n-\t\trte_intr_callback_unregister(sh->intr_handle_devx,\n-\t\t\t\t  mlx5_dev_interrupt_handler_devx, sh);\n-\trte_intr_instance_free(sh->intr_handle_devx);\n+\tmlx5_os_interrupt_handler_destroy(sh->intr_handle_devx,\n+\t\t\t\t\t  mlx5_dev_interrupt_handler_devx, sh);\n \tif (sh->devx_comp)\n \t\tmlx5_glue->devx_destroy_cmd_comp(sh->devx_comp);\n #endif\ndiff --git a/drivers/net/mlx5/linux/mlx5_socket.c b/drivers/net/mlx5/linux/mlx5_socket.c\nindex 4882e5f..0e01aff 100644\n--- a/drivers/net/mlx5/linux/mlx5_socket.c\n+++ b/drivers/net/mlx5/linux/mlx5_socket.c\n@@ -134,51 +134,6 @@\n }\n \n /**\n- * Install interrupt handler.\n- *\n- * @param dev\n- *   Pointer to Ethernet device.\n- * @return\n- *   0 on success, a negative errno value otherwise.\n- */\n-static int\n-mlx5_pmd_interrupt_handler_install(void)\n-{\n-\tMLX5_ASSERT(server_socket != -1);\n-\n-\tserver_intr_handle =\n-\t\trte_intr_instance_alloc(RTE_INTR_INSTANCE_F_PRIVATE);\n-\tif (server_intr_handle == NULL) {\n-\t\tDRV_LOG(ERR, \"Fail to allocate intr_handle\");\n-\t\treturn -ENOMEM;\n-\t}\n-\tif (rte_intr_fd_set(server_intr_handle, server_socket))\n-\t\treturn -rte_errno;\n-\n-\tif (rte_intr_type_set(server_intr_handle, RTE_INTR_HANDLE_EXT))\n-\t\treturn -rte_errno;\n-\n-\treturn rte_intr_callback_register(server_intr_handle,\n-\t\t\t\t\t  mlx5_pmd_socket_handle, NULL);\n-}\n-\n-/**\n- * Uninstall interrupt handler.\n- */\n-static void\n-mlx5_pmd_interrupt_handler_uninstall(void)\n-{\n-\tif (server_socket != -1) {\n-\t\tmlx5_intr_callback_unregister(server_intr_handle,\n-\t\t\t\t\t      mlx5_pmd_socket_handle,\n-\t\t\t\t\t      NULL);\n-\t}\n-\trte_intr_fd_set(server_intr_handle, 0);\n-\trte_intr_type_set(server_intr_handle, RTE_INTR_HANDLE_UNKNOWN);\n-\trte_intr_instance_free(server_intr_handle);\n-}\n-\n-/**\n  * Initialise the socket to communicate with external tools.\n  *\n  * @return\n@@ -224,7 +179,10 @@\n \t\t\tstrerror(errno));\n \t\tgoto remove;\n \t}\n-\tif (mlx5_pmd_interrupt_handler_install()) {\n+\tserver_intr_handle = mlx5_os_interrupt_handler_create\n+\t\t(RTE_INTR_INSTANCE_F_PRIVATE, false,\n+\t\t server_socket, mlx5_pmd_socket_handle, NULL);\n+\tif (server_intr_handle == NULL) {\n \t\tDRV_LOG(WARNING, \"cannot register interrupt handler for mlx5 socket: %s\",\n \t\t\tstrerror(errno));\n \t\tgoto remove;\n@@ -248,7 +206,8 @@\n {\n \tif (server_socket == -1)\n \t\treturn;\n-\tmlx5_pmd_interrupt_handler_uninstall();\n+\tmlx5_os_interrupt_handler_destroy(server_intr_handle,\n+\t\t\t\t\t  mlx5_pmd_socket_handle, NULL);\n \tclaim_zero(close(server_socket));\n \tserver_socket = -1;\n \tMKSTR(path, MLX5_SOCKET_PATH, getpid());\ndiff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex 305edff..7ebb2cc 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -1682,8 +1682,6 @@ int mlx5_sysfs_switch_info(unsigned int ifindex,\n \t\t\t   struct mlx5_switch_info *info);\n void mlx5_translate_port_name(const char *port_name_in,\n \t\t\t      struct mlx5_switch_info *port_info_out);\n-void mlx5_intr_callback_unregister(const struct rte_intr_handle *handle,\n-\t\t\t\t   rte_intr_callback_fn cb_fn, void *cb_arg);\n int mlx5_sysfs_bond_info(unsigned int pf_ifindex, unsigned int *ifindex,\n \t\t\t char *ifname);\n int mlx5_get_module_info(struct rte_eth_dev *dev,\ndiff --git a/drivers/net/mlx5/mlx5_txpp.c b/drivers/net/mlx5/mlx5_txpp.c\nindex fe74317..f853a67 100644\n--- a/drivers/net/mlx5/mlx5_txpp.c\n+++ b/drivers/net/mlx5/mlx5_txpp.c\n@@ -741,11 +741,8 @@\n static void\n mlx5_txpp_stop_service(struct mlx5_dev_ctx_shared *sh)\n {\n-\tif (!rte_intr_fd_get(sh->txpp.intr_handle))\n-\t\treturn;\n-\tmlx5_intr_callback_unregister(sh->txpp.intr_handle,\n-\t\t\t\t      mlx5_txpp_interrupt_handler, sh);\n-\trte_intr_instance_free(sh->txpp.intr_handle);\n+\tmlx5_os_interrupt_handler_destroy(sh->txpp.intr_handle,\n+\t\t\t\t\t  mlx5_txpp_interrupt_handler, sh);\n }\n \n /* Attach interrupt handler and fires first request to Rearm Queue. */\n@@ -769,23 +766,12 @@\n \t\trte_errno = errno;\n \t\treturn -rte_errno;\n \t}\n-\tsh->txpp.intr_handle =\n-\t\t\trte_intr_instance_alloc(RTE_INTR_INSTANCE_F_SHARED);\n-\tif (sh->txpp.intr_handle == NULL) {\n-\t\tDRV_LOG(ERR, \"Fail to allocate intr_handle\");\n-\t\treturn -ENOMEM;\n-\t}\n \tfd = mlx5_os_get_devx_channel_fd(sh->txpp.echan);\n-\tif (rte_intr_fd_set(sh->txpp.intr_handle, fd))\n-\t\treturn -rte_errno;\n-\n-\tif (rte_intr_type_set(sh->txpp.intr_handle, RTE_INTR_HANDLE_EXT))\n-\t\treturn -rte_errno;\n-\n-\tif (rte_intr_callback_register(sh->txpp.intr_handle,\n-\t\t\t\t       mlx5_txpp_interrupt_handler, sh)) {\n-\t\trte_intr_fd_set(sh->txpp.intr_handle, 0);\n-\t\tDRV_LOG(ERR, \"Failed to register CQE interrupt %d.\", rte_errno);\n+\tsh->txpp.intr_handle = mlx5_os_interrupt_handler_create\n+\t\t(RTE_INTR_INSTANCE_F_SHARED, false,\n+\t\t fd, mlx5_txpp_interrupt_handler, sh);\n+\tif (!sh->txpp.intr_handle) {\n+\t\tDRV_LOG(ERR, \"Fail to allocate intr_handle\");\n \t\treturn -rte_errno;\n \t}\n \t/* Subscribe CQ event to the event channel controlled by the driver. */\ndiff --git a/drivers/net/mlx5/windows/mlx5_ethdev_os.c b/drivers/net/mlx5/windows/mlx5_ethdev_os.c\nindex f975265..88d8213 100644\n--- a/drivers/net/mlx5/windows/mlx5_ethdev_os.c\n+++ b/drivers/net/mlx5/windows/mlx5_ethdev_os.c\n@@ -140,28 +140,6 @@\n \treturn 0;\n }\n \n-/*\n- * Unregister callback handler safely. The handler may be active\n- * while we are trying to unregister it, in this case code -EAGAIN\n- * is returned by rte_intr_callback_unregister(). This routine checks\n- * the return code and tries to unregister handler again.\n- *\n- * @param handle\n- *   interrupt handle\n- * @param cb_fn\n- *   pointer to callback routine\n- * @cb_arg\n- *   opaque callback parameter\n- */\n-void\n-mlx5_intr_callback_unregister(const struct rte_intr_handle *handle,\n-\t\t\t      rte_intr_callback_fn cb_fn, void *cb_arg)\n-{\n-\tRTE_SET_USED(handle);\n-\tRTE_SET_USED(cb_fn);\n-\tRTE_SET_USED(cb_arg);\n-}\n-\n /**\n  * DPDK callback to get flow control status.\n  *\ndiff --git a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c\nindex e025be4..fd447cc 100644\n--- a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c\n+++ b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c\n@@ -93,22 +93,10 @@\n static int\n mlx5_vdpa_virtq_unset(struct mlx5_vdpa_virtq *virtq)\n {\n-\tint ret = -EAGAIN;\n-\n-\tif (rte_intr_fd_get(virtq->intr_handle) >= 0) {\n-\t\twhile (ret == -EAGAIN) {\n-\t\t\tret = rte_intr_callback_unregister(virtq->intr_handle,\n-\t\t\t\t\tmlx5_vdpa_virtq_kick_handler, virtq);\n-\t\t\tif (ret == -EAGAIN) {\n-\t\t\t\tDRV_LOG(DEBUG, \"Try again to unregister fd %d of virtq %hu interrupt\",\n-\t\t\t\t\trte_intr_fd_get(virtq->intr_handle),\n-\t\t\t\t\tvirtq->index);\n-\t\t\t\tusleep(MLX5_VDPA_INTR_RETRIES_USEC);\n-\t\t\t}\n-\t\t}\n-\t\trte_intr_fd_set(virtq->intr_handle, -1);\n-\t}\n-\trte_intr_instance_free(virtq->intr_handle);\n+\tint ret;\n+\n+\tmlx5_os_interrupt_handler_destroy(virtq->intr_handle,\n+\t\t\t\t\t  mlx5_vdpa_virtq_kick_handler, virtq);\n \tif (virtq->virtq) {\n \t\tret = mlx5_vdpa_virtq_stop(virtq->priv, virtq->index);\n \t\tif (ret)\n@@ -365,35 +353,13 @@\n \tvirtq->priv = priv;\n \trte_write32(virtq->index, priv->virtq_db_addr);\n \t/* Setup doorbell mapping. */\n-\tvirtq->intr_handle =\n-\t\trte_intr_instance_alloc(RTE_INTR_INSTANCE_F_SHARED);\n+\tvirtq->intr_handle = mlx5_os_interrupt_handler_create(\n+\t\t\t\t  RTE_INTR_INSTANCE_F_SHARED, false,\n+\t\t\t\t  vq.kickfd, mlx5_vdpa_virtq_kick_handler, virtq);\n \tif (virtq->intr_handle == NULL) {\n \t\tDRV_LOG(ERR, \"Fail to allocate intr_handle\");\n \t\tgoto error;\n \t}\n-\n-\tif (rte_intr_fd_set(virtq->intr_handle, vq.kickfd))\n-\t\tgoto error;\n-\n-\tif (rte_intr_fd_get(virtq->intr_handle) == -1) {\n-\t\tDRV_LOG(WARNING, \"Virtq %d kickfd is invalid.\", index);\n-\t} else {\n-\t\tif (rte_intr_type_set(virtq->intr_handle, RTE_INTR_HANDLE_EXT))\n-\t\t\tgoto error;\n-\n-\t\tif (rte_intr_callback_register(virtq->intr_handle,\n-\t\t\t\t\t       mlx5_vdpa_virtq_kick_handler,\n-\t\t\t\t\t       virtq)) {\n-\t\t\trte_intr_fd_set(virtq->intr_handle, -1);\n-\t\t\tDRV_LOG(ERR, \"Failed to register virtq %d interrupt.\",\n-\t\t\t\tindex);\n-\t\t\tgoto error;\n-\t\t} else {\n-\t\t\tDRV_LOG(DEBUG, \"Register fd %d interrupt for virtq %d.\",\n-\t\t\t\trte_intr_fd_get(virtq->intr_handle),\n-\t\t\t\tindex);\n-\t\t}\n-\t}\n \t/* Subscribe virtq error event. */\n \tvirtq->version++;\n \tcookie = ((uint64_t)virtq->version << 32) + index;\n",
    "prefixes": [
        "v9",
        "2/6"
    ]
}