get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 111575,
    "url": "http://patches.dpdk.org/api/patches/111575/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220522055900.417282-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": "<20220522055900.417282-3-spiked@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220522055900.417282-3-spiked@nvidia.com",
    "date": "2022-05-22T05:58:55",
    "name": "[RFC,v2,2/7] common/mlx5: share interrupt management",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e542fbf8dad54b5cd795e681cfd8f673e36b708e",
    "submitter": {
        "id": 2637,
        "url": "http://patches.dpdk.org/api/people/2637/?format=api",
        "name": "Spike Du",
        "email": "spiked@nvidia.com"
    },
    "delegate": {
        "id": 3961,
        "url": "http://patches.dpdk.org/api/users/3961/?format=api",
        "username": "arybchenko",
        "first_name": "Andrew",
        "last_name": "Rybchenko",
        "email": "andrew.rybchenko@oktetlabs.ru"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220522055900.417282-3-spiked@nvidia.com/mbox/",
    "series": [
        {
            "id": 23078,
            "url": "http://patches.dpdk.org/api/series/23078/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=23078",
            "date": "2022-05-22T05:58:53",
            "name": "introduce per-queue limit watermark and host shaper",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/23078/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/111575/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/111575/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 0E160A034C;\n\tSun, 22 May 2022 08:00:05 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id ED98742B76;\n\tSun, 22 May 2022 07:59:45 +0200 (CEST)",
            "from NAM10-MW2-obe.outbound.protection.outlook.com\n (mail-mw2nam10on2082.outbound.protection.outlook.com [40.107.94.82])\n by mails.dpdk.org (Postfix) with ESMTP id 1539942B7A\n for <dev@dpdk.org>; Sun, 22 May 2022 07:59:44 +0200 (CEST)",
            "from DM5PR12CA0066.namprd12.prod.outlook.com (2603:10b6:3:103::28)\n by DM6PR12MB2874.namprd12.prod.outlook.com (2603:10b6:5:15e::29) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.19; Sun, 22 May\n 2022 05:59:35 +0000",
            "from DM6NAM11FT039.eop-nam11.prod.protection.outlook.com\n (2603:10b6:3:103:cafe::d9) by DM5PR12CA0066.outlook.office365.com\n (2603:10b6:3:103::28) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.19 via Frontend\n Transport; Sun, 22 May 2022 05:59:35 +0000",
            "from mail.nvidia.com (12.22.5.236) by\n DM6NAM11FT039.mail.protection.outlook.com (10.13.172.83) with Microsoft SMTP\n Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id\n 15.20.5273.14 via Frontend Transport; Sun, 22 May 2022 05:59:35 +0000",
            "from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL109.nvidia.com\n (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.32;\n Sun, 22 May 2022 05:59:28 +0000",
            "from nvidia.com (10.126.231.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; Sat, 21 May\n 2022 22:59:25 -0700"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=B6yTZponOMPQZsSzZQWKs+/DjynvM9qumFFl/pkKuK4QMP7e0pmrVl9U1RC8R9QDbIb3I6k7wF6RCnokaDm9oFfPbmENYHWglT/i34gBIjV50towfGB02KdJTAEMniRQETquEuVY/vFouF/uMOKGd7tYSMU1gJrXIjfMmICkNOFp4niD1fpjUKDC5MMFyNB4JrYkMMONhRZm2zLanZVnUtBPLZLyzZAo/ADcgufcByyQ75FoBVKlAFW/V7zqaj/la3ami9iGQAZNDUuZBaDWVEhj5qRvbO9rulcd9NJ/7PRBdfz0V43PKZ4Pvm9saqqYgAI6kFBGSILLqeEsM7q3Pw==",
        "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=fa1JeY5+SL5MMcqtjUHoy0HHLEeCe3bntCdWoikKNCM=;\n b=j85JtBA3b+f8CYl/wWKUbrPX4qcbwkfsSbETVfyKseFeje8raSoMS0ebLYDewi0cnqGcw+tAgDC9sV15RsvQJt5utCvU8iHOHTsWx04gXWqInXlmSpUpbO7bWWJhvr1tyZfcFaZ2cs9z/ife9WLY5mTsd4QJE5KCfmrQ4gK/8YaXFI9eKrNy3s84M/PdEZ5ryigYzik3TRd84cFL/XfJHgUEBIxvH5sVt9xijfKsF3+Y4gE65RzM+QJ4u1j8d+0iGcGJCIPCPPBZE+NgwTisa8bljryc2nC3Ny7zqiZcx0baqGQnq5u8ZWCJym9Rxljk7JmSFBkPKCN2TJmyqI1L3w==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 12.22.5.236) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass\n (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none\n (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=fa1JeY5+SL5MMcqtjUHoy0HHLEeCe3bntCdWoikKNCM=;\n b=c8oqXTQUFKOWxtYDSjCGv71G26+P/K13MWuudzV99Th9rkwFpKz/oX+RwL4vG7M3SQ6OjsGI3HoAyNBtrPWO1NsLzP9MzbZuwYUImTE5MvmNaZVLujGRf7235wB7ygDLcxEjETi7C64D7on0qTGAODWeN5wrDz5BPnq0bWXO3WGpre1S+Ujigj2CcVpF4Dt3qpEK8JCfu68Easi+JJas8B7jyPHPWCaKF7k+hUsE+qzt/rpjmQ7MI9ELVD89urvVU6VMFrqqAzA1b//bmZkoiHw8AzcFnPPKFiQFtjYQsfcTt8xYlF72gluENsSouBEJDvaMWL2QcWlKPr9UoSNS7A==",
        "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 12.22.5.236)\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.236 as permitted sender) receiver=protection.outlook.com;\n client-ip=12.22.5.236; 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>",
        "CC": "<dev@dpdk.org>, <rasland@nvidia.com>",
        "Subject": "[RFC v2 2/7] common/mlx5: share interrupt management",
        "Date": "Sun, 22 May 2022 08:58:55 +0300",
        "Message-ID": "<20220522055900.417282-3-spiked@nvidia.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20220522055900.417282-1-spiked@nvidia.com>",
        "References": "<20220506035645.4101714-1-spiked@nvidia.com>\n <20220522055900.417282-1-spiked@nvidia.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.126.231.35]",
        "X-ClientProxiedBy": "rnnvmail203.nvidia.com (10.129.68.9) To\n rnnvmail201.nvidia.com (10.129.68.8)",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-Office365-Filtering-Correlation-Id": "edd4cf6b-3310-4fe6-4a35-08da3bb83fab",
        "X-MS-TrafficTypeDiagnostic": "DM6PR12MB2874:EE_",
        "X-LD-Processed": "43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr",
        "X-Microsoft-Antispam-PRVS": "\n <DM6PR12MB28740A303831B5990774623CA8D59@DM6PR12MB2874.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 5pwpZ1fR5XFQiMgq8/SdGHl58zqKv8ymhTYoOGbrd27Lv5hN9h/ho+dxqygOuNjNfuef9tFE7johYbLZgxQQ1Bh7966OQHj1q1OopT71fe7MCGKP02tYG7TswtPtdENbcAFicKxVN8Vuasan8PpHOFwWgJSqgWdKpOME1+RgNSuJ0KOAzeHmrUJtusTXcjMXVp8tKqbd0wRcDL97TnEFfNphwZBjx9sl5tP6z+4P0nsCmuWzWA8xXKGwnl6EpluKrkfnewIbAxYiIGncJTV7Ko0ZHiJ8z3ORtdYUeNBpT5kosxj27C+IVxVhta7qEZ6egvSX2NjPGgD4p42qPBd8rWGnzESqK3sx4eR/ZmbfXJWMK3OZx64HnT3+oc2rh71QyZFCiXH66Qp9h9WW9SGpOlxhd/By6fOls+MlGEhYOq4Jxtob2ESMPWj816UGD6B+AalSZEvrfrHwK6bRJizoDP3ZpORUHvyG+lsBg8ZWfsNyvBSEWbMsu0tMCPt+GFrxER7l7GDlmC3mmB0jFukbBrcbnWbm+mMNl66bAjXgfNpqOdZhzsAREtsrQEgze8oTuQ9VWC0aTe/TCjp1v0oHm3TxNQvy5NNLpSom0lW1x/YpSfnRFolwdLukkS2vnF0LPAkRE6+5pMp0PfD0DK6iPXhllQPGM2VlxsNOrF/qx9qRlExsOEwI8YZA6uWyXQrjM3PNDNfhF8WL3QE5LNUYiA==",
        "X-Forefront-Antispam-Report": "CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE;\n SFS:(13230001)(4636009)(36840700001)(40470700004)(46966006)(110136005)(81166007)(55016003)(5660300002)(83380400001)(336012)(30864003)(36860700001)(426003)(8936002)(47076005)(1076003)(2616005)(54906003)(107886003)(82310400005)(16526019)(186003)(36756003)(6666004)(316002)(7696005)(508600001)(40460700003)(86362001)(2906002)(6286002)(4326008)(8676002)(70206006)(70586007)(356005)(26005)(36900700001);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "Nvidia.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "22 May 2022 05:59:35.2995 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n edd4cf6b-3310-4fe6-4a35-08da3bb83fab",
        "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.236];\n Helo=[mail.nvidia.com]",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n DM6NAM11FT039.eop-nam11.prod.protection.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "DM6PR12MB2874",
        "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 d40cfd5cd1..f10a981a37 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 @@ mlx5_os_wrapped_mkey_destroy(struct mlx5_pmd_wrapped_mr *pmd_mr)\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 27f1192205..479bb3c7cb 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 @@ __rte_internal\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 a23a30a6c0..413dec14ab 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 ee7973f1ec..e9e9108127 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 @@ void *mlx5_os_umem_reg(void *ctx, void *addr, size_t size, uint32_t access);\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 8fe73f1adb..a276b2ba4f 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 @@ mlx5_dev_interrupt_handler(void *cb_arg)\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 a821153b35..0741028dab 100644\n--- a/drivers/net/mlx5/linux/mlx5_os.c\n+++ b/drivers/net/mlx5/linux/mlx5_os.c\n@@ -2494,40 +2494,6 @@ mlx5_os_net_cleanup(void)\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 @@ mlx5_os_dev_shared_handler_install_lsc(struct mlx5_dev_ctx_shared *sh)\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 @@ mlx5_os_dev_shared_handler_install(struct mlx5_dev_ctx_shared *sh)\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 4882e5fa2f..0e01aff0e7 100644\n--- a/drivers/net/mlx5/linux/mlx5_socket.c\n+++ b/drivers/net/mlx5/linux/mlx5_socket.c\n@@ -133,51 +133,6 @@ mlx5_pmd_socket_handle(void *cb __rte_unused)\n \t\tfclose(file);\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@@ -224,7 +179,10 @@ mlx5_pmd_socket_init(void)\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 @@ mlx5_pmd_socket_uninit(void)\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 305edffe71..7ebb2cc961 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 fe74317fe8..f853a67f58 100644\n--- a/drivers/net/mlx5/mlx5_txpp.c\n+++ b/drivers/net/mlx5/mlx5_txpp.c\n@@ -741,11 +741,8 @@ mlx5_txpp_interrupt_handler(void *cb_arg)\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 @@ mlx5_txpp_start_service(struct mlx5_dev_ctx_shared *sh)\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 f97526580d..88d8213f55 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 @@ mlx5_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)\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 e025be47d2..fd447cc650 100644\n--- a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c\n+++ b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c\n@@ -93,22 +93,10 @@ mlx5_vdpa_virtqs_cleanup(struct mlx5_vdpa_priv *priv)\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 @@ mlx5_vdpa_virtq_setup(struct mlx5_vdpa_priv *priv, int index)\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": [
        "RFC",
        "v2",
        "2/7"
    ]
}