get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 17336,
    "url": "http://patches.dpdk.org/api/patches/17336/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1480471345-95458-1-git-send-email-jingjing.wu@intel.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": "<1480471345-95458-1-git-send-email-jingjing.wu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1480471345-95458-1-git-send-email-jingjing.wu@intel.com",
    "date": "2016-11-30T02:02:25",
    "name": "[dpdk-dev,v2] net/i40evf: fix casting between structs",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "9d97b76310087ca25e246750cfa89e1a951486c4",
    "submitter": {
        "id": 47,
        "url": "http://patches.dpdk.org/api/people/47/?format=api",
        "name": "Jingjing Wu",
        "email": "jingjing.wu@intel.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/1480471345-95458-1-git-send-email-jingjing.wu@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/17336/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/17336/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 8A0712FDD;\n\tWed, 30 Nov 2016 03:03:04 +0100 (CET)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id B614F2C4F\n\tfor <dev@dpdk.org>; Wed, 30 Nov 2016 03:03:01 +0100 (CET)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby fmsmga104.fm.intel.com with ESMTP; 29 Nov 2016 18:03:00 -0800",
            "from dpdk2.sh.intel.com ([10.239.128.246])\n\tby orsmga004.jf.intel.com with ESMTP; 29 Nov 2016 18:02:59 -0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.31,719,1473145200\"; d=\"scan'208\";a=\"35689222\"",
        "From": "Jingjing Wu <jingjing.wu@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "jingjing.wu@intel.com,\n\thelin.zhang@intel.com",
        "Date": "Wed, 30 Nov 2016 10:02:25 +0800",
        "Message-Id": "<1480471345-95458-1-git-send-email-jingjing.wu@intel.com>",
        "X-Mailer": "git-send-email 2.4.11",
        "In-Reply-To": "<1480239317-7827-1-git-send-email-jingjing.wu@intel.com>",
        "References": "<1480239317-7827-1-git-send-email-jingjing.wu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2] net/i40evf: fix casting between structs",
        "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": "Casting from structs which lay out data in typed members\nto structs which have flat memory buffers, will cause\nproblems if the alignment of the former isn't as expected.\nThis patch removes the casting between structs.\n\nFixes: ae19955e7c86 (\"i40evf: support reporting PF reset\")\nSigned-off-by: Jingjing Wu <jingjing.wu@intel.com>\n---\nv2 change:\n correct the arguments in log.\n add more comments.\n\n drivers/net/i40e/i40e_ethdev_vf.c | 31 +++++++++++++++++++------------\n 1 file changed, 19 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c\nindex aa306d6..5ec5264 100644\n--- a/drivers/net/i40e/i40e_ethdev_vf.c\n+++ b/drivers/net/i40e/i40e_ethdev_vf.c\n@@ -1336,8 +1336,9 @@ i40evf_handle_aq_msg(struct rte_eth_dev *dev)\n \tstruct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n \tstruct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);\n \tstruct i40e_arq_event_info info;\n-\tstruct i40e_virtchnl_msg *v_msg;\n-\tuint16_t pending, opcode;\n+\tuint16_t pending, aq_opc;\n+\tenum i40e_virtchnl_ops msg_opc;\n+\tenum i40e_status_code msg_ret;\n \tint ret;\n \n \tinfo.buf_len = I40E_AQ_BUF_SZ;\n@@ -1346,7 +1347,6 @@ i40evf_handle_aq_msg(struct rte_eth_dev *dev)\n \t\treturn;\n \t}\n \tinfo.msg_buf = vf->aq_resp;\n-\tv_msg = (struct i40e_virtchnl_msg *)&info.desc;\n \n \tpending = 1;\n \twhile (pending) {\n@@ -1357,32 +1357,39 @@ i40evf_handle_aq_msg(struct rte_eth_dev *dev)\n \t\t\t\t    \"ret: %d\", ret);\n \t\t\tbreak;\n \t\t}\n-\t\topcode = rte_le_to_cpu_16(info.desc.opcode);\n-\n-\t\tswitch (opcode) {\n+\t\taq_opc = rte_le_to_cpu_16(info.desc.opcode);\n+\t\t/* For the message sent from pf to vf, opcode is stored in\n+\t\t * cookie_high of struct i40e_aq_desc, while return error code\n+\t\t * are stored in cookie_low, Which is done by\n+\t\t * i40e_aq_send_msg_to_vf in PF driver.*/\n+\t\tmsg_opc = (enum i40e_virtchnl_ops)rte_le_to_cpu_32(\n+\t\t\t\t\t\t  info.desc.cookie_high);\n+\t\tmsg_ret = (enum i40e_status_code)rte_le_to_cpu_32(\n+\t\t\t\t\t\t  info.desc.cookie_low);\n+\t\tswitch (aq_opc) {\n \t\tcase i40e_aqc_opc_send_msg_to_vf:\n-\t\t\tif (v_msg->v_opcode == I40E_VIRTCHNL_OP_EVENT)\n+\t\t\tif (msg_opc == I40E_VIRTCHNL_OP_EVENT)\n \t\t\t\t/* process event*/\n \t\t\t\ti40evf_handle_pf_event(dev, info.msg_buf,\n \t\t\t\t\t\t       info.msg_len);\n \t\t\telse {\n \t\t\t\t/* read message and it's expected one */\n-\t\t\t\tif (v_msg->v_opcode == vf->pend_cmd) {\n-\t\t\t\t\tvf->cmd_retval = v_msg->v_retval;\n+\t\t\t\tif (msg_opc == vf->pend_cmd) {\n+\t\t\t\t\tvf->cmd_retval = msg_ret;\n \t\t\t\t\t/* prevent compiler reordering */\n \t\t\t\t\trte_compiler_barrier();\n \t\t\t\t\t_clear_cmd(vf);\n \t\t\t\t} else\n \t\t\t\t\tPMD_DRV_LOG(ERR, \"command mismatch,\"\n \t\t\t\t\t\t\"expect %u, get %u\",\n-\t\t\t\t\t\tvf->pend_cmd, v_msg->v_opcode);\n+\t\t\t\t\t\tvf->pend_cmd, msg_opc);\n \t\t\t\tPMD_DRV_LOG(DEBUG, \"adminq response is received,\"\n-\t\t\t\t\t     \" opcode = %d\\n\", v_msg->v_opcode);\n+\t\t\t\t\t     \" opcode = %d\\n\", msg_opc);\n \t\t\t}\n \t\t\tbreak;\n \t\tdefault:\n \t\t\tPMD_DRV_LOG(ERR, \"Request %u is not supported yet\",\n-\t\t\t\t    opcode);\n+\t\t\t\t    aq_opc);\n \t\t\tbreak;\n \t\t}\n \t}\n",
    "prefixes": [
        "dpdk-dev",
        "v2"
    ]
}