get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 60616,
    "url": "https://patches.dpdk.org/api/patches/60616/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1570456579-5075-1-git-send-email-viacheslavo@mellanox.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<1570456579-5075-1-git-send-email-viacheslavo@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1570456579-5075-1-git-send-email-viacheslavo@mellanox.com",
    "date": "2019-10-07T13:56:19",
    "name": "net/mlx5: fix device scan within switch domain",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "1fcde2b92c468617672a98863c0b5364c121f147",
    "submitter": {
        "id": 1102,
        "url": "https://patches.dpdk.org/api/people/1102/?format=api",
        "name": "Slava Ovsiienko",
        "email": "viacheslavo@mellanox.com"
    },
    "delegate": {
        "id": 3268,
        "url": "https://patches.dpdk.org/api/users/3268/?format=api",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@nvidia.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1570456579-5075-1-git-send-email-viacheslavo@mellanox.com/mbox/",
    "series": [
        {
            "id": 6721,
            "url": "https://patches.dpdk.org/api/series/6721/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=6721",
            "date": "2019-10-07T13:56:19",
            "name": "net/mlx5: fix device scan within switch domain",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/6721/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/60616/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/60616/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 C18941C20B;\n\tMon,  7 Oct 2019 15:56:24 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n\tby dpdk.org (Postfix) with ESMTP id CAA361C1F8\n\tfor <dev@dpdk.org>; Mon,  7 Oct 2019 15:56:23 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n\tviacheslavo@mellanox.com)\n\twith ESMTPS (AES256-SHA encrypted); 7 Oct 2019 15:56:21 +0200",
            "from pegasus11.mtr.labs.mlnx (pegasus11.mtr.labs.mlnx\n\t[10.210.16.104])\n\tby labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x97DuLNp017377;\n\tMon, 7 Oct 2019 16:56:21 +0300",
            "from pegasus11.mtr.labs.mlnx (localhost [127.0.0.1])\n\tby pegasus11.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id\n\tx97DuLQ4005114; Mon, 7 Oct 2019 13:56:21 GMT",
            "(from viacheslavo@localhost)\n\tby pegasus11.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id x97DuKrn005113; \n\tMon, 7 Oct 2019 13:56:20 GMT"
        ],
        "X-Authentication-Warning": "pegasus11.mtr.labs.mlnx: viacheslavo set sender to\n\tviacheslavo@mellanox.com using -f",
        "From": "Viacheslav Ovsiienko <viacheslavo@mellanox.com>",
        "To": "dev@dpdk.org",
        "Cc": "matan@mellanox.com, rasland@mellanox.com",
        "Date": "Mon,  7 Oct 2019 13:56:19 +0000",
        "Message-Id": "<1570456579-5075-1-git-send-email-viacheslavo@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "Subject": "[dpdk-dev] [PATCH] net/mlx5: fix device scan within switch domain",
        "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": "In LAG configuration the devices in the same switch domain\nmight be spawned on the base of different PCI devices, so\nwe should check all devices backed by mlx5 PMD whether they\nbelong to specified switch domain. When the new devices are\nbeing created it is not possible to detect whether the\nsibling devices created in the current probe() loop belong\nto the driver, driver field is not filled yet (it will be\ndone on returned success of current probe()). This patch\nupdates the device scanning, allowing extra match on\ncurrent backing PCI device, is being used to create siblings.\n\nFixes: 9f4a56d68966 (\"net/mlx5: extend switch domain searching range\")\n\nSigned-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>\n---\n drivers/net/mlx5/mlx5.c        | 30 +++++++++++++++++++++++-------\n drivers/net/mlx5/mlx5.h        |  8 ++++----\n drivers/net/mlx5/mlx5_ethdev.c |  4 ++--\n 3 files changed, 29 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex 13d112e..f886d51 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -927,7 +927,7 @@ struct mlx5_dev_spawn_data {\n \t\tunsigned int c = 0;\n \t\tuint16_t port_id;\n \n-\t\tMLX5_ETH_FOREACH_DEV(port_id) {\n+\t\tMLX5_ETH_FOREACH_DEV(port_id, priv->pci_dev) {\n \t\t\tstruct mlx5_priv *opriv =\n \t\t\t\trte_eth_devices[port_id].data->dev_private;\n \n@@ -1546,7 +1546,7 @@ struct mlx5_dev_spawn_data {\n \tif (sh->refcnt == 1)\n \t\treturn 0;\n \t/* Find the device with shared context. */\n-\tMLX5_ETH_FOREACH_DEV(port_id) {\n+\tMLX5_ETH_FOREACH_DEV(port_id, priv->pci_dev) {\n \t\tstruct mlx5_priv *opriv =\n \t\t\trte_eth_devices[port_id].data->dev_private;\n \n@@ -1904,7 +1904,7 @@ struct mlx5_dev_spawn_data {\n \t * Look for sibling devices in order to reuse their switch domain\n \t * if any, otherwise allocate one.\n \t */\n-\tMLX5_ETH_FOREACH_DEV(port_id) {\n+\tMLX5_ETH_FOREACH_DEV(port_id, priv->pci_dev) {\n \t\tconst struct mlx5_priv *opriv =\n \t\t\trte_eth_devices[port_id].data->dev_private;\n \n@@ -2782,17 +2782,33 @@ struct mlx5_dev_spawn_data {\n \treturn ret;\n }\n \n+/**\n+ * Look for the ethernet device belonging to mlx5 driver.\n+ *\n+ * @param[in] port_id\n+ *   port_id to start looking for device.\n+ * @param[in] pci_dev\n+ *   Pointer to the hint PCI device. When device is being probed\n+ *   the its siblings (master and preceding representors might\n+ *   not have assigned driver yet (because the mlx5_pci_probe()\n+ *   is not completed yet, for this case match on hint PCI\n+ *   device may be used to detect sibling device.\n+ *\n+ * @return\n+ *   port_id of found device, RTE_MAX_ETHPORT if not found.\n+ */\n uint16_t\n-mlx5_eth_find_next(uint16_t port_id)\n+mlx5_eth_find_next(uint16_t port_id, struct rte_pci_device *pci_dev)\n {\n \twhile (port_id < RTE_MAX_ETHPORTS) {\n \t\tstruct rte_eth_dev *dev = &rte_eth_devices[port_id];\n \n \t\tif (dev->state != RTE_ETH_DEV_UNUSED &&\n \t\t    dev->device &&\n-\t\t    dev->device->driver &&\n-\t\t    dev->device->driver->name &&\n-\t\t    !strcmp(dev->device->driver->name, MLX5_DRIVER_NAME))\n+\t\t    (dev->device == &pci_dev->device ||\n+\t\t     (dev->device->driver &&\n+\t\t     dev->device->driver->name &&\n+\t\t     !strcmp(dev->device->driver->name, MLX5_DRIVER_NAME))))\n \t\t\tbreak;\n \t\tport_id++;\n \t}\ndiff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex 164df11..baf945c 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -682,13 +682,13 @@ int32_t mlx5_release_dbr(struct rte_eth_dev *dev, uint32_t umem_id,\n \t\t\t uint64_t offset);\n int mlx5_udp_tunnel_port_add(struct rte_eth_dev *dev,\n \t\t\t      struct rte_eth_udp_tunnel *udp_tunnel);\n-uint16_t mlx5_eth_find_next(uint16_t port_id);\n+uint16_t mlx5_eth_find_next(uint16_t port_id, struct rte_pci_device *pci_dev);\n \n /* Macro to iterate over all valid ports for mlx5 driver. */\n-#define MLX5_ETH_FOREACH_DEV(port_id) \\\n-\tfor (port_id = mlx5_eth_find_next(0); \\\n+#define MLX5_ETH_FOREACH_DEV(port_id, pci_dev) \\\n+\tfor (port_id = mlx5_eth_find_next(0, pci_dev); \\\n \t     port_id < RTE_MAX_ETHPORTS; \\\n-\t     port_id = mlx5_eth_find_next(port_id + 1))\n+\t     port_id = mlx5_eth_find_next(port_id + 1, pci_dev))\n \n /* mlx5_ethdev.c */\n \ndiff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c\nindex aa645d0..f2b1752 100644\n--- a/drivers/net/mlx5/mlx5_ethdev.c\n+++ b/drivers/net/mlx5/mlx5_ethdev.c\n@@ -601,7 +601,7 @@ struct ethtool_link_settings {\n \t\t\tinfo->switch_info.port_id |=\n \t\t\t\tpriv->pf_bond << MLX5_PORT_ID_BONDING_PF_SHIFT;\n \t\t}\n-\t\tMLX5_ETH_FOREACH_DEV(port_id) {\n+\t\tMLX5_ETH_FOREACH_DEV(port_id, priv->pci_dev) {\n \t\t\tstruct mlx5_priv *opriv =\n \t\t\t\trte_eth_devices[port_id].data->dev_private;\n \n@@ -734,7 +734,7 @@ int mlx5_fw_version_get(struct rte_eth_dev *dev, char *fw_ver, size_t fw_size)\n \tpriv = dev->data->dev_private;\n \tdomain_id = priv->domain_id;\n \tassert(priv->representor);\n-\tMLX5_ETH_FOREACH_DEV(port_id) {\n+\tMLX5_ETH_FOREACH_DEV(port_id, priv->pci_dev) {\n \t\tstruct mlx5_priv *opriv =\n \t\t\trte_eth_devices[port_id].data->dev_private;\n \t\tif (opriv &&\n",
    "prefixes": []
}