get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 101068,
    "url": "https://patches.dpdk.org/api/patches/101068/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20211011144857.446802-30-andrew.rybchenko@oktetlabs.ru/",
    "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": "<20211011144857.446802-30-andrew.rybchenko@oktetlabs.ru>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211011144857.446802-30-andrew.rybchenko@oktetlabs.ru",
    "date": "2021-10-11T14:48:48",
    "name": "[v2,29/38] common/sfc_efx/base: retrieve function interfaces for VNICs",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "b106d4fb54d282420dd1ed9e4cf19a440083efe4",
    "submitter": {
        "id": 2013,
        "url": "https://patches.dpdk.org/api/people/2013/?format=api",
        "name": "Andrew Rybchenko",
        "email": "Andrew.Rybchenko@oktetlabs.ru"
    },
    "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/20211011144857.446802-30-andrew.rybchenko@oktetlabs.ru/mbox/",
    "series": [
        {
            "id": 19526,
            "url": "https://patches.dpdk.org/api/series/19526/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=19526",
            "date": "2021-10-11T14:48:19",
            "name": "net/sfc: support port representors",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/19526/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/101068/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/101068/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 2AA09A034F;\n\tMon, 11 Oct 2021 16:52:33 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 4677D411BE;\n\tMon, 11 Oct 2021 16:50:07 +0200 (CEST)",
            "from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113])\n by mails.dpdk.org (Postfix) with ESMTP id 18796411B0\n for <dev@dpdk.org>; Mon, 11 Oct 2021 16:50:05 +0200 (CEST)",
            "by shelob.oktetlabs.ru (Postfix, from userid 122)\n id DE2827F705; Mon, 11 Oct 2021 17:50:04 +0300 (MSK)",
            "from aros.oktetlabs.ru (aros.oktetlabs.ru [192.168.38.17])\n by shelob.oktetlabs.ru (Postfix) with ESMTP id 0C0EA7F714;\n Mon, 11 Oct 2021 17:49:10 +0300 (MSK)"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on shelob.oktetlabs.ru",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=0.8 required=5.0 tests=ALL_TRUSTED,\n DKIM_ADSP_DISCARD,\n URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2",
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 0C0EA7F714",
        "Authentication-Results": "shelob.oktetlabs.ru/0C0EA7F714; dkim=none;\n dkim-atps=neutral",
        "From": "Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>",
        "To": "dev@dpdk.org",
        "Cc": "Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>,\n Andy Moreton <amoreton@xilinx.com>",
        "Date": "Mon, 11 Oct 2021 17:48:48 +0300",
        "Message-Id": "<20211011144857.446802-30-andrew.rybchenko@oktetlabs.ru>",
        "X-Mailer": "git-send-email 2.30.2",
        "In-Reply-To": "<20211011144857.446802-1-andrew.rybchenko@oktetlabs.ru>",
        "References": "<20210827065717.1838258-1-andrew.rybchenko@oktetlabs.ru>\n <20211011144857.446802-1-andrew.rybchenko@oktetlabs.ru>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v2 29/38] common/sfc_efx/base: retrieve function\n interfaces for VNICs",
        "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": "From: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>\n\nThis information is required to be able to fully identify the function.\nAdd this information to the NIC configuration structure for easy access.\n\nSigned-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>\nSigned-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>\nReviewed-by: Andy Moreton <amoreton@xilinx.com>\n---\n drivers/common/sfc_efx/base/ef10_impl.h |  3 +-\n drivers/common/sfc_efx/base/ef10_nic.c  |  4 +-\n drivers/common/sfc_efx/base/efx.h       |  1 +\n drivers/common/sfc_efx/base/efx_impl.h  |  6 +++\n drivers/common/sfc_efx/base/efx_mcdi.c  | 55 +++++++++++++++++++++++--\n 5 files changed, 64 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/drivers/common/sfc_efx/base/ef10_impl.h b/drivers/common/sfc_efx/base/ef10_impl.h\nindex 7c8d51b7a5..d48f238479 100644\n--- a/drivers/common/sfc_efx/base/ef10_impl.h\n+++ b/drivers/common/sfc_efx/base/ef10_impl.h\n@@ -1372,7 +1372,8 @@ extern\t__checkReturn\t\t\tefx_rc_t\n efx_mcdi_get_function_info(\n \t__in\t\t\t\tefx_nic_t *enp,\n \t__out\t\t\t\tuint32_t *pfp,\n-\t__out_opt\t\t\tuint32_t *vfp);\n+\t__out_opt\t\t\tuint32_t *vfp,\n+\t__out_opt\t\t\tefx_pcie_interface_t *intfp);\n \n LIBEFX_INTERNAL\n extern\t__checkReturn\t\tefx_rc_t\ndiff --git a/drivers/common/sfc_efx/base/ef10_nic.c b/drivers/common/sfc_efx/base/ef10_nic.c\nindex eda0ad3068..3cd9ff89d0 100644\n--- a/drivers/common/sfc_efx/base/ef10_nic.c\n+++ b/drivers/common/sfc_efx/base/ef10_nic.c\n@@ -1847,6 +1847,7 @@ efx_mcdi_nic_board_cfg(\n \tefx_nic_cfg_t *encp = &(enp->en_nic_cfg);\n \tef10_link_state_t els;\n \tefx_port_t *epp = &(enp->en_port);\n+\tefx_pcie_interface_t intf;\n \tuint32_t board_type = 0;\n \tuint32_t base, nvec;\n \tuint32_t port;\n@@ -1875,11 +1876,12 @@ efx_mcdi_nic_board_cfg(\n \t *  - PCIe PF: pf = PF number, vf = 0xffff.\n \t *  - PCIe VF: pf = parent PF, vf = VF number.\n \t */\n-\tif ((rc = efx_mcdi_get_function_info(enp, &pf, &vf)) != 0)\n+\tif ((rc = efx_mcdi_get_function_info(enp, &pf, &vf, &intf)) != 0)\n \t\tgoto fail3;\n \n \tencp->enc_pf = pf;\n \tencp->enc_vf = vf;\n+\tencp->enc_intf = intf;\n \n \tif ((rc = ef10_mcdi_get_pf_count(enp, &encp->enc_hw_pf_count)) != 0)\n \t\tgoto fail4;\ndiff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h\nindex 159e7957a3..996126217e 100644\n--- a/drivers/common/sfc_efx/base/efx.h\n+++ b/drivers/common/sfc_efx/base/efx.h\n@@ -1511,6 +1511,7 @@ typedef struct efx_nic_cfg_s {\n \tuint32_t\t\tenc_bist_mask;\n #endif\t/* EFSYS_OPT_BIST */\n #if EFSYS_OPT_RIVERHEAD || EFX_OPTS_EF10()\n+\tefx_pcie_interface_t\tenc_intf;\n \tuint32_t\t\tenc_pf;\n \tuint32_t\t\tenc_vf;\n \tuint32_t\t\tenc_privilege_mask;\ndiff --git a/drivers/common/sfc_efx/base/efx_impl.h b/drivers/common/sfc_efx/base/efx_impl.h\nindex 992edbabe3..e0efbb8cdd 100644\n--- a/drivers/common/sfc_efx/base/efx_impl.h\n+++ b/drivers/common/sfc_efx/base/efx_impl.h\n@@ -1529,6 +1529,12 @@ efx_mcdi_get_workarounds(\n \n #if EFSYS_OPT_RIVERHEAD || EFX_OPTS_EF10()\n \n+LIBEFX_INTERNAL\n+extern\t__checkReturn\t\tefx_rc_t\n+efx_mcdi_intf_from_pcie(\n+\t__in\t\t\tuint32_t pcie_intf,\n+\t__out\t\t\tefx_pcie_interface_t *efx_intf);\n+\n LIBEFX_INTERNAL\n extern\t__checkReturn\tefx_rc_t\n efx_mcdi_init_evq(\ndiff --git a/drivers/common/sfc_efx/base/efx_mcdi.c b/drivers/common/sfc_efx/base/efx_mcdi.c\nindex b68fc0503d..69bf7ce70f 100644\n--- a/drivers/common/sfc_efx/base/efx_mcdi.c\n+++ b/drivers/common/sfc_efx/base/efx_mcdi.c\n@@ -2130,6 +2130,36 @@ efx_mcdi_mac_stats_periodic(\n \n #if EFSYS_OPT_RIVERHEAD || EFX_OPTS_EF10()\n \n+\t__checkReturn\t\tefx_rc_t\n+efx_mcdi_intf_from_pcie(\n+\t__in\t\t\tuint32_t pcie_intf,\n+\t__out\t\t\tefx_pcie_interface_t *efx_intf)\n+{\n+\tefx_rc_t rc;\n+\n+\tswitch (pcie_intf) {\n+\tcase PCIE_INTERFACE_CALLER:\n+\t\t*efx_intf = EFX_PCIE_INTERFACE_CALLER;\n+\t\tbreak;\n+\tcase PCIE_INTERFACE_HOST_PRIMARY:\n+\t\t*efx_intf = EFX_PCIE_INTERFACE_HOST_PRIMARY;\n+\t\tbreak;\n+\tcase PCIE_INTERFACE_NIC_EMBEDDED:\n+\t\t*efx_intf = EFX_PCIE_INTERFACE_NIC_EMBEDDED;\n+\t\tbreak;\n+\tdefault:\n+\t\trc = EINVAL;\n+\t\tgoto fail1;\n+\t}\n+\n+\treturn (0);\n+\n+fail1:\n+\tEFSYS_PROBE1(fail1, efx_rc_t, rc);\n+\n+\treturn (rc);\n+}\n+\n /*\n  * This function returns the pf and vf number of a function.  If it is a pf the\n  * vf number is 0xffff.  The vf number is the index of the vf on that\n@@ -2140,18 +2170,21 @@ efx_mcdi_mac_stats_periodic(\n efx_mcdi_get_function_info(\n \t__in\t\t\tefx_nic_t *enp,\n \t__out\t\t\tuint32_t *pfp,\n-\t__out_opt\t\tuint32_t *vfp)\n+\t__out_opt\t\tuint32_t *vfp,\n+\t__out_opt\t\tefx_pcie_interface_t *intfp)\n {\n+\tefx_pcie_interface_t intf;\n \tefx_mcdi_req_t req;\n \tEFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_FUNCTION_INFO_IN_LEN,\n-\t\tMC_CMD_GET_FUNCTION_INFO_OUT_LEN);\n+\t\tMC_CMD_GET_FUNCTION_INFO_OUT_V2_LEN);\n+\tuint32_t pcie_intf;\n \tefx_rc_t rc;\n \n \treq.emr_cmd = MC_CMD_GET_FUNCTION_INFO;\n \treq.emr_in_buf = payload;\n \treq.emr_in_length = MC_CMD_GET_FUNCTION_INFO_IN_LEN;\n \treq.emr_out_buf = payload;\n-\treq.emr_out_length = MC_CMD_GET_FUNCTION_INFO_OUT_LEN;\n+\treq.emr_out_length = MC_CMD_GET_FUNCTION_INFO_OUT_V2_LEN;\n \n \tefx_mcdi_execute(enp, &req);\n \n@@ -2169,8 +2202,24 @@ efx_mcdi_get_function_info(\n \tif (vfp != NULL)\n \t\t*vfp = MCDI_OUT_DWORD(req, GET_FUNCTION_INFO_OUT_VF);\n \n+\tif (req.emr_out_length < MC_CMD_GET_FUNCTION_INFO_OUT_V2_LEN) {\n+\t\tintf = EFX_PCIE_INTERFACE_HOST_PRIMARY;\n+\t} else {\n+\t\tpcie_intf = MCDI_OUT_DWORD(req,\n+\t\t    GET_FUNCTION_INFO_OUT_V2_INTF);\n+\n+\t\trc = efx_mcdi_intf_from_pcie(pcie_intf, &intf);\n+\t\tif (rc != 0)\n+\t\t\tgoto fail3;\n+\t}\n+\n+\tif (intfp != NULL)\n+\t\t*intfp = intf;\n+\n \treturn (0);\n \n+fail3:\n+\tEFSYS_PROBE(fail3);\n fail2:\n \tEFSYS_PROBE(fail2);\n fail1:\n",
    "prefixes": [
        "v2",
        "29/38"
    ]
}