get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 100775,
    "url": "http://patches.dpdk.org/api/patches/100775/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20211007184350.73858-8-srikanth.k@oneconvergence.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": "<20211007184350.73858-8-srikanth.k@oneconvergence.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211007184350.73858-8-srikanth.k@oneconvergence.com",
    "date": "2021-10-07T18:43:16",
    "name": "[v2,07/41] common/mlx5: retrieve the device index and name",
    "commit_ref": null,
    "pull_url": null,
    "state": "deferred",
    "archived": false,
    "hash": "9d4c7f9d272da2cc190555ce8592c2f251171b36",
    "submitter": {
        "id": 2368,
        "url": "http://patches.dpdk.org/api/people/2368/?format=api",
        "name": "Srikanth Kaka",
        "email": "srikanth.k@oneconvergence.com"
    },
    "delegate": {
        "id": 3268,
        "url": "http://patches.dpdk.org/api/users/3268/?format=api",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@nvidia.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20211007184350.73858-8-srikanth.k@oneconvergence.com/mbox/",
    "series": [
        {
            "id": 19455,
            "url": "http://patches.dpdk.org/api/series/19455/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=19455",
            "date": "2021-10-07T18:43:09",
            "name": "add MLX5 FreeBSD support",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/19455/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/100775/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/100775/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 EF18AA034F;\n\tFri,  8 Oct 2021 12:56:36 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id F188141150;\n\tFri,  8 Oct 2021 12:56:04 +0200 (CEST)",
            "from mail-pj1-f50.google.com (mail-pj1-f50.google.com\n [209.85.216.50]) by mails.dpdk.org (Postfix) with ESMTP id DF67941217\n for <dev@dpdk.org>; Thu,  7 Oct 2021 20:44:32 +0200 (CEST)",
            "by mail-pj1-f50.google.com with SMTP id np13so5569218pjb.4\n for <dev@dpdk.org>; Thu, 07 Oct 2021 11:44:32 -0700 (PDT)",
            "from srikanth-ThinkPad-T450.domain.name ([136.185.113.102])\n by smtp.gmail.com with ESMTPSA id c11sm3311586pji.38.2021.10.07.11.44.29\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 07 Oct 2021 11:44:31 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=oneconvergence.com; s=google;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding;\n bh=5wuHPQFr6ztPw+nIR71q/bSoQDII8Z8VpDwQAzzZFHY=;\n b=jnqIFytbVgpD9X9Eiu0QW0NIUlVw/jFVeWVGMqIaqfafYRZ2GWwD3VKFLD5qUSg+hr\n U7YDyqHai7buIlNu5AwKMf2a/6864BQA8PlR26yMujPB1B8tpWmJW9CKHvRzcDh2BE/T\n bm5p9Dk5rfJl4HxluvuQURvcS632TftOydrew=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version:content-transfer-encoding;\n bh=5wuHPQFr6ztPw+nIR71q/bSoQDII8Z8VpDwQAzzZFHY=;\n b=3sV6LyAEp5ujwKZ/4ACsrqjlMjowx/ouSqSIHpcIE+89KqlH1u1RRSnKuDbXynvmjt\n 73iHQUmaU41eVLCxRc+r18NhjtMYqvs3D/EPS3s03Z/nwDjeIn1PN/7kt3Fvzki/4fbw\n XvCJcc0fpU+nhEOxSo14eDLHxdm8EWpmPdeyb4voJiRkYzONdEBtQOFHBNQK2dFg4ErP\n gpAy6g6v6q5miS4pRysLogOIHpp0W9MGAgA40wbEykINMfaDUeAlNIrFs3Hw0y53CSwX\n q6OIJjoC02pYb710c+N22aWyVNWPXFaDiKPViPnli0iP246FpDIcLpPhoBo712L8CIEU\n 0mQg==",
        "X-Gm-Message-State": "AOAM531Zc008zMy1SFDtPVyMNO7gy91HwGcVczfYgwIPT6DVUXMI3caT\n E/Ygkz8AI6DQ50aftWLy6laVmA==",
        "X-Google-Smtp-Source": "\n ABdhPJzLQQhm3iAEWu/1bvSctJRHGG6SSNmopQ2RJN0lzlYcZSu8G1XlOJSOWP5U1jawmz6UIlvNMw==",
        "X-Received": "by 2002:a17:90a:6401:: with SMTP id\n g1mr7307148pjj.228.1633632272172;\n Thu, 07 Oct 2021 11:44:32 -0700 (PDT)",
        "From": "Srikanth Kaka <srikanth.k@oneconvergence.com>",
        "To": "Matan Azrad <matan@nvidia.com>,\n Viacheslav Ovsiienko <viacheslavo@nvidia.com>",
        "Cc": "dev@dpdk.org, Vag Singh <vag.singh@oneconvergence.com>,\n Anand Thulasiram <avelu@juniper.net>,\n Srikanth Kaka <srikanth.k@oneconvergence.com>",
        "Date": "Fri,  8 Oct 2021 00:13:16 +0530",
        "Message-Id": "<20211007184350.73858-8-srikanth.k@oneconvergence.com>",
        "X-Mailer": "git-send-email 2.30.2",
        "In-Reply-To": "<20211007184350.73858-1-srikanth.k@oneconvergence.com>",
        "References": "<20211007184350.73858-1-srikanth.k@oneconvergence.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Mailman-Approved-At": "Fri, 08 Oct 2021 12:55:54 +0200",
        "Subject": "[dpdk-dev] [PATCH v2 07/41] common/mlx5: retrieve the device index\n and name",
        "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": "The mlx5_core kernel driver creates a sysctl variable\ndev.mlx5_core.0.ifname: mce0\n\nUsing this the device index and interface name are obtained\nThe interface name can be used by PMD to communicate with\nFreeBSD network stack\n\nSigned-off-by: Srikanth Kaka <srikanth.k@oneconvergence.com>\nSigned-off-by: Vag Singh <vag.singh@oneconvergence.com>\nSigned-off-by: Anand Thulasiram <avelu@juniper.net>\n---\n drivers/common/mlx5/freebsd/mlx5_common_os.c | 44 ++++++++++++++++++++\n drivers/common/mlx5/freebsd/mlx5_common_os.h |  6 +++\n 2 files changed, 50 insertions(+)",
    "diff": "diff --git a/drivers/common/mlx5/freebsd/mlx5_common_os.c b/drivers/common/mlx5/freebsd/mlx5_common_os.c\nindex 9c3cd1e4e6..23370857eb 100644\n--- a/drivers/common/mlx5/freebsd/mlx5_common_os.c\n+++ b/drivers/common/mlx5/freebsd/mlx5_common_os.c\n@@ -4,14 +4,58 @@\n \n #include <unistd.h>\n #include <stdio.h>\n+#include <net/if.h>\n #include <sys/sysctl.h>\n \n #include <rte_errno.h>\n \n #include \"mlx5_common.h\"\n #include \"mlx5_common_log.h\"\n+#include \"mlx5_common_os.h\"\n #include \"mlx5_glue.h\"\n \n+/**\n+ * Derive IB dev index from devpath\n+ */\n+int\n+mlx5_get_ibvindex(const char *ibdev_path)\n+{\n+\tunsigned int ibv_idx;\n+\n+\tMLX5_ASSERT(ibdev_path);\n+\tif (sscanf(ibdev_path, \"/sys/class/infiniband/mlx5_%u\",\n+\t\t   &ibv_idx) != 1)\n+\t\tibv_idx = -1;\n+\n+\treturn ibv_idx;\n+}\n+\n+int\n+mlx5_get_ifname_sysfs(const char *ibdev_path, char *ifname)\n+{\n+\tchar buffer[MLX5_SYSCTL_BY_NAME_SIZE];\n+\tchar name[IF_NAMESIZE];\n+\tsize_t len = IF_NAMESIZE;\n+\tunsigned int idx;\n+\n+\tidx = mlx5_get_ibvindex(ibdev_path);\n+\tif (idx < 0) {\n+\t\trte_errno = EINVAL;\n+\t\treturn -rte_errno;\n+\t}\n+\n+\tsnprintf(buffer, sizeof(buffer), \"dev.mlx5_core.%u.ifname\", idx);\n+\tif (sysctlbyname(buffer, &name, &len, NULL, 0)) {\n+\t\tDRV_LOG(ERR, \"port %u failed to get interface name: %s\",\n+\t\t\tidx, strerror(errno));\n+\t\trte_errno = errno;\n+\t\treturn -rte_errno;\n+\t}\n+\tstrncpy(ifname, name, IF_NAMESIZE);\n+\n+\treturn 0;\n+}\n+\n /**\n  * Initialization routine for run-time dependency on rdma-core.\n  */\ndiff --git a/drivers/common/mlx5/freebsd/mlx5_common_os.h b/drivers/common/mlx5/freebsd/mlx5_common_os.h\nindex dab67ecbf0..60e7c4f21f 100644\n--- a/drivers/common/mlx5/freebsd/mlx5_common_os.h\n+++ b/drivers/common/mlx5/freebsd/mlx5_common_os.h\n@@ -18,6 +18,8 @@\n #include \"mlx5_autoconf.h\"\n #include \"mlx5_glue.h\"\n \n+#define MLX5_SYSCTL_BY_NAME_SIZE 100\n+\n /**\n  * Get device name. Given an ibv_device pointer - return a\n  * pointer to the corresponding device name.\n@@ -287,4 +289,8 @@ mlx5_os_free(void *addr)\n {\n \tfree(addr);\n }\n+\n+int\n+mlx5_get_ibvindex(const char *ibdev_path);\n+\n #endif /* RTE_PMD_MLX5_COMMON_OS_H_ */\n",
    "prefixes": [
        "v2",
        "07/41"
    ]
}