get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 86800,
    "url": "https://patches.dpdk.org/api/patches/86800/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1610969353-31938-2-git-send-email-xuemingl@nvidia.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": "<1610969353-31938-2-git-send-email-xuemingl@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1610969353-31938-2-git-send-email-xuemingl@nvidia.com",
    "date": "2021-01-18T11:29:05",
    "name": "[v3,1/9] common/mlx5: update representor name parsing",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "723d5635e55ea30751b9a0eb321ca52881270846",
    "submitter": {
        "id": 1904,
        "url": "https://patches.dpdk.org/api/people/1904/?format=api",
        "name": "Xueming Li",
        "email": "xuemingl@nvidia.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/1610969353-31938-2-git-send-email-xuemingl@nvidia.com/mbox/",
    "series": [
        {
            "id": 14810,
            "url": "https://patches.dpdk.org/api/series/14810/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=14810",
            "date": "2021-01-18T11:29:04",
            "name": "net/mlx5: support SubFunction representor",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/14810/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/86800/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/86800/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 4A109A0A03;\n\tMon, 18 Jan 2021 12:30:21 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E1DE5140E14;\n\tMon, 18 Jan 2021 12:29:31 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by mails.dpdk.org (Postfix) with ESMTP id 7E902140DE5\n for <dev@dpdk.org>; Mon, 18 Jan 2021 12:29:24 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n xuemingl@nvidia.com) with SMTP; 18 Jan 2021 13:29:15 +0200",
            "from nvidia.com (pegasus05.mtr.labs.mlnx [10.210.16.100])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 10IBTFeb026901;\n Mon, 18 Jan 2021 13:29:15 +0200"
        ],
        "From": "Xueming Li <xuemingl@nvidia.com>",
        "To": "Viacheslav Ovsiienko <viacheslavo@nvidia.com>",
        "Cc": "dev@dpdk.org, Matan Azrad <matan@nvidia.com>,\n Shahaf Shuler <shahafs@nvidia.com>,\n Thomas Monjalon <thomas@monjalon.net>, xuemingl@nvidia.com,\n Asaf Penso <asafp@nvidia.com>",
        "Date": "Mon, 18 Jan 2021 11:29:05 +0000",
        "Message-Id": "<1610969353-31938-2-git-send-email-xuemingl@nvidia.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": [
            "<1610969353-31938-1-git-send-email-xuemingl@nvidia.com>",
            "<1608304614-13908-2-git-send-email-xuemingl@nvidia.com>"
        ],
        "References": [
            "<1610969353-31938-1-git-send-email-xuemingl@nvidia.com>",
            "<1608304614-13908-2-git-send-email-xuemingl@nvidia.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v3 1/9] common/mlx5: update representor name\n parsing",
        "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": "This patch updates representor name parsing for SF.\nIn sysfs, representor name stored under \"phys_port_name\" sysfs key,\nsimilar to VF representor, switch port name of SF representor is\n\"pf<x>sf<y>\".\n\nFor netlink message, net SF type is supported.\n\nExamples:\n\npf0sf1\npf0sf[0-3]\n\nSigned-off-by: Xueming Li <xuemingl@nvidia.com>\nAcked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>\n---\n drivers/common/mlx5/linux/mlx5_common_os.c | 32 +++++++++++++++-------\n drivers/common/mlx5/linux/mlx5_nl.c        |  2 ++\n drivers/common/mlx5/mlx5_common.h          |  2 ++\n drivers/net/mlx5/linux/mlx5_ethdev_os.c    |  3 ++\n 4 files changed, 29 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/drivers/common/mlx5/linux/mlx5_common_os.c b/drivers/common/mlx5/linux/mlx5_common_os.c\nindex 0edd78ea6d..5cf9576921 100644\n--- a/drivers/common/mlx5/linux/mlx5_common_os.c\n+++ b/drivers/common/mlx5/linux/mlx5_common_os.c\n@@ -97,22 +97,34 @@ void\n mlx5_translate_port_name(const char *port_name_in,\n \t\t\t struct mlx5_switch_info *port_info_out)\n {\n-\tchar pf_c1, pf_c2, vf_c1, vf_c2, eol;\n+\tchar ctrl = 0, pf_c1, pf_c2, vf_c1, vf_c2, eol;\n \tchar *end;\n \tint sc_items;\n \n-\t/*\n-\t * Check for port-name as a string of the form pf0vf0\n-\t * (support kernel ver >= 5.0 or OFED ver >= 4.6).\n-\t */\n+\tsc_items = sscanf(port_name_in, \"%c%d\",\n+\t\t\t  &ctrl, &port_info_out->ctrl_num);\n+\tif (sc_items == 2 && ctrl == 'c') {\n+\t\tport_name_in++; /* 'c' */\n+\t\tport_name_in += snprintf(NULL, 0, \"%d\",\n+\t\t\t\t\t  port_info_out->ctrl_num);\n+\t}\n+\t/* Check for port-name as a string of the form pf0vf0 or pf0sf0 */\n \tsc_items = sscanf(port_name_in, \"%c%c%d%c%c%d%c\",\n \t\t\t  &pf_c1, &pf_c2, &port_info_out->pf_num,\n \t\t\t  &vf_c1, &vf_c2, &port_info_out->port_name, &eol);\n-\tif (sc_items == 6 &&\n-\t    pf_c1 == 'p' && pf_c2 == 'f' &&\n-\t    vf_c1 == 'v' && vf_c2 == 'f') {\n-\t\tport_info_out->name_type = MLX5_PHYS_PORT_NAME_TYPE_PFVF;\n-\t\treturn;\n+\tif (sc_items == 6 && pf_c1 == 'p' && pf_c2 == 'f') {\n+\t\tif (vf_c1 == 'v' && vf_c2 == 'f') {\n+\t\t\t/* Kernel ver >= 5.0 or OFED ver >= 4.6 */\n+\t\t\tport_info_out->name_type =\n+\t\t\t\t\tMLX5_PHYS_PORT_NAME_TYPE_PFVF;\n+\t\t\treturn;\n+\t\t}\n+\t\tif (vf_c1 == 's' && vf_c2 == 'f') {\n+\t\t\t/* Kernel ver >= 5.11 or OFED ver >= 5.1 */\n+\t\t\tport_info_out->name_type =\n+\t\t\t\t\tMLX5_PHYS_PORT_NAME_TYPE_PFSF;\n+\t\t\treturn;\n+\t\t}\n \t}\n \t/*\n \t * Check for port-name as a string of the form p0\ndiff --git a/drivers/common/mlx5/linux/mlx5_nl.c b/drivers/common/mlx5/linux/mlx5_nl.c\nindex 40d8620300..3d55cc98b4 100644\n--- a/drivers/common/mlx5/linux/mlx5_nl.c\n+++ b/drivers/common/mlx5/linux/mlx5_nl.c\n@@ -1148,6 +1148,8 @@ mlx5_nl_check_switch_info(bool num_vf_set,\n \tcase MLX5_PHYS_PORT_NAME_TYPE_PFHPF:\n \t\t/* Fallthrough */\n \tcase MLX5_PHYS_PORT_NAME_TYPE_PFVF:\n+\t\t/* Fallthrough */\n+\tcase MLX5_PHYS_PORT_NAME_TYPE_PFSF:\n \t\t/* New representors naming schema. */\n \t\tswitch_info->representor = 1;\n \t\tbreak;\ndiff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h\nindex e35188da4c..a422b74577 100644\n--- a/drivers/common/mlx5/mlx5_common.h\n+++ b/drivers/common/mlx5/mlx5_common.h\n@@ -153,6 +153,7 @@ enum mlx5_nl_phys_port_name_type {\n \tMLX5_PHYS_PORT_NAME_TYPE_UPLINK, /* p0, kernel ver >= 5.0 */\n \tMLX5_PHYS_PORT_NAME_TYPE_PFVF, /* pf0vf0, kernel ver >= 5.0 */\n \tMLX5_PHYS_PORT_NAME_TYPE_PFHPF, /* pf0, kernel ver >= 5.7, HPF rep */\n+\tMLX5_PHYS_PORT_NAME_TYPE_PFSF, /* pf0sf0, kernel ver >= 5.0 */\n \tMLX5_PHYS_PORT_NAME_TYPE_UNKNOWN, /* Unrecognized. */\n };\n \n@@ -161,6 +162,7 @@ struct mlx5_switch_info {\n \tuint32_t master:1; /**< Master device. */\n \tuint32_t representor:1; /**< Representor device. */\n \tenum mlx5_nl_phys_port_name_type name_type; /** < Port name type. */\n+\tint32_t ctrl_num; /**< Controller number (valid for c#pf#vf# format). */\n \tint32_t pf_num; /**< PF number (valid for pfxvfx format only). */\n \tint32_t port_name; /**< Representor port name. */\n \tuint64_t switch_id; /**< Switch identifier. */\ndiff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c\nindex e36a78091c..1b37970c21 100644\n--- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c\n+++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c\n@@ -1013,6 +1013,9 @@ mlx5_sysfs_check_switch_info(bool device_dir,\n \t\t/* New representors naming schema. */\n \t\tswitch_info->representor = 1;\n \t\tbreak;\n+\tdefault:\n+\t\tswitch_info->master = device_dir;\n+\t\tbreak;\n \t}\n }\n \n",
    "prefixes": [
        "v3",
        "1/9"
    ]
}