get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 42731,
    "url": "http://patches.dpdk.org/api/patches/42731/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180710155743.14448-4-adrien.mazarguil@6wind.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": "<20180710155743.14448-4-adrien.mazarguil@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180710155743.14448-4-adrien.mazarguil@6wind.com",
    "date": "2018-07-10T16:04:46",
    "name": "[v5,03/10] net/mlx5: drop useless support for several Verbs ports",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "5727825f45ad345ea19e750a5afe8978b578524e",
    "submitter": {
        "id": 165,
        "url": "http://patches.dpdk.org/api/people/165/?format=api",
        "name": "Adrien Mazarguil",
        "email": "adrien.mazarguil@6wind.com"
    },
    "delegate": {
        "id": 6624,
        "url": "http://patches.dpdk.org/api/users/6624/?format=api",
        "username": "shahafs",
        "first_name": "Shahaf",
        "last_name": "Shuler",
        "email": "shahafs@mellanox.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20180710155743.14448-4-adrien.mazarguil@6wind.com/mbox/",
    "series": [
        {
            "id": 501,
            "url": "http://patches.dpdk.org/api/series/501/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=501",
            "date": "2018-07-10T16:04:39",
            "name": "net/mlx5: add port representor support",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/501/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/42731/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/42731/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 3DB961B439;\n\tTue, 10 Jul 2018 18:05:07 +0200 (CEST)",
            "from mail-wm0-f67.google.com (mail-wm0-f67.google.com\n\t[74.125.82.67]) by dpdk.org (Postfix) with ESMTP id 268B31B1D3\n\tfor <dev@dpdk.org>; Tue, 10 Jul 2018 18:05:03 +0200 (CEST)",
            "by mail-wm0-f67.google.com with SMTP id v25-v6so25240046wmc.0\n\tfor <dev@dpdk.org>; Tue, 10 Jul 2018 09:05:03 -0700 (PDT)",
            "from 6wind.com (host.78.145.23.62.rev.coltfrance.com.\n\t[62.23.145.78]) by smtp.gmail.com with ESMTPSA id\n\t125-v6sm35478652wmw.9.2018.07.10.09.05.01\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 10 Jul 2018 09:05:01 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to;\n\tbh=9hrYhb06M81OLEec/FAJOkvBG9oAKlUR/iA+Ybmj35w=;\n\tb=qW+ESj4d5L3L9vy0tFB0kv2j0FCQLIcKfd7DwW+ylvESvqMfNo/NFzsUBu+7KNPYp9\n\tCwzUxMtCxzmlfnatDecbcNiqxL5e9xZtmpsUXloXhWDWZa1cMdIscAzyg5FE/yHtYoSs\n\tYHA6ZGNcA3sKfGPnWz6acdmcAl+7CH7PbcLqE/PYh/7NTBZ0JfM36RuTsbGN4slRjwfr\n\tiwRKH0Hba7Q+vYPRlp60xP09MYJiCLC/ku84kSdqUPal1GstDLaXKRXICVy9850CUHyK\n\tdqj+vXBSuThaBlfQ8UCdVPYPwv0i5wWUNRsl8nenp0UTfPq0HQaAPLSA1a7xmjXfnTYl\n\tVPSA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to;\n\tbh=9hrYhb06M81OLEec/FAJOkvBG9oAKlUR/iA+Ybmj35w=;\n\tb=Jyw47h7NjyAdbbrzsUQJzgYFuYVGnFIFaCjNz0ZNSnxhpmljGuHefkQXGcnHPFR6bI\n\t6TAVO7C6odv/teJyEPFjjQPnjrAH4xpXTEh33JZw1T1OIpKYC+fIgDc0c4ziKZOFo+kr\n\t2tWxlGogGUuKgf/hVPqfXV/KN3Z+szAplJAdi9jefhULAu1ovD5/Wr0MZNq7xrZxs6Hh\n\tluWghu5sjptTC4Q272OaTjRLd/oUU6vG1v1Bjj+b8J+uOKNfe3UsZyoHyainQ6jHgS9k\n\tGfPOZnN20Jw66Oaiu5vzmJk29rzP92Pwbh3pJKTPIW5ZkRXoA4mDorT1M6TReQQULh/F\n\tAGpg==",
        "X-Gm-Message-State": "APt69E3hNgRdTkZv4tknMIZMHa8TiM1yC/1wQ5jM5/83shRCrdU1SSJG\n\tt6NPqxpIRcjSS9PmzkjrWtxZMg==",
        "X-Google-Smtp-Source": "AAOMgpf6TdcDE/dBGNmIxHg2Tkz3k79K3Ut+Uyb9BRfgZdz7Cn5gaH4our1qZKM7MDhKY2J8g3yQgA==",
        "X-Received": "by 2002:a1c:b801:: with SMTP id\n\ti1-v6mr14599425wmf.30.1531238702816; \n\tTue, 10 Jul 2018 09:05:02 -0700 (PDT)",
        "Date": "Tue, 10 Jul 2018 18:04:46 +0200",
        "From": "Adrien Mazarguil <adrien.mazarguil@6wind.com>",
        "To": "Shahaf Shuler <shahafs@mellanox.com>",
        "Cc": "dev@dpdk.org, Xueming Li <xuemingl@mellanox.com>",
        "Message-ID": "<20180710155743.14448-4-adrien.mazarguil@6wind.com>",
        "References": "<20180705083934.5535-1-adrien.mazarguil@6wind.com>\n\t<20180710155743.14448-1-adrien.mazarguil@6wind.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=us-ascii",
        "Content-Disposition": "inline",
        "In-Reply-To": "<20180710155743.14448-1-adrien.mazarguil@6wind.com>",
        "X-Mailer": "git-send-email 2.11.0",
        "Subject": "[dpdk-dev] [PATCH v5 03/10] net/mlx5: drop useless support for\n\tseveral Verbs ports",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Unlike mlx4 from which this capability was inherited, mlx5 devices expose\nexactly one Verbs port per PCI bus address. Each physical port gets\nassigned its own bus address with a single Verbs port.\n\nWhile harmless, this code requires an extra loop that would get in the way\nof subsequent refactoring.\n\nNo functional impact.\n\nSigned-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>\nCc: Shahaf Shuler <shahafs@mellanox.com>\nCc: Xueming Li <xuemingl@mellanox.com>\n--\nv3 changes:\n\nThis patch was not present in prior revisions. As discussed [1], it was\nadded after finally deciding to remove this support.\n\n[1] https://mails.dpdk.org/archives/dev/2018-June/105661.html\n---\n drivers/net/mlx5/mlx5.c        | 96 +++++++++++++------------------------\n drivers/net/mlx5/mlx5.h        |  1 -\n drivers/net/mlx5/mlx5_ethdev.c |  2 +-\n drivers/net/mlx5/mlx5_txq.c    |  2 +-\n 4 files changed, 34 insertions(+), 67 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex 4e7f29f5b..717d8b268 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -652,11 +652,13 @@ static int\n mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \t       struct rte_pci_device *pci_dev)\n {\n-\tstruct ibv_device **list = NULL;\n-\tstruct ibv_device *ibv_dev;\n+\tstruct ibv_device **list;\n \tstruct ibv_context *ctx = NULL;\n \tstruct ibv_device_attr_ex attr;\n+\tstruct ibv_pd *pd = NULL;\n \tstruct mlx5dv_context dv_attr = { .comp_mask = 0 };\n+\tstruct rte_eth_dev *eth_dev = NULL;\n+\tstruct priv *priv = NULL;\n \tint err = 0;\n \tunsigned int vf = 0;\n \tunsigned int mps;\n@@ -719,6 +721,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \t\terr = rte_errno;\n \t\tbreak;\n \t}\n+\tmlx5_glue->free_device_list(list);\n \tif (ctx == NULL) {\n \t\tswitch (err) {\n \t\tcase 0:\n@@ -733,7 +736,6 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \t\t}\n \t\tgoto error;\n \t}\n-\tibv_dev = list[i];\n \tDRV_LOG(DEBUG, \"device opened\");\n #ifdef HAVE_IBV_MLX5_MOD_SWP\n \tdv_attr.comp_mask |= MLX5DV_CONTEXT_MASK_SWP;\n@@ -827,15 +829,9 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \t\tDEBUG(\"ibv_query_device_ex() failed\");\n \t\tgoto error;\n \t}\n-\tDRV_LOG(INFO, \"%u port(s) detected\", attr.orig_attr.phys_port_cnt);\n-\tfor (i = 0; i < attr.orig_attr.phys_port_cnt; i++) {\n+\t{\n \t\tchar name[RTE_ETH_NAME_MAX_LEN];\n-\t\tint len;\n-\t\tuint32_t port = i + 1; /* ports are indexed from one */\n \t\tstruct ibv_port_attr port_attr;\n-\t\tstruct ibv_pd *pd = NULL;\n-\t\tstruct priv *priv = NULL;\n-\t\tstruct rte_eth_dev *eth_dev = NULL;\n \t\tstruct ether_addr mac;\n \t\tstruct mlx5_dev_config config = {\n \t\t\t.cqe_comp = cqe_comp,\n@@ -859,11 +855,9 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \t\t\t},\n \t\t};\n \n-\t\tlen = snprintf(name, sizeof(name), PCI_PRI_FMT,\n+\t\tsnprintf(name, sizeof(name), PCI_PRI_FMT,\n \t\t\t pci_dev->addr.domain, pci_dev->addr.bus,\n \t\t\t pci_dev->addr.devid, pci_dev->addr.function);\n-\t\tif (attr.orig_attr.phys_port_cnt > 1)\n-\t\t\tsnprintf(name + len, sizeof(name), \" port %u\", i);\n \t\tif (rte_eal_process_type() == RTE_PROC_SECONDARY) {\n \t\t\teth_dev = rte_eth_dev_attach_secondary(name);\n \t\t\tif (eth_dev == NULL) {\n@@ -901,31 +895,22 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \t\t\teth_dev->tx_pkt_burst =\n \t\t\t\tmlx5_select_tx_function(eth_dev);\n \t\t\trte_eth_dev_probing_finish(eth_dev);\n-\t\t\tcontinue;\n-\t\t}\n-\t\tDRV_LOG(DEBUG, \"using port %u\", port);\n-\t\tif (!ctx)\n-\t\t\tctx = mlx5_glue->open_device(ibv_dev);\n-\t\tif (ctx == NULL) {\n-\t\t\terr = ENODEV;\n-\t\t\tgoto port_error;\n+\t\t\tclaim_zero(mlx5_glue->close_device(ctx));\n+\t\t\treturn 0;\n \t\t}\n \t\t/* Check port status. */\n-\t\terr = mlx5_glue->query_port(ctx, port, &port_attr);\n+\t\terr = mlx5_glue->query_port(ctx, 1, &port_attr);\n \t\tif (err) {\n \t\t\tDRV_LOG(ERR, \"port query failed: %s\", strerror(err));\n-\t\t\tgoto port_error;\n+\t\t\tgoto error;\n \t\t}\n \t\tif (port_attr.link_layer != IBV_LINK_LAYER_ETHERNET) {\n-\t\t\tDRV_LOG(ERR,\n-\t\t\t\t\"port %d is not configured in Ethernet mode\",\n-\t\t\t\tport);\n+\t\t\tDRV_LOG(ERR, \"port is not configured in Ethernet mode\");\n \t\t\terr = EINVAL;\n-\t\t\tgoto port_error;\n+\t\t\tgoto error;\n \t\t}\n \t\tif (port_attr.state != IBV_PORT_ACTIVE)\n-\t\t\tDRV_LOG(DEBUG, \"port %d is not active: \\\"%s\\\" (%d)\",\n-\t\t\t\tport,\n+\t\t\tDRV_LOG(DEBUG, \"port is not active: \\\"%s\\\" (%d)\",\n \t\t\t\tmlx5_glue->port_state_str(port_attr.state),\n \t\t\t\tport_attr.state);\n \t\t/* Allocate protection domain. */\n@@ -933,7 +918,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \t\tif (pd == NULL) {\n \t\t\tDRV_LOG(ERR, \"PD allocation failure\");\n \t\t\terr = ENOMEM;\n-\t\t\tgoto port_error;\n+\t\t\tgoto error;\n \t\t}\n \t\t/* from rte_ethdev.c */\n \t\tpriv = rte_zmalloc(\"ethdev private structure\",\n@@ -942,13 +927,12 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \t\tif (priv == NULL) {\n \t\t\tDRV_LOG(ERR, \"priv allocation failure\");\n \t\t\terr = ENOMEM;\n-\t\t\tgoto port_error;\n+\t\t\tgoto error;\n \t\t}\n \t\tpriv->ctx = ctx;\n \t\tstrncpy(priv->ibdev_path, priv->ctx->device->ibdev_path,\n \t\t\tsizeof(priv->ibdev_path));\n \t\tpriv->device_attr = attr;\n-\t\tpriv->port = port;\n \t\tpriv->pd = pd;\n \t\tpriv->mtu = ETHER_MTU;\n \t\terr = mlx5_args(&config, pci_dev->device.devargs);\n@@ -956,7 +940,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \t\t\terr = rte_errno;\n \t\t\tDRV_LOG(ERR, \"failed to process device arguments: %s\",\n \t\t\t\tstrerror(rte_errno));\n-\t\t\tgoto port_error;\n+\t\t\tgoto error;\n \t\t}\n \t\tconfig.hw_csum = !!(attr.device_cap_flags_ex &\n \t\t\t\t    IBV_DEVICE_RAW_IP_CSUM);\n@@ -1006,7 +990,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \t\t\t\t\"multi-packet send not supported on this device\"\n \t\t\t\t\" (\" MLX5_TXQ_MPW_EN \")\");\n \t\t\terr = ENOTSUP;\n-\t\t\tgoto port_error;\n+\t\t\tgoto error;\n \t\t}\n \t\tDRV_LOG(INFO, \"%s MPS is %s\",\n \t\t\tconfig.mps == MLX5_MPW_ENHANCED ? \"enhanced \" : \"\",\n@@ -1038,7 +1022,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \t\tif (eth_dev == NULL) {\n \t\t\tDRV_LOG(ERR, \"can not allocate rte ethdev\");\n \t\t\terr = ENOMEM;\n-\t\t\tgoto port_error;\n+\t\t\tgoto error;\n \t\t}\n \t\teth_dev->data->dev_private = priv;\n \t\tpriv->dev_data = eth_dev->data;\n@@ -1049,7 +1033,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \t\terr = mlx5_uar_init_primary(eth_dev);\n \t\tif (err) {\n \t\t\terr = rte_errno;\n-\t\t\tgoto port_error;\n+\t\t\tgoto error;\n \t\t}\n \t\t/* Configure the first MAC address by default. */\n \t\tif (mlx5_get_mac(eth_dev, &mac.addr_bytes)) {\n@@ -1058,7 +1042,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \t\t\t\t\" loaded? (errno: %s)\",\n \t\t\t\teth_dev->data->port_id, strerror(rte_errno));\n \t\t\terr = ENODEV;\n-\t\t\tgoto port_error;\n+\t\t\tgoto error;\n \t\t}\n \t\tDRV_LOG(INFO,\n \t\t\t\"port %u MAC address is %02x:%02x:%02x:%02x:%02x:%02x\",\n@@ -1082,7 +1066,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \t\terr = mlx5_get_mtu(eth_dev, &priv->mtu);\n \t\tif (err) {\n \t\t\terr = rte_errno;\n-\t\t\tgoto port_error;\n+\t\t\tgoto error;\n \t\t}\n \t\tDRV_LOG(DEBUG, \"port %u MTU is %u\", eth_dev->data->port_id,\n \t\t\tpriv->mtu);\n@@ -1131,7 +1115,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \t\t\tDRV_LOG(ERR, \"port %u drop queue allocation failed: %s\",\n \t\t\t\teth_dev->data->port_id, strerror(rte_errno));\n \t\t\terr = rte_errno;\n-\t\t\tgoto port_error;\n+\t\t\tgoto error;\n \t\t}\n \t\t/* Supported Verbs flow priority number detection. */\n \t\tif (verb_priorities == 0)\n@@ -1140,7 +1124,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \t\t\tDRV_LOG(ERR, \"port %u wrong Verbs flow priorities: %u\",\n \t\t\t\teth_dev->data->port_id, verb_priorities);\n \t\t\terr = ENOTSUP;\n-\t\t\tgoto port_error;\n+\t\t\tgoto error;\n \t\t}\n \t\tpriv->config.max_verbs_prio = verb_priorities;\n \t\t/*\n@@ -1154,7 +1138,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \t\t\t\t\t eth_dev->device->numa_node);\n \t\tif (err) {\n \t\t\terr = rte_errno;\n-\t\t\tgoto port_error;\n+\t\t\tgoto error;\n \t\t}\n \t\t/* Add device to memory callback list. */\n \t\trte_rwlock_write_lock(&mlx5_shared_data->mem_event_rwlock);\n@@ -1162,33 +1146,17 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \t\t\t\t priv, mem_event_cb);\n \t\trte_rwlock_write_unlock(&mlx5_shared_data->mem_event_rwlock);\n \t\trte_eth_dev_probing_finish(eth_dev);\n-\t\t/*\n-\t\t * Each eth_dev instance is assigned its own Verbs context,\n-\t\t * since this one is consumed, let the next iteration open\n-\t\t * another.\n-\t\t */\n-\t\tctx = NULL;\n-\t\tcontinue;\n-port_error:\n-\t\tif (priv)\n-\t\t\trte_free(priv);\n-\t\tif (pd)\n-\t\t\tclaim_zero(mlx5_glue->dealloc_pd(pd));\n-\t\tif (eth_dev && rte_eal_process_type() == RTE_PROC_PRIMARY)\n-\t\t\trte_eth_dev_release_port(eth_dev);\n-\t\tbreak;\n+\t\treturn 0;\n \t}\n-\t/*\n-\t * XXX if something went wrong in the loop above, there is a resource\n-\t * leak (ctx, pd, priv, dpdk ethdev) but we can do nothing about it as\n-\t * long as the dpdk does not provide a way to deallocate a ethdev and a\n-\t * way to enumerate the registered ethdevs to free the previous ones.\n-\t */\n error:\n+\tif (priv)\n+\t\trte_free(priv);\n+\tif (pd)\n+\t\tclaim_zero(mlx5_glue->dealloc_pd(pd));\n+\tif (eth_dev)\n+\t\trte_eth_dev_release_port(eth_dev);\n \tif (ctx)\n \t\tclaim_zero(mlx5_glue->close_device(ctx));\n-\tif (list)\n-\t\tmlx5_glue->free_device_list(list);\n \tif (err) {\n \t\trte_errno = err;\n \t\treturn -rte_errno;\ndiff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex 997b04a33..f55ff4a21 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -159,7 +159,6 @@ struct priv {\n \tunsigned int vlan_filter_n; /* Number of configured VLAN filters. */\n \t/* Device properties. */\n \tuint16_t mtu; /* Configured MTU. */\n-\tuint8_t port; /* Physical port number. */\n \tunsigned int isolated:1; /* Whether isolated mode is enabled. */\n \t/* RX/TX queues. */\n \tunsigned int rxqs_n; /* RX queues array size. */\ndiff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c\nindex ebe5cb6e3..819f5baad 100644\n--- a/drivers/net/mlx5/mlx5_ethdev.c\n+++ b/drivers/net/mlx5/mlx5_ethdev.c\n@@ -166,7 +166,7 @@ mlx5_get_ifname(const struct rte_eth_dev *dev, char (*ifname)[IF_NAMESIZE])\n \t\tif (dev_port == dev_port_prev)\n \t\t\tgoto try_dev_id;\n \t\tdev_port_prev = dev_port;\n-\t\tif (dev_port == (priv->port - 1u))\n+\t\tif (dev_port == 0)\n \t\t\tstrlcpy(match, name, sizeof(match));\n \t}\n \tclosedir(dir);\ndiff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c\nindex 669b91319..5057561ae 100644\n--- a/drivers/net/mlx5/mlx5_txq.c\n+++ b/drivers/net/mlx5/mlx5_txq.c\n@@ -434,7 +434,7 @@ mlx5_txq_ibv_new(struct rte_eth_dev *dev, uint16_t idx)\n \t\t/* Move the QP to this state. */\n \t\t.qp_state = IBV_QPS_INIT,\n \t\t/* Primary port number. */\n-\t\t.port_num = priv->port\n+\t\t.port_num = 1,\n \t};\n \tret = mlx5_glue->modify_qp(tmpl.qp, &attr.mod,\n \t\t\t\t   (IBV_QP_STATE | IBV_QP_PORT));\n",
    "prefixes": [
        "v5",
        "03/10"
    ]
}