get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 96998,
    "url": "http://patchwork.dpdk.org/api/patches/96998/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20210817134441.1966618-8-michaelba@nvidia.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20210817134441.1966618-8-michaelba@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210817134441.1966618-8-michaelba@nvidia.com",
    "date": "2021-08-17T13:44:27",
    "name": "[RFC,07/21] net/mlx5: improve probe function on Windows",
    "commit_ref": null,
    "pull_url": null,
    "state": "rfc",
    "archived": true,
    "hash": "10f850c8cd70f5fa3da2ef514053e6fe1e3bc6bd",
    "submitter": {
        "id": 1949,
        "url": "http://patchwork.dpdk.org/api/people/1949/?format=api",
        "name": "Michael Baum",
        "email": "michaelba@nvidia.com"
    },
    "delegate": {
        "id": 3268,
        "url": "http://patchwork.dpdk.org/api/users/3268/?format=api",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@nvidia.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20210817134441.1966618-8-michaelba@nvidia.com/mbox/",
    "series": [
        {
            "id": 18314,
            "url": "http://patchwork.dpdk.org/api/series/18314/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=18314",
            "date": "2021-08-17T13:44:20",
            "name": "mlx5: sharing global MR cache between drivers",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/18314/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/96998/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/96998/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 55BAAA0548;\n\tTue, 17 Aug 2021 15:46:28 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 9C6E5411E7;\n\tTue, 17 Aug 2021 15:45:31 +0200 (CEST)",
            "from NAM04-MW2-obe.outbound.protection.outlook.com\n (mail-mw2nam08on2083.outbound.protection.outlook.com [40.107.101.83])\n by mails.dpdk.org (Postfix) with ESMTP id 2D8D6411DB\n for <dev@dpdk.org>; Tue, 17 Aug 2021 15:45:29 +0200 (CEST)",
            "from BN0PR04CA0118.namprd04.prod.outlook.com (2603:10b6:408:ec::33)\n by BN9PR12MB5066.namprd12.prod.outlook.com (2603:10b6:408:133::19)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.17; Tue, 17 Aug\n 2021 13:45:27 +0000",
            "from BN8NAM11FT027.eop-nam11.prod.protection.outlook.com\n (2603:10b6:408:ec:cafe::cf) by BN0PR04CA0118.outlook.office365.com\n (2603:10b6:408:ec::33) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.18 via Frontend\n Transport; Tue, 17 Aug 2021 13:45:27 +0000",
            "from mail.nvidia.com (216.228.112.35) by\n BN8NAM11FT027.mail.protection.outlook.com (10.13.177.96) with Microsoft SMTP\n Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id\n 15.20.4415.14 via Frontend Transport; Tue, 17 Aug 2021 13:45:27 +0000",
            "from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL111.nvidia.com\n (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 17 Aug\n 2021 13:45:26 +0000",
            "from nvidia.com (172.20.187.6) by DRHQMAIL107.nvidia.com\n (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 17 Aug\n 2021 13:45:24 +0000"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=VpC93uwiqV7zxuPXNW69VEOT7xAn68daqpnGf08HEB936YwMulSHQ2mRT/fv3pDrudifoVxbkI9XUDvwXJM9bsls9OxNdoZDPLPJO1XzSGKQjRVVnwnID/fSNkwbx5fuPMtFvCZ/8kjOceBVFHX7cK970Udv3gpBUCOJ2FWy4VEO0d0Gl+blosJM4R/pPGdAB8eGzqBKwq0Y540TAVRvhBX9enoweyeNqtAzsQ15/qhrqBXGOdbi9uRsSWvxjGKeZu5tO3IU/waSYPRtGUfUqQ/RckwWcOr+tXkrhWdRW1kR3OlQnO1S72B5knfefpxjpxE7SG7cyAHyNoxiEjGUZw==",
        "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-SenderADCheck;\n bh=tj9ETY/JgCvGGUw3bG4ji/wbs6BDHl3IRcuTGylCPVc=;\n b=gCQuDKWQm5oEhYKTiBPf3d6B1SNOPb3NkRK5UTNEz2f1Mk3oOuC2QVsjxTIXCWbGZ5xoqzl/Xf8femKDCKnRxbofK6+3wFGs1n2VOAkUrbD2gxDBlkcvsGqNV9Dso62B7kUIwYyVVZ79UcrBpKWQcKHfvDDSiNo8bw4QAgPpCstq3rK/w/NTP1J3yNwVYxDhmLDSMspwWPBLkXjr1yE+Yea83gPFbY4L+OKCCJyckDEtGjeR7hPI9oKljoDvmtzoMohsPwCwtdB1VFICU/+pGigK8L0onMvT7LJkYde2ea9Z/3cGjSDACi65/XaRxboIBQEgprulgKMhF34JJ7druQ==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 216.228.112.35) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com;\n dmarc=pass (p=quarantine sp=none 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=tj9ETY/JgCvGGUw3bG4ji/wbs6BDHl3IRcuTGylCPVc=;\n b=T19MDtcQIfk2AsP6fStE91tGVEUJMufWbHocS+D9ibgxU97v+ZvnlNSSn3dWkWhB2D0ZkA9m/6mbIJoYk5y8+rTWY1msaRj8NAQOc0lUV65Xba6TFeDDbfSTDXLMSjtAIgvRKJUXGhFCixW9KYlszzgI+lsN1/lQeU0izwYU1oBQImpSsLFWd7DGI+YB3ou7gs4zwStZFfHGQqy3uK+humKNCJwBROWojlXEO4h4gDTcM3u/lyCftEE/hI6CwTkaYFbe3dXNsZjdJ7th7Cvt7hdlTKsAUijuwq7hPJvSCX3r7lVe5nyv4DemK+JuPuSLYdHn5bE7SsgLhj9vUVyJ6A==",
        "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 216.228.112.35)\n smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed)\n header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com;",
        "Received-SPF": "Pass (protection.outlook.com: domain of nvidia.com designates\n 216.228.112.35 as permitted sender) receiver=protection.outlook.com;\n client-ip=216.228.112.35; helo=mail.nvidia.com;",
        "From": "Michael Baum <michaelba@nvidia.com>",
        "To": "<dev@dpdk.org>",
        "CC": "Matan Azrad <matan@nvidia.com>, Raslan Darawsheh <rasland@nvidia.com>,\n Viacheslav Ovsiienko <viacheslavo@nvidia.com>",
        "Date": "Tue, 17 Aug 2021 16:44:27 +0300",
        "Message-ID": "<20210817134441.1966618-8-michaelba@nvidia.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20210817134441.1966618-1-michaelba@nvidia.com>",
        "References": "<20210817134441.1966618-1-michaelba@nvidia.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[172.20.187.6]",
        "X-ClientProxiedBy": "HQMAIL111.nvidia.com (172.20.187.18) To\n DRHQMAIL107.nvidia.com (10.27.9.16)",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-Office365-Filtering-Correlation-Id": "21b61ac8-1e23-492e-9e9f-08d961854586",
        "X-MS-TrafficTypeDiagnostic": "BN9PR12MB5066:",
        "X-Microsoft-Antispam-PRVS": "\n <BN9PR12MB5066528C9D81670FCD4A44C4CCFE9@BN9PR12MB5066.namprd12.prod.outlook.com>",
        "X-MS-Oob-TLC-OOBClassifiers": "OLM:8882;",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n OErXcw8Ov0YgE5s0qvpKEoW+IpEWf4Bf6zK+C0I7fHL6mDDt1J8DI3S7xD+fH2xB3LBIpdbHbTjXUan3DX8HJB3CaNXSaDq4MM1xjmkNPhMfMInK8Qw+BtdiU6Lm1J9InLwwJBAid+gUmuRQzCHS2u+8C02q8M0I2FjvSWvyZh04lqpBnGUISnbr+o1wyXvn0QXSt72JlOrPNGhYI6mgyi39N7FJgQo+mlrBNkpSQdsWOo38kdyheTg9wwyC4e65Jzk0u0hjEfobhz5eYQAVK8bc7ChFM4teWNaJBXe1LW58NcayOaBKYsuyV+eKFXvKpaCNcbvHuddaj/ZiRhGq+HGemAf5gwSgyX6pfPbItfY+M9MLpyYP9NwC5XZCqz5CT4VMfTwiLxJTQzApjJyhm5P0dMYj2zifn7sxMdmvm+wwXFTw/NDAEaMvlKqKGqVFsHn4g/fNHN4HXWP9sWniLLOMrkFmOKBuZ+QR1S7U5GNpEdNnXsGYOPPlgWTwmXbay6afDoXfzBTm1XrUFYDIal9SmJ7aZhyPikKdc65fB5DdPHXemhDP9i5+8rMY7lIckIj+894aS2aTReCJoPhWR761/NdSUxwBA6AuF3bNV0uIVhcJDSH901CB9WiV6w1zypP14UchTgJ4EsgxwEZYTfY6LogBOqro8UXOVZJLcKyQIxCjOMxAiqDYSD1yBWICZbAvJKb1lUxQzaHW4iaZoQ==",
        "X-Forefront-Antispam-Report": "CIP:216.228.112.35; CTRY:US; LANG:en; SCL:1;\n SRV:;\n IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid04.nvidia.com; CAT:NONE;\n SFS:(4636009)(396003)(136003)(39860400002)(376002)(346002)(36840700001)(46966006)(1076003)(8676002)(47076005)(36860700001)(36756003)(86362001)(316002)(54906003)(26005)(107886003)(16526019)(186003)(83380400001)(6286002)(4326008)(336012)(426003)(82310400003)(2906002)(6916009)(5660300002)(478600001)(82740400003)(356005)(70206006)(2616005)(70586007)(7636003)(55016002)(8936002)(7696005);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "Nvidia.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "17 Aug 2021 13:45:27.2382 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 21b61ac8-1e23-492e-9e9f-08d961854586",
        "X-MS-Exchange-CrossTenant-Id": "43083d15-7273-40c1-b7db-39efd9ccc17a",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.35];\n Helo=[mail.nvidia.com]",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n BN8NAM11FT027.eop-nam11.prod.protection.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "BN9PR12MB5066",
        "Subject": "[dpdk-dev] [RFC 07/21] net/mlx5: improve probe function on Windows",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "some improvements:\n- use aux function to find match device.\n- use spawn a local variable instead of pointing to a list with a single\nmember.\n\nSigned-off-by: Michael Baum <michaelba@nvidia.com>\n---\n drivers/common/mlx5/mlx5_common.h            |   2 +\n drivers/common/mlx5/version.map              |   1 +\n drivers/common/mlx5/windows/mlx5_common_os.c |   2 +-\n drivers/net/mlx5/windows/mlx5_os.c           | 196 +++----------------\n 4 files changed, 26 insertions(+), 175 deletions(-)",
    "diff": "diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h\nindex 609953b70e..10061f364f 100644\n--- a/drivers/common/mlx5/mlx5_common.h\n+++ b/drivers/common/mlx5/mlx5_common.h\n@@ -465,6 +465,8 @@ int mlx5_os_devx_open_device(struct mlx5_dev_ctx *dev_ctx,\n \t\t\t     struct rte_device *dev, int dbnc,\n \t\t\t     uint32_t classes);\n int mlx5_os_pd_create(struct mlx5_dev_ctx *dev_ctx);\n+__rte_internal\n+struct devx_device_bdf *mlx5_os_get_devx_device(struct rte_device *dev);\n \n \n #endif /* RTE_PMD_MLX5_COMMON_H_ */\ndiff --git a/drivers/common/mlx5/version.map b/drivers/common/mlx5/version.map\nindex 6a88105d02..18856c198e 100644\n--- a/drivers/common/mlx5/version.map\n+++ b/drivers/common/mlx5/version.map\n@@ -145,6 +145,7 @@ INTERNAL {\n \tmlx5_os_dealloc_pd;\n \tmlx5_os_dereg_mr;\n \tmlx5_os_get_ibv_dev; # WINDOWS_NO_EXPORT\n+\tmlx5_os_get_devx_device;\n \tmlx5_os_reg_mr;\n \tmlx5_os_umem_dereg;\n \tmlx5_os_umem_reg;\ndiff --git a/drivers/common/mlx5/windows/mlx5_common_os.c b/drivers/common/mlx5/windows/mlx5_common_os.c\nindex 5d178b0452..12819383c1 100644\n--- a/drivers/common/mlx5/windows/mlx5_common_os.c\n+++ b/drivers/common/mlx5/windows/mlx5_common_os.c\n@@ -144,7 +144,7 @@ mlx5_match_devx_devices_to_addr(struct devx_device_bdf *devx_bdf,\n  * @return\n  *   A device match on success, NULL otherwise and rte_errno is set.\n  */\n-static struct devx_device_bdf *\n+struct devx_device_bdf *\n mlx5_os_get_devx_device(struct rte_device *dev)\n {\n \tint n;\ndiff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c\nindex 7e1df1c751..0ff9e70d96 100644\n--- a/drivers/net/mlx5/windows/mlx5_os.c\n+++ b/drivers/net/mlx5/windows/mlx5_os.c\n@@ -904,68 +904,6 @@ mlx5_os_set_allmulti(struct rte_eth_dev *dev, int enable)\n \treturn -ENOTSUP;\n }\n \n-/**\n- * Detect if a devx_device_bdf object has identical DBDF values to the\n- * rte_pci_addr found in bus/pci probing\n- *\n- * @param[in] devx_bdf\n- *   Pointer to the devx_device_bdf structure.\n- * @param[in] addr\n- *   Pointer to the rte_pci_addr structure.\n- *\n- * @return\n- *   1 on Device match, 0 on mismatch.\n- */\n-static int\n-mlx5_match_devx_bdf_to_addr(struct devx_device_bdf *devx_bdf,\n-\t\t\t    struct rte_pci_addr *addr)\n-{\n-\tif (addr->domain != (devx_bdf->bus_id >> 8) ||\n-\t    addr->bus != (devx_bdf->bus_id & 0xff) ||\n-\t    addr->devid != devx_bdf->dev_id ||\n-\t    addr->function != devx_bdf->fnc_id) {\n-\t\treturn 0;\n-\t}\n-\treturn 1;\n-}\n-\n-/**\n- * Detect if a devx_device_bdf object matches the rte_pci_addr\n- * found in bus/pci probing\n- * Compare both the Native/PF BDF and the raw_bdf representing a VF BDF.\n- *\n- * @param[in] devx_bdf\n- *   Pointer to the devx_device_bdf structure.\n- * @param[in] addr\n- *   Pointer to the rte_pci_addr structure.\n- *\n- * @return\n- *   1 on Device match, 0 on mismatch, rte_errno code on failure.\n- */\n-static int\n-mlx5_match_devx_devices_to_addr(struct devx_device_bdf *devx_bdf,\n-\t\t\t\tstruct rte_pci_addr *addr)\n-{\n-\tint err;\n-\tstruct devx_device mlx5_dev;\n-\n-\tif (mlx5_match_devx_bdf_to_addr(devx_bdf, addr))\n-\t\treturn 1;\n-\t/**\n-\t * Didn't match on Native/PF BDF, could still\n-\t * Match a VF BDF, check it next\n-\t */\n-\terr = mlx5_glue->query_device(devx_bdf, &mlx5_dev);\n-\tif (err) {\n-\t\tDRV_LOG(ERR, \"query_device failed\");\n-\t\trte_errno = err;\n-\t\treturn rte_errno;\n-\t}\n-\tif (mlx5_match_devx_bdf_to_addr(&mlx5_dev.raw_bdf, addr))\n-\t\treturn 1;\n-\treturn 0;\n-}\n-\n /**\n  * DPDK callback to register a PCI device.\n  *\n@@ -981,39 +919,15 @@ int\n mlx5_os_net_probe(struct rte_device *dev)\n {\n \tstruct rte_pci_device *pci_dev = RTE_DEV_TO_PCI(dev);\n-\tstruct devx_device_bdf *devx_bdf_devs, *orig_devx_bdf_devs;\n-\t/*\n-\t * Number of found IB Devices matching with requested PCI BDF.\n-\t * nd != 1 means there are multiple IB devices over the same\n-\t * PCI device and we have representors and master.\n-\t */\n-\tunsigned int nd = 0;\n-\t/*\n-\t * Number of found IB device Ports. nd = 1 and np = 1..n means\n-\t * we have the single multiport IB device, and there may be\n-\t * representors attached to some of found ports.\n-\t * Currently not supported.\n-\t * unsigned int np = 0;\n-\t */\n-\n-\t/*\n-\t * Number of DPDK ethernet devices to Spawn - either over\n-\t * multiple IB devices or multiple ports of single IB device.\n-\t * Actually this is the number of iterations to spawn.\n-\t */\n-\tunsigned int ns = 0;\n-\t/*\n-\t * Bonding device\n-\t *   < 0 - no bonding device (single one)\n-\t *  >= 0 - bonding device (value is slave PF index)\n-\t */\n-\tint bd = -1;\n-\tstruct mlx5_dev_spawn_data *list = NULL;\n+\tstruct mlx5_dev_spawn_data spawn = { .pf_bond = -1 };\n+\tstruct devx_device_bdf *devx_bdf_match = mlx5_os_get_devx_device(dev);\n \tstruct mlx5_dev_config dev_config;\n \tunsigned int dev_config_vf;\n-\tint ret, err;\n+\tint ret;\n \tuint32_t restore;\n \n+\tif (devx_bdf_match == NULL)\n+\t\treturn -rte_errno;\n \tif (rte_eal_process_type() == RTE_PROC_SECONDARY) {\n \t\tDRV_LOG(ERR, \"Secondary process is not supported on Windows.\");\n \t\treturn -ENOTSUP;\n@@ -1024,67 +938,14 @@ mlx5_os_net_probe(struct rte_device *dev)\n \t\t\tstrerror(rte_errno));\n \t\treturn -rte_errno;\n \t}\n-\terrno = 0;\n-\tdevx_bdf_devs = mlx5_glue->get_device_list(&ret);\n-\torig_devx_bdf_devs = devx_bdf_devs;\n-\tif (!devx_bdf_devs) {\n-\t\trte_errno = errno ? errno : ENOSYS;\n-\t\tDRV_LOG(ERR, \"cannot list devices, is ib_uverbs loaded?\");\n-\t\treturn -rte_errno;\n-\t}\n-\t/*\n-\t * First scan the list of all Infiniband devices to find\n-\t * matching ones, gathering into the list.\n-\t */\n-\tstruct devx_device_bdf *devx_bdf_match[ret + 1];\n-\n-\twhile (ret-- > 0) {\n-\t\terr = mlx5_match_devx_devices_to_addr(devx_bdf_devs,\n-\t\t    &pci_dev->addr);\n-\t\tif (!err) {\n-\t\t\tdevx_bdf_devs++;\n-\t\t\tcontinue;\n-\t\t}\n-\t\tif (err != 1) {\n-\t\t\tret = -err;\n-\t\t\tgoto exit;\n-\t\t}\n-\t\tdevx_bdf_match[nd++] = devx_bdf_devs;\n-\t}\n-\tdevx_bdf_match[nd] = NULL;\n-\tif (!nd) {\n-\t\t/* No device matches, just complain and bail out. */\n-\t\tDRV_LOG(WARNING,\n-\t\t\t\"no DevX device matches PCI device \" PCI_PRI_FMT \",\"\n-\t\t\t\" is DevX Configured?\",\n-\t\t\tpci_dev->addr.domain, pci_dev->addr.bus,\n-\t\t\tpci_dev->addr.devid, pci_dev->addr.function);\n-\t\trte_errno = ENOENT;\n-\t\tret = -rte_errno;\n-\t\tgoto exit;\n-\t}\n-\t/*\n-\t * Now we can determine the maximal\n-\t * amount of devices to be spawned.\n-\t */\n-\tlist = mlx5_malloc(MLX5_MEM_ZERO,\n-\t\t\t   sizeof(struct mlx5_dev_spawn_data),\n-\t\t\t   RTE_CACHE_LINE_SIZE, SOCKET_ID_ANY);\n-\tif (!list) {\n-\t\tDRV_LOG(ERR, \"spawn data array allocation failure\");\n-\t\trte_errno = ENOMEM;\n-\t\tret = -rte_errno;\n-\t\tgoto exit;\n-\t}\n-\tmemset(&list[ns].info, 0, sizeof(list[ns].info));\n-\tlist[ns].max_port = 1;\n-\tlist[ns].phys_port = 1;\n-\tlist[ns].phys_dev = devx_bdf_match[ns];\n-\tlist[ns].eth_dev = NULL;\n-\tlist[ns].pci_dev = pci_dev;\n-\tlist[ns].pf_bond = bd;\n-\tlist[ns].ifindex = -1; /* Spawn will assign */\n-\tlist[ns].info =\n+\tmemset(&spawn.info, 0, sizeof(spawn.info));\n+\tspawn.max_port = 1;\n+\tspawn.phys_port = 1;\n+\tspawn.phys_dev = devx_bdf_match;\n+\tspawn.eth_dev = NULL;\n+\tspawn.pci_dev = pci_dev;\n+\tspawn.ifindex = -1; /* Spawn will assign */\n+\tspawn.info =\n \t\t(struct mlx5_switch_info){\n \t\t\t.master = 0,\n \t\t\t.representor = 0,\n@@ -1125,29 +986,16 @@ mlx5_os_net_probe(struct rte_device *dev)\n \tdev_config.dv_flow_en = 1;\n \tdev_config.decap_en = 0;\n \tdev_config.log_hp_size = MLX5_ARG_UNSET;\n-\tlist[ns].numa_node = pci_dev->device.numa_node;\n-\tlist[ns].eth_dev = mlx5_dev_spawn(&pci_dev->device,\n-\t\t\t\t\t  &list[ns],\n-\t\t\t\t\t  &dev_config);\n-\tif (!list[ns].eth_dev)\n-\t\tgoto exit;\n-\trestore = list[ns].eth_dev->data->dev_flags;\n-\trte_eth_copy_pci_info(list[ns].eth_dev, pci_dev);\n+\tspawn.numa_node = pci_dev->device.numa_node;\n+\tspawn.eth_dev = mlx5_dev_spawn(dev, &spawn, &dev_config);\n+\tif (!spawn.eth_dev)\n+\t\treturn -rte_errno;\n+\trestore = spawn.eth_dev->data->dev_flags;\n+\trte_eth_copy_pci_info(spawn.eth_dev, pci_dev);\n \t/* Restore non-PCI flags cleared by the above call. */\n-\tlist[ns].eth_dev->data->dev_flags |= restore;\n-\trte_eth_dev_probing_finish(list[ns].eth_dev);\n-\tret = 0;\n-exit:\n-\t/*\n-\t * Do the routine cleanup:\n-\t * - free allocated spawn data array\n-\t * - free the device list\n-\t */\n-\tif (list)\n-\t\tmlx5_free(list);\n-\tMLX5_ASSERT(orig_devx_bdf_devs);\n-\tmlx5_glue->free_device_list(orig_devx_bdf_devs);\n-\treturn ret;\n+\tspawn.eth_dev->data->dev_flags |= restore;\n+\trte_eth_dev_probing_finish(spawn.eth_dev);\n+\treturn 0;\n }\n \n /**\n",
    "prefixes": [
        "RFC",
        "07/21"
    ]
}