get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 12776,
    "url": "https://patches.dpdk.org/api/patches/12776/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1463179589-82681-16-git-send-email-stephen.hurd@broadcom.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": "<1463179589-82681-16-git-send-email-stephen.hurd@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1463179589-82681-16-git-send-email-stephen.hurd@broadcom.com",
    "date": "2016-05-13T22:46:05",
    "name": "[dpdk-dev,v2,16/40] bnxt: add HWRM function reset command",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b1fb71f0c4a1af80c575aab5eed9335a0c0eb6c6",
    "submitter": {
        "id": 438,
        "url": "https://patches.dpdk.org/api/people/438/?format=api",
        "name": "Stephen Hurd",
        "email": "stephen.hurd@broadcom.com"
    },
    "delegate": {
        "id": 10,
        "url": "https://patches.dpdk.org/api/users/10/?format=api",
        "username": "bruce",
        "first_name": "Bruce",
        "last_name": "Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1463179589-82681-16-git-send-email-stephen.hurd@broadcom.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/12776/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/12776/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 6BAFEADF6;\n\tSat, 14 May 2016 00:51:14 +0200 (CEST)",
            "from mail-gw2-out.broadcom.com (mail-gw2-out.broadcom.com\n\t[216.31.210.63]) by dpdk.org (Postfix) with ESMTP id 625D3ADC6\n\tfor <dev@dpdk.org>; Sat, 14 May 2016 00:50:59 +0200 (CEST)",
            "from mail-irv-18.broadcom.com ([10.15.198.37])\n\tby mail-gw2-out.broadcom.com with ESMTP; 13 May 2016 16:06:15 -0700",
            "from mail-irva-12.broadcom.com (mail-irva-12.broadcom.com\n\t[10.11.16.101])\n\tby mail-irv-18.broadcom.com (Postfix) with ESMTP id D669982027\n\tfor <dev@dpdk.org>; Fri, 13 May 2016 15:50:58 -0700 (PDT)",
            "from DPDK-C1.broadcom.com (dhcp-10-13-115-104.irv.broadcom.com\n\t[10.13.115.104])\n\tby mail-irva-12.broadcom.com (Postfix) with ESMTP id BCBCF13D96C\n\tfor <dev@dpdk.org>; Fri, 13 May 2016 15:47:05 -0700 (PDT)"
        ],
        "X-IronPort-AV": "E=Sophos;i=\"5.24,615,1455004800\"; d=\"scan'208\";a=\"95337959\"",
        "From": "Stephen Hurd <stephen.hurd@broadcom.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri, 13 May 2016 15:46:05 -0700",
        "Message-Id": "<1463179589-82681-16-git-send-email-stephen.hurd@broadcom.com>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1463179589-82681-1-git-send-email-stephen.hurd@broadcom.com>",
        "References": "<CAJ9nmBYsstDhTCB4H1V5zGFD7ffTeXd=L+v+pdCjqB5KJ6AEvQ@mail.gmail.com>\n\t<1463179589-82681-1-git-send-email-stephen.hurd@broadcom.com>",
        "Subject": "[dpdk-dev] [PATCH v2 16/40] bnxt: add HWRM function reset command",
        "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": "Add bnxt_hwrm_func_reset() function and supporting structs and macros.\n\nSigned-off-by: Stephen Hurd <stephen.hurd@broadcom.com>\nReviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>\n---\n drivers/net/bnxt/bnxt_hwrm.c           |  17 +++++\n drivers/net/bnxt/bnxt_hwrm.h           |   1 +\n drivers/net/bnxt/hsi_struct_def_dpdk.h | 129 +++++++++++++++++++++++++++++++++\n 3 files changed, 147 insertions(+)",
    "diff": "diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c\nindex 50d8b89..922c92a 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.c\n+++ b/drivers/net/bnxt/bnxt_hwrm.c\n@@ -221,6 +221,23 @@ int bnxt_hwrm_func_qcaps(struct bnxt *bp)\n \treturn rc;\n }\n \n+int bnxt_hwrm_func_reset(struct bnxt *bp)\n+{\n+\tint rc = 0;\n+\tstruct hwrm_func_reset_input req = {.req_type = 0 };\n+\tstruct hwrm_func_reset_output *resp = bp->hwrm_cmd_resp_addr;\n+\n+\tHWRM_PREP(req, FUNC_RESET, -1, resp);\n+\n+\treq.enables = rte_cpu_to_le_32(0);\n+\n+\trc = bnxt_hwrm_send_message(bp, &req, sizeof(req));\n+\n+\tHWRM_CHECK_RESULT;\n+\n+\treturn rc;\n+}\n+\n int bnxt_hwrm_func_driver_register(struct bnxt *bp, uint32_t flags,\n \t\t\t\t   uint32_t *vf_req_fwd)\n {\ndiff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h\nindex 0861417..4fa94aa 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.h\n+++ b/drivers/net/bnxt/bnxt_hwrm.h\n@@ -50,6 +50,7 @@ int bnxt_hwrm_exec_fwd_resp(struct bnxt *bp, void *fwd_cmd);\n int bnxt_hwrm_func_driver_register(struct bnxt *bp, uint32_t flags,\n \t\t\t\t   uint32_t *vf_req_fwd);\n int bnxt_hwrm_func_qcaps(struct bnxt *bp);\n+int bnxt_hwrm_func_reset(struct bnxt *bp);\n int bnxt_hwrm_func_driver_unregister(struct bnxt *bp, uint32_t flags);\n \n int bnxt_hwrm_queue_qportcfg(struct bnxt *bp);\ndiff --git a/drivers/net/bnxt/hsi_struct_def_dpdk.h b/drivers/net/bnxt/hsi_struct_def_dpdk.h\nindex fd9eb62..9c82d13 100644\n--- a/drivers/net/bnxt/hsi_struct_def_dpdk.h\n+++ b/drivers/net/bnxt/hsi_struct_def_dpdk.h\n@@ -83,6 +83,7 @@ typedef struct ctx_hw_stats64 {\n  * Request types\n  */\n #define HWRM_VER_GET\t\t\t(UINT32_C(0x0))\n+#define HWRM_FUNC_RESET\t\t\t(UINT32_C(0x11))\n #define HWRM_FUNC_QCAPS\t\t\t(UINT32_C(0x15))\n #define HWRM_FUNC_DRV_UNRGTR\t\t(UINT32_C(0x1a))\n #define HWRM_FUNC_DRV_RGTR\t\t(UINT32_C(0x1d))\n@@ -2097,6 +2098,134 @@ struct hwrm_func_qcaps_output {\n \tuint8_t valid;\n } __attribute__((packed));\n \n+/* hwrm_func_reset */\n+/*\n+ * Description: This command resets a hardware function (PCIe function) and\n+ * frees any resources used by the function. This command shall be initiated by\n+ * the driver after an FLR has occurred to prepare the function for re-use. This\n+ * command may also be initiated by a driver prior to doing it's own\n+ * configuration. This command puts the function into the reset state. In the\n+ * reset state, global and port related features of the chip are not available.\n+ */\n+/*\n+ * Note: This command will reset a function that has already been disabled or\n+ * idled. The command returns all the resources owned by the function so a new\n+ * driver may allocate and configure resources normally.\n+ */\n+\n+/* Input (24 bytes) */\n+struct hwrm_func_reset_input {\n+\t/*\n+\t * This value indicates what type of request this is. The format for the\n+\t * rest of the command is determined by this field.\n+\t */\n+\tuint16_t req_type;\n+\n+\t/*\n+\t * This value indicates the what completion ring the request will be\n+\t * optionally completed on. If the value is -1, then no CR completion\n+\t * will be generated. Any other value must be a valid CR ring_id value\n+\t * for this function.\n+\t */\n+\tuint16_t cmpl_ring;\n+\n+\t/* This value indicates the command sequence number. */\n+\tuint16_t seq_id;\n+\n+\t/*\n+\t * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids\n+\t * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM\n+\t */\n+\tuint16_t target_id;\n+\n+\t/*\n+\t * This is the host address where the response will be written when the\n+\t * request is complete. This area must be 16B aligned and must be\n+\t * cleared to zero before the request is made.\n+\t */\n+\tuint64_t resp_addr;\n+\n+\t/* This bit must be '1' for the vf_id_valid field to be configured. */\n+\t#define HWRM_FUNC_RESET_INPUT_ENABLES_VF_ID_VALID \\\n+\t\t\t\t\t\t\tUINT32_C(0x1)\n+\tuint32_t enables;\n+\n+\t/*\n+\t * The ID of the VF that this PF is trying to reset. Only the parent PF\n+\t * shall be allowed to reset a child VF. A parent PF driver shall use\n+\t * this field only when a specific child VF is requested to be reset.\n+\t */\n+\tuint16_t vf_id;\n+\n+\t/* This value indicates the level of a function reset. */\n+\t\t/*\n+\t\t * Reset the caller function and its children VFs (if any). If\n+\t\t * no children functions exist, then reset the caller function\n+\t\t * only.\n+\t\t */\n+\t#define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETALL \\\n+\t\t\t\t\t\t\t(UINT32_C(0x0) << 0)\n+\t\t/* Reset the caller function only */\n+\t#define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETME \\\n+\t\t\t\t\t\t\t(UINT32_C(0x1) << 0)\n+\t\t/*\n+\t\t * Reset all children VFs of the caller function driver if the\n+\t\t * caller is a PF driver. It is an error to specify this level\n+\t\t * by a VF driver. It is an error to specify this level by a PF\n+\t\t * driver with no children VFs.\n+\t\t */\n+\t#define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETCHILDREN \\\n+\t\t\t\t\t\t\t(UINT32_C(0x2) << 0)\n+\t\t/*\n+\t\t * Reset a specific VF of the caller function driver if the\n+\t\t * caller is the parent PF driver. It is an error to specify\n+\t\t * this level by a VF driver. It is an error to specify this\n+\t\t * level by a PF driver that is not the parent of the VF that is\n+\t\t * being requested to reset.\n+\t\t */\n+\t#define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF \\\n+\t\t\t\t\t\t\t(UINT32_C(0x3) << 0)\n+\tuint8_t func_reset_level;\n+\n+\tuint8_t unused_0;\n+} __attribute__((packed));\n+\n+/* Output (16 bytes) */\n+struct hwrm_func_reset_output {\n+\t/*\n+\t * Pass/Fail or error type Note: receiver to verify the in parameters,\n+\t * and fail the call with an error when appropriate\n+\t */\n+\tuint16_t error_code;\n+\n+\t/* This field returns the type of original request. */\n+\tuint16_t req_type;\n+\n+\t/* This field provides original sequence number of the command. */\n+\tuint16_t seq_id;\n+\n+\t/*\n+\t * This field is the length of the response in bytes. The last byte of\n+\t * the response is a valid flag that will read as '1' when the command\n+\t * has been completely written to memory.\n+\t */\n+\tuint16_t resp_len;\n+\n+\tuint32_t unused_0;\n+\tuint8_t unused_1;\n+\tuint8_t unused_2;\n+\tuint8_t unused_3;\n+\n+\t/*\n+\t * This field is used in Output records to indicate that the output is\n+\t * completely written to RAM. This field should be read as '1' to\n+\t * indicate that the output has been completely written. When writing a\n+\t * command completion or response to an internal processor, the order of\n+\t * writes has to be such that this field is written last.\n+\t */\n+\tuint8_t valid;\n+} __attribute__((packed));\n+\n /* hwrm_port_phy_cfg */\n /*\n  * Description: This command configures the PHY device for the port. It allows\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "16/40"
    ]
}