get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 88959,
    "url": "http://patches.dpdk.org/api/patches/88959/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1615468416-10115-9-git-send-email-xuemingl@nvidia.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": "<1615468416-10115-9-git-send-email-xuemingl@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1615468416-10115-9-git-send-email-xuemingl@nvidia.com",
    "date": "2021-03-11T13:13:31",
    "name": "[v9,08/10] ethdev: new API to get representor info",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "b291b3b4d1c239f25ae5018b4d6d20d5160ba0cc",
    "submitter": {
        "id": 1904,
        "url": "http://patches.dpdk.org/api/people/1904/?format=api",
        "name": "Xueming Li",
        "email": "xuemingl@nvidia.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1615468416-10115-9-git-send-email-xuemingl@nvidia.com/mbox/",
    "series": [
        {
            "id": 15613,
            "url": "http://patches.dpdk.org/api/series/15613/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=15613",
            "date": "2021-03-11T13:13:23",
            "name": "ethdev: support SubFunction representor",
            "version": 9,
            "mbox": "http://patches.dpdk.org/series/15613/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/88959/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/88959/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 D4085A0575;\n\tThu, 11 Mar 2021 14:14:59 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 9745822A4C7;\n\tThu, 11 Mar 2021 14:14:29 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by mails.dpdk.org (Postfix) with ESMTP id 3259222A4C7\n for <dev@dpdk.org>; Thu, 11 Mar 2021 14:14:28 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n xuemingl@nvidia.com) with SMTP; 11 Mar 2021 15:14:27 +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 12BDDkZA023953;\n Thu, 11 Mar 2021 15:14:27 +0200"
        ],
        "From": "Xueming Li <xuemingl@nvidia.com>",
        "To": "Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,\n Ferruh Yigit <ferruh.yigit@intel.com>",
        "Cc": "dev@dpdk.org, Viacheslav Ovsiienko <viacheslavo@nvidia.com>,\n xuemingl@nvidia.com, Asaf Penso <asafp@nvidia.com>,\n Thomas Monjalon <thomas@monjalon.net>, Ray Kinsella <mdr@ashroe.eu>,\n Neil Horman <nhorman@tuxdriver.com>",
        "Date": "Thu, 11 Mar 2021 13:13:31 +0000",
        "Message-Id": "<1615468416-10115-9-git-send-email-xuemingl@nvidia.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": [
            "<1615468416-10115-1-git-send-email-xuemingl@nvidia.com>",
            "<1608303356-13089-2-git-send-email-xuemingl@nvidia.com>"
        ],
        "References": [
            "<1615468416-10115-1-git-send-email-xuemingl@nvidia.com>",
            "<1608303356-13089-2-git-send-email-xuemingl@nvidia.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v9 08/10] ethdev: new API to get representor info",
        "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 NIC can have multiple PCIe links and can be attached to multiple\nhosts, for example the same single NIC can be shared for multiple server\nunits in the rack. On each PCIe link NIC can provide multiple PFs and\nVFs/SFs based on these ones. The full representor identifier consists of\nthree indices - controller index, PF index, and VF or SF index (if any).\n\nThis patch introduces a new API rte_eth_representor_info_get() to\nretrieve representor corresponding info mapping:\n - caller controller index and pf index.\n - supported representor ID ranges.\n - type, controller, pf and start vf/sf ID of each range.\nThe API is useful to calculate representor from devargs to representor\nID.\n\nNew ethdev callback representor_info_get() is added to retrieve info\nfrom PMD driver, optional for PMD that doesn't support new devargs\nrepresentor syntax.\n\nSigned-off-by: Xueming Li <xuemingl@nvidia.com>\nAcked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>\n---\n lib/librte_ethdev/ethdev_driver.h | 27 ++++++++++++++++\n lib/librte_ethdev/rte_ethdev.c    | 14 ++++++++\n lib/librte_ethdev/rte_ethdev.h    | 54 +++++++++++++++++++++++++++++++\n lib/librte_ethdev/version.map     |  3 ++\n 4 files changed, 98 insertions(+)",
    "diff": "diff --git a/lib/librte_ethdev/ethdev_driver.h b/lib/librte_ethdev/ethdev_driver.h\nindex 06ff35266f..067be38f33 100644\n--- a/lib/librte_ethdev/ethdev_driver.h\n+++ b/lib/librte_ethdev/ethdev_driver.h\n@@ -783,6 +783,30 @@ typedef int (*eth_hairpin_queue_peer_unbind_t)\n typedef int (*eth_get_monitor_addr_t)(void *rxq,\n \t\tstruct rte_power_monitor_cond *pmc);\n \n+/**\n+ * @internal\n+ * Get representor info to be able to calculate the unique representor ID.\n+ *\n+ * Caller should pass NULL as pointer of info to get number of entries,\n+ * allocate info buffer according to returned entry number, then call\n+ * again with buffer to get real info.\n+ *\n+ * To calculate the representor ID, caller should iterate each entry,\n+ * match controller index, pf index, vf or sf start index and range,\n+ * then calculate representor ID from offset to vf/sf start index.\n+ * @see rte_eth_representor_id_get.\n+ *\n+ * @param dev\n+ *   Ethdev handle of port.\n+ * @param [out] info\n+ *   Pointer to memory to save device representor info.\n+ * @return\n+ *   Negative errno value on error, number of info entries otherwise.\n+ */\n+\n+typedef int (*eth_representor_info_get_t)(struct rte_eth_dev *dev,\n+\tstruct rte_eth_representor_info *info);\n+\n /**\n  * @internal A structure containing the functions exported by an Ethernet driver.\n  */\n@@ -940,6 +964,9 @@ struct eth_dev_ops {\n \n \teth_get_monitor_addr_t get_monitor_addr;\n \t/**< Get power monitoring condition for Rx queue. */\n+\n+\teth_representor_info_get_t representor_info_get;\n+\t/**< Get representor info. */\n };\n \n /**\ndiff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex 60889a8663..3d4ec8ad5c 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -5816,6 +5816,20 @@ rte_eth_hairpin_queue_peer_unbind(uint16_t cur_port, uint16_t cur_queue,\n \t\t\t\t\t\t\t  direction);\n }\n \n+int\n+rte_eth_representor_info_get(uint16_t port_id,\n+\t\t\t     struct rte_eth_representor_info *info)\n+{\n+\tstruct rte_eth_dev *dev;\n+\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\tdev = &rte_eth_devices[port_id];\n+\n+\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->representor_info_get, -ENOTSUP);\n+\treturn eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev,\n+\t\t\t\t\t\t\t\t      info));\n+}\n+\n RTE_LOG_REGISTER(rte_eth_dev_logtype, lib.ethdev, INFO);\n \n RTE_INIT(ethdev_init_telemetry)\ndiff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h\nindex 9cd519bf59..efda3137f7 100644\n--- a/lib/librte_ethdev/rte_ethdev.h\n+++ b/lib/librte_ethdev/rte_ethdev.h\n@@ -4791,6 +4791,60 @@ __rte_experimental\n int rte_eth_dev_hairpin_capability_get(uint16_t port_id,\n \t\t\t\t       struct rte_eth_hairpin_cap *cap);\n \n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this structure may change without prior notice.\n+ *\n+ * ethernet device representor ID range entry\n+ */\n+struct rte_eth_representor_range {\n+\tenum rte_eth_representor_type type; /**< Representor type */\n+\tint controller; /**< Controller index */\n+\tint pf; /**< Physical function index */\n+\t__extension__\n+\tunion {\n+\t\tint vf; /**< VF start index */\n+\t\tint sf; /**< SF start index */\n+\t};\n+\tuint32_t id_base; /**< Representor ID start index */\n+\tuint32_t id_end;  /**< Representor ID end index */\n+\tchar name[RTE_DEV_NAME_MAX_LEN]; /**< Representor name */\n+};\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this structure may change without prior notice.\n+ *\n+ * Ethernet device representor information\n+ */\n+struct rte_eth_representor_info {\n+\tuint16_t controller; /**< Controller ID of caller device. */\n+\tuint16_t pf; /**< Physical function ID of caller device. */\n+\tstruct rte_eth_representor_range ranges[];/**< Representor ID range. */\n+};\n+\n+/**\n+ * Retrieve the representor info of the device.\n+ *\n+ * Get device representor info to be able to calculate a unique\n+ * representor ID. @see rte_eth_representor_id_get helper.\n+ *\n+ * @param port_id\n+ *   The port identifier of the device.\n+ * @param info\n+ *   A pointer to a representor info structure.\n+ *   NULL to return number of range entries and allocate memory\n+ *   for next call to store detail.\n+ * @return\n+ *   - (-ENOTSUP) if operation is not supported.\n+ *   - (-ENODEV) if *port_id* invalid.\n+ *   - (-EIO) if device is removed.\n+ *   - (>=0) number of representor range entries supported by device.\n+ */\n+__rte_experimental\n+int rte_eth_representor_info_get(uint16_t port_id,\n+\t\t\t\t struct rte_eth_representor_info *info);\n+\n #include <rte_ethdev_core.h>\n \n /**\ndiff --git a/lib/librte_ethdev/version.map b/lib/librte_ethdev/version.map\nindex a124e1e370..bb6f7436c2 100644\n--- a/lib/librte_ethdev/version.map\n+++ b/lib/librte_ethdev/version.map\n@@ -243,6 +243,9 @@ EXPERIMENTAL {\n \n \t# added in 21.02\n \trte_eth_get_monitor_addr;\n+\n+\t# added in 21.05\n+\trte_eth_representor_info_get;\n };\n \n INTERNAL {\n",
    "prefixes": [
        "v9",
        "08/10"
    ]
}