get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 17109,
    "url": "http://patches.dpdk.org/api/patches/17109/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1479740470-6723-9-git-send-email-arybchenko@solarflare.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": "<1479740470-6723-9-git-send-email-arybchenko@solarflare.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1479740470-6723-9-git-send-email-arybchenko@solarflare.com",
    "date": "2016-11-21T15:00:22",
    "name": "[dpdk-dev,08/56] net/sfc: import libefx MCDI proxy authorization support",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "8a8a7866fe22aa7ffa32bd667ef621f99b69c5cd",
    "submitter": {
        "id": 607,
        "url": "http://patches.dpdk.org/api/people/607/?format=api",
        "name": "Andrew Rybchenko",
        "email": "arybchenko@solarflare.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/1479740470-6723-9-git-send-email-arybchenko@solarflare.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/17109/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/17109/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 549CC56A8;\n\tMon, 21 Nov 2016 16:02:28 +0100 (CET)",
            "from nbfkord-smmo02.seg.att.com (nbfkord-smmo02.seg.att.com\n\t[209.65.160.78]) by dpdk.org (Postfix) with ESMTP id 3F45C377A\n\tfor <dev@dpdk.org>; Mon, 21 Nov 2016 16:01:28 +0100 (CET)",
            "from unknown [12.187.104.26]\n\tby nbfkord-smmo02.seg.att.com(mxl_mta-7.2.4-7) with SMTP id\n\t74c03385.0.1541294.00-2389.3424173.nbfkord-smmo02.seg.att.com\n\t(envelope-from <arybchenko@solarflare.com>); \n\tMon, 21 Nov 2016 15:01:28 +0000 (UTC)",
            "from ocex03.SolarFlarecom.com (10.20.40.36) by\n\tocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server\n\t(TLS) id 15.0.1044.25; Mon, 21 Nov 2016 07:01:21 -0800",
            "from opal.uk.solarflarecom.com (10.17.10.1) by\n\tocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server\n\t(TLS) id\n\t15.0.1044.25 via Frontend Transport; Mon, 21 Nov 2016 07:01:20 -0800",
            "from uklogin.uk.solarflarecom.com (uklogin.uk.solarflarecom.com\n\t[10.17.10.10])\n\tby opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id\n\tuALF1JWF007122 for <dev@dpdk.org>; Mon, 21 Nov 2016 15:01:19 GMT",
            "from uklogin.uk.solarflarecom.com (localhost.localdomain\n\t[127.0.0.1])\n\tby uklogin.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id\n\tuALF1J2x006765 for <dev@dpdk.org>; Mon, 21 Nov 2016 15:01:19 GMT"
        ],
        "X-MXL-Hash": "58330c4866fba7d4-f6aace7eabe85c884eae2e92da2c43263d9aa835",
        "From": "Andrew Rybchenko <arybchenko@solarflare.com>",
        "To": "<dev@dpdk.org>",
        "Date": "Mon, 21 Nov 2016 15:00:22 +0000",
        "Message-ID": "<1479740470-6723-9-git-send-email-arybchenko@solarflare.com>",
        "X-Mailer": "git-send-email 1.8.2.3",
        "In-Reply-To": "<1479740470-6723-1-git-send-email-arybchenko@solarflare.com>",
        "References": "<1479740470-6723-1-git-send-email-arybchenko@solarflare.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-AnalysisOut": [
            "[v=2.1 cv=UI/baXry c=1 sm=1 tr=0 a=8BlWFWvVlq5taO8ncb8nKg==]",
            "[:17 a=L24OOQBejmoA:10 a=zRKbQ67AAAAA:8 a=inLJhq1JaXTOU6n3J]",
            "[zYA:9 a=VoA77v782GmB_VUc:21 a=9_PVjTHx_sAgySlJ:21 a=PA03WX]",
            "[8tBzeizutn5_OT:22]"
        ],
        "X-Spam": "[F=0.4928362029; CM=0.500; S=0.492(2015072901)]",
        "X-MAIL-FROM": "<arybchenko@solarflare.com>",
        "X-SOURCE-IP": "[12.187.104.26]",
        "Subject": "[dpdk-dev] [PATCH 08/56] net/sfc: import libefx MCDI proxy\n\tauthorization support",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "MCDI proxy authorization may be used if priviledged PCI\nfunction (physical function) would like to intercept and\nauthorize MCDI requests done by unprivileged (e.g. virtual)\nPCI function. It may be used to control unpriviledged\nfunction Rx mode (e.g. promicsuous, all-multicast), MTU\nand default MAC address change requests etc.\n\nCurrent libefx support is limited to client-side which\nis required to work when function requests need to be\nauthorized.\n\nServer side support required to request and do the\nauthorization is not implemented yet.\n\nEFSYS_OPT_MCDI_PROXY_AUTH should be enabled to use it.\n\nFrom Solarflare Communications Inc.\n\nSigned-off-by: Andrew Rybchenko <arybchenko@solarflare.com>\n---\n drivers/net/sfc/efx/base/efx.h       |  3 ++\n drivers/net/sfc/efx/base/efx_check.h |  7 ++++\n drivers/net/sfc/efx/base/efx_mcdi.c  | 74 ++++++++++++++++++++++++++++++++++++\n drivers/net/sfc/efx/base/efx_mcdi.h  | 17 +++++++++\n 4 files changed, 101 insertions(+)",
    "diff": "diff --git a/drivers/net/sfc/efx/base/efx.h b/drivers/net/sfc/efx/base/efx.h\nindex 0ca0156..3899580 100644\n--- a/drivers/net/sfc/efx/base/efx.h\n+++ b/drivers/net/sfc/efx/base/efx.h\n@@ -209,6 +209,9 @@ typedef struct efx_mcdi_transport_s {\n \tvoid\t\t(*emt_logger)(void *, efx_log_msg_t,\n \t\t\t\t\tvoid *, size_t, void *, size_t);\n #endif /* EFSYS_OPT_MCDI_LOGGING */\n+#if EFSYS_OPT_MCDI_PROXY_AUTH\n+\tvoid\t\t(*emt_ev_proxy_response)(void *, uint32_t, efx_rc_t);\n+#endif /* EFSYS_OPT_MCDI_PROXY_AUTH */\n } efx_mcdi_transport_t;\n \n extern\t__checkReturn\tefx_rc_t\ndiff --git a/drivers/net/sfc/efx/base/efx_check.h b/drivers/net/sfc/efx/base/efx_check.h\nindex 228b42c..470f73c 100644\n--- a/drivers/net/sfc/efx/base/efx_check.h\n+++ b/drivers/net/sfc/efx/base/efx_check.h\n@@ -84,6 +84,13 @@\n # endif\n #endif /* EFSYS_OPT_MCDI_LOGGING */\n \n+#if EFSYS_OPT_MCDI_PROXY_AUTH\n+/* Support MCDI proxy authorization */\n+# if !EFSYS_OPT_MCDI\n+#  error \"MCDI_PROXY_AUTH requires MCDI\"\n+# endif\n+#endif /* EFSYS_OPT_MCDI_PROXY_AUTH */\n+\n #ifdef EFSYS_OPT_MON_LM87\n # error \"MON_LM87 is obsolete and is not supported.\"\n #endif\ndiff --git a/drivers/net/sfc/efx/base/efx_mcdi.c b/drivers/net/sfc/efx/base/efx_mcdi.c\nindex 59a16fc..7b82096 100644\n--- a/drivers/net/sfc/efx/base/efx_mcdi.c\n+++ b/drivers/net/sfc/efx/base/efx_mcdi.c\n@@ -352,6 +352,21 @@ efx_mcdi_read_response_header(\n \t\temrp->emr_err_code = err_code;\n \t\temrp->emr_err_arg = err_arg;\n \n+#if EFSYS_OPT_MCDI_PROXY_AUTH\n+\t\tif ((err_code == MC_CMD_ERR_PROXY_PENDING) &&\n+\t\t    (err_len == sizeof (err))) {\n+\t\t\t/*\n+\t\t\t * The MCDI request would normally fail with EPERM, but\n+\t\t\t * firmware has forwarded it to an authorization agent\n+\t\t\t * attached to a privileged PF.\n+\t\t\t *\n+\t\t\t * Save the authorization request handle. The client\n+\t\t\t * must wait for a PROXY_RESPONSE event, or timeout.\n+\t\t\t */\n+\t\t\temrp->emr_proxy_handle = err_arg;\n+\t\t}\n+#endif /* EFSYS_OPT_MCDI_PROXY_AUTH */\n+\n #if EFSYS_OPT_MCDI_LOGGING\n \t\tif (emtp->emt_logger != NULL) {\n \t\t\temtp->emt_logger(emtp->emt_context,\n@@ -372,6 +387,9 @@ efx_mcdi_read_response_header(\n \n \temrp->emr_rc = 0;\n \temrp->emr_out_length_used = data_len;\n+#if EFSYS_OPT_MCDI_PROXY_AUTH\n+\temrp->emr_proxy_handle = 0;\n+#endif /* EFSYS_OPT_MCDI_PROXY_AUTH */\n \treturn;\n \n fail3:\n@@ -732,6 +750,62 @@ efx_mcdi_ev_cpl(\n \temtp->emt_ev_cpl(emtp->emt_context);\n }\n \n+#if EFSYS_OPT_MCDI_PROXY_AUTH\n+\n+\t__checkReturn\tefx_rc_t\n+efx_mcdi_get_proxy_handle(\n+\t__in\t\tefx_nic_t *enp,\n+\t__in\t\tefx_mcdi_req_t *emrp,\n+\t__out\t\tuint32_t *handlep)\n+{\n+\tefx_rc_t rc;\n+\n+\t/*\n+\t * Return proxy handle from MCDI request that returned with error\n+\t * MC_MCD_ERR_PROXY_PENDING. This handle is used to wait for a matching\n+\t * PROXY_RESPONSE event.\n+\t */\n+\tif ((emrp == NULL) || (handlep == NULL)) {\n+\t\trc = EINVAL;\n+\t\tgoto fail1;\n+\t}\n+\tif ((emrp->emr_rc != 0) &&\n+\t    (emrp->emr_err_code == MC_CMD_ERR_PROXY_PENDING)) {\n+\t\t*handlep = emrp->emr_proxy_handle;\n+\t\trc = 0;\n+\t} else {\n+\t\t*handlep = 0;\n+\t\trc = ENOENT;\n+\t}\n+\treturn (rc);\n+\n+fail1:\n+\tEFSYS_PROBE1(fail1, efx_rc_t, rc);\n+\treturn (rc);\n+}\n+\n+\t\t\tvoid\n+efx_mcdi_ev_proxy_response(\n+\t__in\t\tefx_nic_t *enp,\n+\t__in\t\tunsigned int handle,\n+\t__in\t\tunsigned int status)\n+{\n+\tconst efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp;\n+\tefx_rc_t rc;\n+\n+\t/*\n+\t * Handle results of an authorization request for a privileged MCDI\n+\t * command. If authorization was granted then we must re-issue the\n+\t * original MCDI request. If authorization failed or timed out,\n+\t * then the original MCDI request should be completed with the\n+\t * result code from this event.\n+\t */\n+\trc = (status == 0) ? 0 : efx_mcdi_request_errcode(status);\n+\n+\temtp->emt_ev_proxy_response(emtp->emt_context, handle, rc);\n+}\n+#endif /* EFSYS_OPT_MCDI_PROXY_AUTH */\n+\n \t\t\tvoid\n efx_mcdi_ev_death(\n \t__in\t\tefx_nic_t *enp,\ndiff --git a/drivers/net/sfc/efx/base/efx_mcdi.h b/drivers/net/sfc/efx/base/efx_mcdi.h\nindex a408b5b..a62e921 100644\n--- a/drivers/net/sfc/efx/base/efx_mcdi.h\n+++ b/drivers/net/sfc/efx/base/efx_mcdi.h\n@@ -59,6 +59,9 @@ struct efx_mcdi_req_s {\n \t/* Internals: low level transport details */\n \tunsigned int\temr_err_code;\n \tunsigned int\temr_err_arg;\n+#if EFSYS_OPT_MCDI_PROXY_AUTH\n+\tuint32_t\temr_proxy_handle;\n+#endif\n };\n \n typedef struct efx_mcdi_iface_s {\n@@ -90,6 +93,20 @@ efx_mcdi_ev_cpl(\n \t__in\t\tunsigned int outlen,\n \t__in\t\tint errcode);\n \n+#if EFSYS_OPT_MCDI_PROXY_AUTH\n+extern\t__checkReturn\tefx_rc_t\n+efx_mcdi_get_proxy_handle(\n+\t__in\t\tefx_nic_t *enp,\n+\t__in\t\tefx_mcdi_req_t *emrp,\n+\t__out\t\tuint32_t *handlep);\n+\n+extern\t\t\tvoid\n+efx_mcdi_ev_proxy_response(\n+\t__in\t\tefx_nic_t *enp,\n+\t__in\t\tunsigned int handle,\n+\t__in\t\tunsigned int status);\n+#endif\n+\n extern\t\t\tvoid\n efx_mcdi_ev_death(\n \t__in\t\tefx_nic_t *enp,\n",
    "prefixes": [
        "dpdk-dev",
        "08/56"
    ]
}