get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 51730,
    "url": "http://patches.dpdk.org/api/patches/51730/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1553614522-12151-7-git-send-email-viacheslavo@mellanox.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": "<1553614522-12151-7-git-send-email-viacheslavo@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1553614522-12151-7-git-send-email-viacheslavo@mellanox.com",
    "date": "2019-03-26T15:35:15",
    "name": "[v3,06/13] net/mlx5: switch to the names in the shared IB context",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e2c5e69b1396c662926aa35531820cafd75e542e",
    "submitter": {
        "id": 1102,
        "url": "http://patches.dpdk.org/api/people/1102/?format=api",
        "name": "Slava Ovsiienko",
        "email": "viacheslavo@mellanox.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/1553614522-12151-7-git-send-email-viacheslavo@mellanox.com/mbox/",
    "series": [
        {
            "id": 3928,
            "url": "http://patches.dpdk.org/api/series/3928/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=3928",
            "date": "2019-03-26T15:35:11",
            "name": "net/mlx5: add support for multiport IB devices",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/3928/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/51730/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/51730/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 A9BE31B1DD;\n\tTue, 26 Mar 2019 16:36:16 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n\tby dpdk.org (Postfix) with ESMTP id 69EAB1B131\n\tfor <dev@dpdk.org>; Tue, 26 Mar 2019 16:36:05 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n\tviacheslavo@mellanox.com)\n\twith ESMTPS (AES256-SHA encrypted); 26 Mar 2019 17:36:02 +0200",
            "from pegasus12.mtr.labs.mlnx. (pegasus12.mtr.labs.mlnx\n\t[10.210.17.40])\n\tby labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x2QFa1wT019637;\n\tTue, 26 Mar 2019 17:36:02 +0200"
        ],
        "From": "Viacheslav Ovsiienko <viacheslavo@mellanox.com>",
        "To": "dev@dpdk.org",
        "Cc": "shahafs@mellanox.com",
        "Date": "Tue, 26 Mar 2019 15:35:15 +0000",
        "Message-Id": "<1553614522-12151-7-git-send-email-viacheslavo@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1553614522-12151-1-git-send-email-viacheslavo@mellanox.com>",
        "References": "<1553533414-9911-1-git-send-email-viacheslavo@mellanox.com>\n\t<1553614522-12151-1-git-send-email-viacheslavo@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH v3 06/13] net/mlx5: switch to the names in the\n\tshared IB context",
        "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": "The IB device names are moved from device private data\nto the shared context, code involving the names is updated.\nThe IB port index treatment is added where it is relevant.\n\nSigned-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>\nAcked-by: Shahaf Shuler <shahafs@mellanox.com>\n---\n drivers/net/mlx5/mlx5.h        |  2 --\n drivers/net/mlx5/mlx5_ethdev.c | 10 +++++++---\n drivers/net/mlx5/mlx5_stats.c  | 22 +++++++++++++---------\n 3 files changed, 20 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex f612577..e5edcde 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -235,8 +235,6 @@ struct mlx5_priv {\n \tstruct ibv_context *ctx; /* Verbs context. */\n \tstruct ibv_device_attr_ex device_attr; /* Device properties. */\n \tstruct ibv_pd *pd; /* Protection Domain. */\n-\tchar ibdev_name[IBV_SYSFS_NAME_MAX]; /* IB device name. */\n-\tchar ibdev_path[IBV_SYSFS_PATH_MAX]; /* IB device path for secondary */\n \tstruct ether_addr mac[MLX5_MAX_MAC_ADDRESSES]; /* MAC addresses. */\n \tBITFIELD_DECLARE(mac_own, uint64_t, MLX5_MAX_MAC_ADDRESSES);\n \t/* Bit-field of MAC addresses owned by the PMD. */\ndiff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c\nindex 2b83898..0662594 100644\n--- a/drivers/net/mlx5/mlx5_ethdev.c\n+++ b/drivers/net/mlx5/mlx5_ethdev.c\n@@ -138,8 +138,10 @@ struct ethtool_link_settings {\n \tunsigned int dev_port_prev = ~0u;\n \tchar match[IF_NAMESIZE] = \"\";\n \n+\tassert(priv);\n+\tassert(priv->sh);\n \t{\n-\t\tMKSTR(path, \"%s/device/net\", priv->ibdev_path);\n+\t\tMKSTR(path, \"%s/device/net\", priv->sh->ibdev_path);\n \n \t\tdir = opendir(path);\n \t\tif (dir == NULL) {\n@@ -159,7 +161,7 @@ struct ethtool_link_settings {\n \t\t\tcontinue;\n \n \t\tMKSTR(path, \"%s/device/net/%s/%s\",\n-\t\t      priv->ibdev_path, name,\n+\t\t      priv->sh->ibdev_path, name,\n \t\t      (dev_type ? \"dev_id\" : \"dev_port\"));\n \n \t\tfile = fopen(path, \"rb\");\n@@ -222,7 +224,9 @@ struct ethtool_link_settings {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n \tunsigned int ifindex =\n \t\tpriv->nl_socket_rdma >= 0 ?\n-\t\tmlx5_nl_ifindex(priv->nl_socket_rdma, priv->ibdev_name, 1) : 0;\n+\t\tmlx5_nl_ifindex(priv->nl_socket_rdma,\n+\t\t\t\tpriv->sh->ibdev_name,\n+\t\t\t\tpriv->ibv_port) : 0;\n \n \tif (!ifindex) {\n \t\tif (!priv->representor)\ndiff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c\nindex 6906dc8..5af199d 100644\n--- a/drivers/net/mlx5/mlx5_stats.c\n+++ b/drivers/net/mlx5/mlx5_stats.c\n@@ -140,18 +140,22 @@\n mlx5_read_ib_stat(struct mlx5_priv *priv, const char *ctr_name, uint64_t *stat)\n {\n \tFILE *file;\n-\tMKSTR(path, \"%s/ports/1/hw_counters/%s\",\n-\t\t  priv->ibdev_path,\n-\t\t  ctr_name);\n+\tif (priv->sh) {\n+\t\tMKSTR(path, \"%s/ports/%d/hw_counters/%s\",\n+\t\t\t  priv->sh->ibdev_path,\n+\t\t\t  priv->ibv_port,\n+\t\t\t  ctr_name);\n \n-\tfile = fopen(path, \"rb\");\n-\tif (file) {\n-\t\tint n = fscanf(file, \"%\" SCNu64, stat);\n+\t\tfile = fopen(path, \"rb\");\n+\t\tif (file) {\n+\t\t\tint n = fscanf(file, \"%\" SCNu64, stat);\n \n-\t\tfclose(file);\n-\t\tif (n != 1)\n-\t\t\tstat = 0;\n+\t\t\tfclose(file);\n+\t\t\tif (n == 1)\n+\t\t\t\treturn;\n+\t\t}\n \t}\n+\t*stat = 0;\n }\n \n /**\n",
    "prefixes": [
        "v3",
        "06/13"
    ]
}