get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 85015,
    "url": "http://patchwork.dpdk.org/api/patches/85015/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20201211153421.28382-2-ivan.malov@oktetlabs.ru/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20201211153421.28382-2-ivan.malov@oktetlabs.ru>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201211153421.28382-2-ivan.malov@oktetlabs.ru",
    "date": "2020-12-11T15:34:21",
    "name": "[2/2] common/sfc_efx/base: check for MAE privilege",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "fb16ea22aa74a65cc1b522fd63c4d425a96d8909",
    "submitter": {
        "id": 869,
        "url": "http://patchwork.dpdk.org/api/people/869/?format=api",
        "name": "Ivan Malov",
        "email": "Ivan.Malov@oktetlabs.ru"
    },
    "delegate": {
        "id": 319,
        "url": "http://patchwork.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20201211153421.28382-2-ivan.malov@oktetlabs.ru/mbox/",
    "series": [
        {
            "id": 14259,
            "url": "http://patchwork.dpdk.org/api/series/14259/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=14259",
            "date": "2020-12-11T15:34:20",
            "name": "[1/2] common/sfc_efx/base: update MCDI headers for MAE privilege",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/14259/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/85015/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/85015/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id AA3A3A09E0;\n\tFri, 11 Dec 2020 16:35:17 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 0E73EC96E;\n\tFri, 11 Dec 2020 16:34:57 +0100 (CET)",
            "from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113])\n by dpdk.org (Postfix) with ESMTP id 6B3D5AC9C;\n Fri, 11 Dec 2020 16:34:53 +0100 (CET)",
            "from localhost.localdomain (unknown [5.144.123.72])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 15BD07F541;\n Fri, 11 Dec 2020 18:34:52 +0300 (MSK)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 15BD07F541",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru;\n s=default; t=1607700892;\n bh=655OchNYp6tq0oamsoELebDGDGxQPYvwF0CwTSxkdRs=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References;\n b=t5JqQsq3mP+y8F4TyXn76uvm79qfb7SqA4P+jB7IOZURgr65vmSa6YM4F303KrQBw\n wIycUswEWWZkGJ1XcbB9fuWI2gB+3LwpxzhPB1Vu/CxgdLvWgATuHNsQ1n6D1VJbBO\n fQOTvpnU5HuE9gEWJE5NzA4vyWcfEeI/cRpe/T+s=",
        "From": "Ivan Malov <ivan.malov@oktetlabs.ru>",
        "To": "dev@dpdk.org",
        "Cc": "stable@dpdk.org, Andy Moreton <amoreton@xilinx.com>,\n Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>",
        "Date": "Fri, 11 Dec 2020 18:34:21 +0300",
        "Message-Id": "<20201211153421.28382-2-ivan.malov@oktetlabs.ru>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20201211153421.28382-1-ivan.malov@oktetlabs.ru>",
        "References": "<20201211153421.28382-1-ivan.malov@oktetlabs.ru>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 2/2] common/sfc_efx/base: check for MAE privilege",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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": "VFs can't control MAE, so it's important to override the general\nMAE capability bit by taking MAE privilege into account. Reorder\nthe code slightly to have the privileges queried before datapath\ncapabilities are discovered and add required MAE privilege check.\n\nFixes: eb4e80085fae (\"common/sfc_efx/base: indicate support for MAE\")\nCc: stable@dpdk.org\n\nSigned-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>\nReviewed-by: Andy Moreton <amoreton@xilinx.com>\n---\n drivers/common/sfc_efx/base/ef10_nic.c | 48 ++++++++++++++++----------\n 1 file changed, 29 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/drivers/common/sfc_efx/base/ef10_nic.c b/drivers/common/sfc_efx/base/ef10_nic.c\nindex 68414d9fa..9dccde957 100644\n--- a/drivers/common/sfc_efx/base/ef10_nic.c\n+++ b/drivers/common/sfc_efx/base/ef10_nic.c\n@@ -1423,11 +1423,19 @@ ef10_get_datapath_caps(\n \n #if EFSYS_OPT_MAE\n \t/*\n-\t * Indicate support for MAE.\n-\t * MAE is supported by Riverhead boards starting with R2,\n-\t * and it is required that FW is built with MAE support, too.\n+\t * Check support for EF100 Match Action Engine (MAE).\n+\t * MAE hardware is present on Riverhead boards (from R2),\n+\t * and on Keystone, and requires support in firmware.\n+\t *\n+\t * MAE control operations require MAE control privilege,\n+\t * which is not available for VFs.\n+\t *\n+\t * Privileges can change dynamically at runtime: we assume\n+\t * MAE support requires the privilege is granted initially,\n+\t * and ignore later dynamic changes.\n \t */\n-\tif (CAP_FLAGS3(req, MAE_SUPPORTED))\n+\tif (CAP_FLAGS3(req, MAE_SUPPORTED) &&\n+\t    EFX_MCDI_HAVE_PRIVILEGE(encp->enc_privilege_mask, MAE))\n \t\tencp->enc_mae_supported = B_TRUE;\n \telse\n \t\tencp->enc_mae_supported = B_FALSE;\n@@ -1896,6 +1904,18 @@ efx_mcdi_nic_board_cfg(\n \n \tEFX_MAC_ADDR_COPY(encp->enc_mac_addr, mac_addr);\n \n+\t/*\n+\t * Get the current privilege mask. Note that this may be modified\n+\t * dynamically, so for most cases the value is informational only.\n+\t * If the privilege being discovered can't be granted dynamically,\n+\t * it's fine to rely on the value. In all other cases, DO NOT use\n+\t * the privilege mask to check for sufficient privileges, as that\n+\t * can result in time-of-check/time-of-use bugs.\n+\t */\n+\tif ((rc = ef10_get_privilege_mask(enp, &mask)) != 0)\n+\t\tgoto fail6;\n+\tencp->enc_privilege_mask = mask;\n+\n \t/* Board configuration (legacy) */\n \trc = efx_mcdi_get_board_cfg(enp, &board_type, NULL, NULL);\n \tif (rc != 0) {\n@@ -1903,14 +1923,14 @@ efx_mcdi_nic_board_cfg(\n \t\tif (rc == EACCES)\n \t\t\tboard_type = 0;\n \t\telse\n-\t\t\tgoto fail6;\n+\t\t\tgoto fail7;\n \t}\n \n \tencp->enc_board_type = board_type;\n \n \t/* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */\n \tif ((rc = efx_mcdi_get_phy_cfg(enp)) != 0)\n-\t\tgoto fail7;\n+\t\tgoto fail8;\n \n \t/*\n \t * Firmware with support for *_FEC capability bits does not\n@@ -1929,18 +1949,18 @@ efx_mcdi_nic_board_cfg(\n \n \t/* Obtain the default PHY advertised capabilities */\n \tif ((rc = ef10_phy_get_link(enp, &els)) != 0)\n-\t\tgoto fail8;\n+\t\tgoto fail9;\n \tepp->ep_default_adv_cap_mask = els.epls.epls_adv_cap_mask;\n \tepp->ep_adv_cap_mask = els.epls.epls_adv_cap_mask;\n \n \t/* Check capabilities of running datapath firmware */\n \tif ((rc = ef10_get_datapath_caps(enp)) != 0)\n-\t\tgoto fail9;\n+\t\tgoto fail10;\n \n \t/* Get interrupt vector limits */\n \tif ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) {\n \t\tif (EFX_PCI_FUNCTION_IS_PF(encp))\n-\t\t\tgoto fail10;\n+\t\t\tgoto fail11;\n \n \t\t/* Ignore error (cannot query vector limits from a VF). */\n \t\tbase = 0;\n@@ -1949,16 +1969,6 @@ efx_mcdi_nic_board_cfg(\n \tencp->enc_intr_vec_base = base;\n \tencp->enc_intr_limit = nvec;\n \n-\t/*\n-\t * Get the current privilege mask. Note that this may be modified\n-\t * dynamically, so this value is informational only. DO NOT use\n-\t * the privilege mask to check for sufficient privileges, as that\n-\t * can result in time-of-check/time-of-use bugs.\n-\t */\n-\tif ((rc = ef10_get_privilege_mask(enp, &mask)) != 0)\n-\t\tgoto fail11;\n-\tencp->enc_privilege_mask = mask;\n-\n \treturn (0);\n \n fail11:\n",
    "prefixes": [
        "2/2"
    ]
}