get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 97444,
    "url": "http://patches.dpdk.org/api/patches/97444/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210827065717.1838258-29-andrew.rybchenko@oktetlabs.ru/",
    "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": "<20210827065717.1838258-29-andrew.rybchenko@oktetlabs.ru>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210827065717.1838258-29-andrew.rybchenko@oktetlabs.ru",
    "date": "2021-08-27T06:57:07",
    "name": "[28/38] common/sfc_efx/base: add multi-host function M-port selector",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "7abd432f1f4d7b2bef3e3dc28992d4361548374c",
    "submitter": {
        "id": 2013,
        "url": "http://patches.dpdk.org/api/people/2013/?format=api",
        "name": "Andrew Rybchenko",
        "email": "Andrew.Rybchenko@oktetlabs.ru"
    },
    "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/20210827065717.1838258-29-andrew.rybchenko@oktetlabs.ru/mbox/",
    "series": [
        {
            "id": 18492,
            "url": "http://patches.dpdk.org/api/series/18492/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=18492",
            "date": "2021-08-27T06:56:39",
            "name": "net/sfc: support port representors",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/18492/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/97444/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/97444/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 4A276A0C43;\n\tFri, 27 Aug 2021 09:00:33 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 20134412CC;\n\tFri, 27 Aug 2021 08:58:56 +0200 (CEST)",
            "from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113])\n by mails.dpdk.org (Postfix) with ESMTP id D4C71412A6\n for <dev@dpdk.org>; Fri, 27 Aug 2021 08:58:53 +0200 (CEST)",
            "by shelob.oktetlabs.ru (Postfix, from userid 122)\n id AA2B37F6E3; Fri, 27 Aug 2021 09:58:53 +0300 (MSK)",
            "from aros.oktetlabs.ru (aros.oktetlabs.ru [192.168.38.17])\n by shelob.oktetlabs.ru (Postfix) with ESMTP id DF4DC7F6EF;\n Fri, 27 Aug 2021 09:57:35 +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 DF4DC7F6EF",
        "Authentication-Results": "shelob.oktetlabs.ru/DF4DC7F6EF; 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": "Fri, 27 Aug 2021 09:57:07 +0300",
        "Message-Id": "<20210827065717.1838258-29-andrew.rybchenko@oktetlabs.ru>",
        "X-Mailer": "git-send-email 2.30.2",
        "In-Reply-To": "<20210827065717.1838258-1-andrew.rybchenko@oktetlabs.ru>",
        "References": "<20210827065717.1838258-1-andrew.rybchenko@oktetlabs.ru>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 28/38] common/sfc_efx/base: add multi-host\n function M-port selector",
        "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\nProvide helper function to compose multi-host aware PCIe\nfunction M-port selector.\n\nThe firmware expects mport selectors to use different sets of values to\nrepresent a PCIe interface in mport selectors and elsewhere. In order to\navoid having the user perform the conversion themselves, it is now done\nautomatically when a selector is constructed.\n\nIn addition, a type has been added to libefx for possible PCIe interfaces.\nThis is done to abstract different representations away from the users.\n\nAllow to support matching traffic coming from an arbitrary PCIe\nend-point of the NIC and redirect traffic to it.\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/efx.h     | 22 +++++++\n drivers/common/sfc_efx/base/efx_mae.c | 86 +++++++++++++++++++++++----\n drivers/common/sfc_efx/version.map    |  1 +\n 3 files changed, 96 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h\nindex 0a178128ba..159e7957a3 100644\n--- a/drivers/common/sfc_efx/base/efx.h\n+++ b/drivers/common/sfc_efx/base/efx.h\n@@ -82,6 +82,13 @@ efx_family(\n \n #if EFSYS_OPT_PCI\n \n+/* PCIe interface numbers for multi-host configurations. */\n+typedef enum efx_pcie_interface_e {\n+\tEFX_PCIE_INTERFACE_CALLER = 1000,\n+\tEFX_PCIE_INTERFACE_HOST_PRIMARY,\n+\tEFX_PCIE_INTERFACE_NIC_EMBEDDED,\n+} efx_pcie_interface_t;\n+\n typedef struct efx_pci_ops_s {\n \t/*\n \t * Function for reading PCIe configuration space.\n@@ -4237,6 +4244,21 @@ efx_mae_mport_by_pcie_function(\n \t__in\t\t\t\tuint32_t vf,\n \t__out\t\t\t\tefx_mport_sel_t *mportp);\n \n+/*\n+ * Get MPORT selector of a multi-host PCIe function.\n+ *\n+ * The resulting MPORT selector is opaque to the caller and can be\n+ * passed as an argument to efx_mae_match_spec_mport_set()\n+ * and efx_mae_action_set_populate_deliver().\n+ */\n+LIBEFX_API\n+extern\t__checkReturn\t\t\tefx_rc_t\n+efx_mae_mport_by_pcie_mh_function(\n+\t__in\t\t\t\tefx_pcie_interface_t intf,\n+\t__in\t\t\t\tuint32_t pf,\n+\t__in\t\t\t\tuint32_t vf,\n+\t__out\t\t\t\tefx_mport_sel_t *mportp);\n+\n /*\n  * Get MPORT selector by an MPORT ID\n  *\ndiff --git a/drivers/common/sfc_efx/base/efx_mae.c b/drivers/common/sfc_efx/base/efx_mae.c\nindex 3f498fe189..37cc48eafc 100644\n--- a/drivers/common/sfc_efx/base/efx_mae.c\n+++ b/drivers/common/sfc_efx/base/efx_mae.c\n@@ -727,35 +727,95 @@ efx_mae_mport_by_pcie_function(\n \tefx_dword_t dword;\n \tefx_rc_t rc;\n \n+\trc = efx_mae_mport_by_pcie_mh_function(EFX_PCIE_INTERFACE_CALLER,\n+\t\t\t\t\t       pf, vf, mportp);\n+\tif (rc != 0)\n+\t\tgoto fail1;\n+\n+\treturn (0);\n+\n+fail1:\n+\tEFSYS_PROBE1(fail1, efx_rc_t, rc);\n+\treturn (rc);\n+}\n+\n+static\t__checkReturn\t\t\tefx_rc_t\n+efx_mae_intf_to_selector(\n+\t__in\t\t\t\tefx_pcie_interface_t intf,\n+\t__out\t\t\t\tuint32_t *selector_intfp)\n+{\n+\tefx_rc_t rc;\n+\n+\tswitch (intf) {\n+\tcase EFX_PCIE_INTERFACE_HOST_PRIMARY:\n+\t\tEFX_STATIC_ASSERT(MAE_MPORT_SELECTOR_HOST_PRIMARY <=\n+\t\t    EFX_MASK32(MAE_MPORT_SELECTOR_FUNC_INTF_ID));\n+\t\t*selector_intfp = MAE_MPORT_SELECTOR_HOST_PRIMARY;\n+\t\tbreak;\n+\tcase EFX_PCIE_INTERFACE_NIC_EMBEDDED:\n+\t\tEFX_STATIC_ASSERT(MAE_MPORT_SELECTOR_NIC_EMBEDDED <=\n+\t\t    EFX_MASK32(MAE_MPORT_SELECTOR_FUNC_INTF_ID));\n+\t\t*selector_intfp = MAE_MPORT_SELECTOR_NIC_EMBEDDED;\n+\t\tbreak;\n+\tcase EFX_PCIE_INTERFACE_CALLER:\n+\t\tEFX_STATIC_ASSERT(MAE_MPORT_SELECTOR_CALLER_INTF <=\n+\t\t    EFX_MASK32(MAE_MPORT_SELECTOR_FUNC_INTF_ID));\n+\t\t*selector_intfp = MAE_MPORT_SELECTOR_CALLER_INTF;\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+\treturn (rc);\n+}\n+\n+\t__checkReturn\t\t\tefx_rc_t\n+efx_mae_mport_by_pcie_mh_function(\n+\t__in\t\t\t\tefx_pcie_interface_t intf,\n+\t__in\t\t\t\tuint32_t pf,\n+\t__in\t\t\t\tuint32_t vf,\n+\t__out\t\t\t\tefx_mport_sel_t *mportp)\n+{\n+\tuint32_t selector_intf;\n+\tefx_dword_t dword;\n+\tefx_rc_t rc;\n+\n \tEFX_STATIC_ASSERT(EFX_PCI_VF_INVALID ==\n \t    MAE_MPORT_SELECTOR_FUNC_VF_ID_NULL);\n \n-\tif (pf > EFX_MASK32(MAE_MPORT_SELECTOR_FUNC_PF_ID)) {\n-\t\trc = EINVAL;\n+\trc = efx_mae_intf_to_selector(intf, &selector_intf);\n+\tif (rc != 0)\n \t\tgoto fail1;\n+\n+\tif (pf > EFX_MASK32(MAE_MPORT_SELECTOR_FUNC_MH_PF_ID)) {\n+\t\trc = EINVAL;\n+\t\tgoto fail2;\n \t}\n \n \tif (vf > EFX_MASK32(MAE_MPORT_SELECTOR_FUNC_VF_ID)) {\n \t\trc = EINVAL;\n-\t\tgoto fail2;\n+\t\tgoto fail3;\n \t}\n \n-\tEFX_POPULATE_DWORD_3(dword,\n-\t    MAE_MPORT_SELECTOR_TYPE, MAE_MPORT_SELECTOR_TYPE_FUNC,\n-\t    MAE_MPORT_SELECTOR_FUNC_PF_ID, pf,\n+\n+\tEFX_POPULATE_DWORD_4(dword,\n+\t    MAE_MPORT_SELECTOR_TYPE, MAE_MPORT_SELECTOR_TYPE_MH_FUNC,\n+\t    MAE_MPORT_SELECTOR_FUNC_INTF_ID, selector_intf,\n+\t    MAE_MPORT_SELECTOR_FUNC_MH_PF_ID, pf,\n \t    MAE_MPORT_SELECTOR_FUNC_VF_ID, vf);\n \n \tmemset(mportp, 0, sizeof (*mportp));\n-\t/*\n-\t * The constructed DWORD is little-endian,\n-\t * but the resulting value is meant to be\n-\t * passed to MCDIs, where it will undergo\n-\t * host-order to little endian conversion.\n-\t */\n-\tmportp->sel = EFX_DWORD_FIELD(dword, EFX_DWORD_0);\n+\tmportp->sel = dword.ed_u32[0];\n \n \treturn (0);\n \n+fail3:\n+\tEFSYS_PROBE(fail3);\n fail2:\n \tEFSYS_PROBE(fail2);\n fail1:\ndiff --git a/drivers/common/sfc_efx/version.map b/drivers/common/sfc_efx/version.map\nindex 3488367f68..225909892b 100644\n--- a/drivers/common/sfc_efx/version.map\n+++ b/drivers/common/sfc_efx/version.map\n@@ -125,6 +125,7 @@ INTERNAL {\n \tefx_mae_match_specs_class_cmp;\n \tefx_mae_match_specs_equal;\n \tefx_mae_mport_by_pcie_function;\n+\tefx_mae_mport_by_pcie_mh_function;\n \tefx_mae_mport_by_phy_port;\n \tefx_mae_mport_by_id;\n \tefx_mae_mport_free;\n",
    "prefixes": [
        "28/38"
    ]
}