get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 87915,
    "url": "https://patches.dpdk.org/api/patches/87915/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1613272907-22563-8-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": "<1613272907-22563-8-git-send-email-xuemingl@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1613272907-22563-8-git-send-email-xuemingl@nvidia.com",
    "date": "2021-02-14T03:21:37",
    "name": "[v6,7/9] ethdev: new API to get representor info",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "b8fb2548aa9e48d17613ffe30167a9584536d9a8",
    "submitter": {
        "id": 1904,
        "url": "https://patches.dpdk.org/api/people/1904/?format=api",
        "name": "Xueming Li",
        "email": "xuemingl@nvidia.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1613272907-22563-8-git-send-email-xuemingl@nvidia.com/mbox/",
    "series": [
        {
            "id": 15258,
            "url": "https://patches.dpdk.org/api/series/15258/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=15258",
            "date": "2021-02-14T03:21:30",
            "name": "ethdev: support SubFunction representor",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/15258/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/87915/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/87915/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 7D1B5A0546;\n\tSun, 14 Feb 2021 04:24:06 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C0BAA22A24F;\n\tSun, 14 Feb 2021 04:23:49 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by mails.dpdk.org (Postfix) with ESMTP id AD017227EA5\n for <dev@dpdk.org>; Sun, 14 Feb 2021 04:23:47 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n xuemingl@nvidia.com) with SMTP; 14 Feb 2021 05:23:44 +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 11E3MYvT008525;\n Sun, 14 Feb 2021 05:23:43 +0200"
        ],
        "From": "Xueming Li <xuemingl@nvidia.com>",
        "To": "",
        "Cc": "dev@dpdk.org, Viacheslav Ovsiienko <viacheslavo@nvidia.com>,\n xuemingl@nvidia.com, Asaf Penso <asafp@nvidia.com>,\n Thomas Monjalon <thomas@monjalon.net>,\n Ferruh Yigit <ferruh.yigit@intel.com>,\n Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,\n Ray Kinsella <mdr@ashroe.eu>, Neil Horman <nhorman@tuxdriver.com>",
        "Date": "Sun, 14 Feb 2021 03:21:37 +0000",
        "Message-Id": "<1613272907-22563-8-git-send-email-xuemingl@nvidia.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": [
            "<1613272907-22563-1-git-send-email-xuemingl@nvidia.com>",
            "<1608303356-13089-2-git-send-email-xuemingl@nvidia.com>"
        ],
        "References": [
            "<1613272907-22563-1-git-send-email-xuemingl@nvidia.com>",
            "<1608303356-13089-2-git-send-email-xuemingl@nvidia.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v6 7/9] 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 convert representor from devargs to representor ID.\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>\n---\n lib/librte_ethdev/ethdev_driver.h |  6 +++++\n lib/librte_ethdev/rte_ethdev.c    | 14 ++++++++++\n lib/librte_ethdev/rte_ethdev.h    | 43 +++++++++++++++++++++++++++++++\n lib/librte_ethdev/version.map     |  3 +++\n 4 files changed, 66 insertions(+)",
    "diff": "diff --git a/lib/librte_ethdev/ethdev_driver.h b/lib/librte_ethdev/ethdev_driver.h\nindex 06ff35266f..abcbc3112d 100644\n--- a/lib/librte_ethdev/ethdev_driver.h\n+++ b/lib/librte_ethdev/ethdev_driver.h\n@@ -289,6 +289,10 @@ typedef int (*eth_fw_version_get_t)(struct rte_eth_dev *dev,\n \t\t\t\t     char *fw_version, size_t fw_size);\n /**< @internal Get firmware information of an Ethernet device. */\n \n+typedef int (*eth_representor_info_get_t)(struct rte_eth_dev *dev,\n+\tstruct rte_eth_representor_info *info);\n+/**< @internal Get representor type and ID range. */\n+\n typedef int (*eth_tx_done_cleanup_t)(void *txq, uint32_t free_cnt);\n /**< @internal Force mbufs to be from TX ring. */\n \n@@ -823,6 +827,8 @@ struct eth_dev_ops {\n \teth_burst_mode_get_t       rx_burst_mode_get; /**< Get RX burst mode */\n \teth_burst_mode_get_t       tx_burst_mode_get; /**< Get TX burst mode */\n \teth_fw_version_get_t       fw_version_get; /**< Get firmware version. */\n+\teth_representor_info_get_t representor_info_get;\n+\t/**< Get representor info. */\n \teth_dev_supported_ptypes_get_t dev_supported_ptypes_get;\n \t/**< Get packet types supported and identified by device. */\n \teth_dev_ptypes_set_t dev_ptypes_set;\ndiff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex fe9466a03e..07c6debb58 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -3265,6 +3265,20 @@ rte_eth_dev_fw_version_get(uint16_t port_id, char *fw_version, size_t fw_size)\n \t\t\t\t\t\t\tfw_version, fw_size));\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->fw_version_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 int\n rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)\n {\ndiff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h\nindex 9cd519bf59..35eb0a5721 100644\n--- a/lib/librte_ethdev/rte_ethdev.h\n+++ b/lib/librte_ethdev/rte_ethdev.h\n@@ -1581,6 +1581,30 @@ struct rte_eth_dev_info {\n \tvoid *reserved_ptrs[2];   /**< Reserved for future fields */\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 {\n+\t\tenum rte_eth_representor_type type; /**< Representor type */\n+\t\tint controller; /**< Controller ID, -1 to ignore */\n+\t\tint pf; /**< Physical function ID, -1 to ignore */\n+\t\t__extension__\n+\t\tunion {\n+\t\t\tint vf; /**< VF start index */\n+\t\t\tint sf; /**< SF start index */\n+\t\t};\n+\t\tuint16_t id_base; /**< Representor ID start index */\n+\t\tuint16_t id_end;  /**< Representor ID end index */\n+\t\tchar name[RTE_DEV_NAME_MAX_LEN];\t/**< Representor name */\n+\t} ranges[]; /**< Representor ID range by type */\n+};\n+\n /**\n  * Ethernet device RX queue information structure.\n  * Used to retrieve information about configured queue.\n@@ -3038,6 +3062,25 @@ int rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr);\n  */\n int rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info);\n \n+/**\n+ * Retrieve the representor info of the device.\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 /**\n  * Retrieve the firmware version of a device.\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": [
        "v6",
        "7/9"
    ]
}