get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 14254,
    "url": "http://patchwork.dpdk.org/api/patches/14254/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1466666557-14312-19-git-send-email-beilei.xing@intel.com/",
    "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": "<1466666557-14312-19-git-send-email-beilei.xing@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1466666557-14312-19-git-send-email-beilei.xing@intel.com",
    "date": "2016-06-23T07:22:26",
    "name": "[dpdk-dev,v4,18/29] ixgbe/base: fix possible race issue",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "0086bcb5cfc9e09c0bf4cce8587f11a49975ee08",
    "submitter": {
        "id": 410,
        "url": "http://patchwork.dpdk.org/api/people/410/?format=api",
        "name": "Xing, Beilei",
        "email": "beilei.xing@intel.com"
    },
    "delegate": {
        "id": 10,
        "url": "http://patchwork.dpdk.org/api/users/10/?format=api",
        "username": "bruce",
        "first_name": "Bruce",
        "last_name": "Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1466666557-14312-19-git-send-email-beilei.xing@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.dpdk.org/api/patches/14254/comments/",
    "check": "pending",
    "checks": "http://patchwork.dpdk.org/api/patches/14254/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 547AFC508;\n\tThu, 23 Jun 2016 09:23:34 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 1680AC446\n\tfor <dev@dpdk.org>; Thu, 23 Jun 2016 09:23:24 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga102.fm.intel.com with ESMTP; 23 Jun 2016 00:23:24 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby fmsmga001.fm.intel.com with ESMTP; 23 Jun 2016 00:23:24 -0700",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id u5N7NMbQ014509;\n\tThu, 23 Jun 2016 15:23:22 +0800",
            "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid u5N7NIYV014473; Thu, 23 Jun 2016 15:23:20 +0800",
            "(from beileixi@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id u5N7NIxM014469; \n\tThu, 23 Jun 2016 15:23:18 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.26,515,1459839600\"; d=\"scan'208\";a=\"993455742\"",
        "From": "Beilei Xing <beilei.xing@intel.com>",
        "To": "wenzhuo.lu@intel.com",
        "Cc": "dev@dpdk.org, Beilei Xing <beilei.xing@intel.com>",
        "Date": "Thu, 23 Jun 2016 15:22:26 +0800",
        "Message-Id": "<1466666557-14312-19-git-send-email-beilei.xing@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1466666557-14312-1-git-send-email-beilei.xing@intel.com>",
        "References": "<1465977220-3970-1-git-send-email-beilei.xing@intel.com>\n\t<1466666557-14312-1-git-send-email-beilei.xing@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v4 18/29] ixgbe/base: fix possible race issue",
        "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": "This patch fixes possible race issue between ports when issuing host\ninterface command by acquiring/releasing the management host interface\nsemaphore in ixgbe_host_interface_command.\n\nFixes: 36f43e8679ae (\"ixgbe/base: refactor manageability block communication\")\n\nSigned-off-by: Beilei Xing <beilei.xing@intel.com>\n---\n drivers/net/ixgbe/base/ixgbe_common.c | 40 ++++++++++++++++++++---------------\n 1 file changed, 23 insertions(+), 17 deletions(-)",
    "diff": "diff --git a/drivers/net/ixgbe/base/ixgbe_common.c b/drivers/net/ixgbe/base/ixgbe_common.c\nindex 0a74714..0a708cf 100644\n--- a/drivers/net/ixgbe/base/ixgbe_common.c\n+++ b/drivers/net/ixgbe/base/ixgbe_common.c\n@@ -4373,8 +4373,9 @@ u8 ixgbe_calculate_checksum(u8 *buffer, u32 length)\n  *   So we will leave this up to the caller to read back the data\n  *   in these cases.\n  *\n- *  Communicates with the manageability block.  On success return IXGBE_SUCCESS\n- *  else return IXGBE_ERR_HOST_INTERFACE_COMMAND.\n+ *  Communicates with the manageability block. On success return IXGBE_SUCCESS\n+ *  else returns semaphore error when encountering an error acquiring\n+ *  semaphore or IXGBE_ERR_HOST_INTERFACE_COMMAND when command fails.\n  **/\n s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,\n \t\t\t\t u32 length, u32 timeout, bool return_data)\n@@ -4383,6 +4384,7 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,\n \tu32 hdr_size = sizeof(struct ixgbe_hic_hdr);\n \tu16 buf_len;\n \tu16 dword_len;\n+\ts32 status;\n \n \tDEBUGFUNC(\"ixgbe_host_interface_command\");\n \n@@ -4390,6 +4392,11 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,\n \t\tDEBUGOUT1(\"Buffer length failure buffersize=%d.\\n\", length);\n \t\treturn IXGBE_ERR_HOST_INTERFACE_COMMAND;\n \t}\n+\t/* Take management host interface semaphore */\n+\tstatus = hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_SW_MNG_SM);\n+\n+\tif (status)\n+\t\treturn status;\n \n \t/* Set bit 9 of FWSTS clearing FW reset indication */\n \tfwsts = IXGBE_READ_REG(hw, IXGBE_FWSTS);\n@@ -4399,13 +4406,15 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,\n \thicr = IXGBE_READ_REG(hw, IXGBE_HICR);\n \tif ((hicr & IXGBE_HICR_EN) == 0) {\n \t\tDEBUGOUT(\"IXGBE_HOST_EN bit disabled.\\n\");\n-\t\treturn IXGBE_ERR_HOST_INTERFACE_COMMAND;\n+\t\tstatus = IXGBE_ERR_HOST_INTERFACE_COMMAND;\n+\t\tgoto rel_out;\n \t}\n \n \t/* Calculate length in DWORDs. We must be DWORD aligned */\n \tif ((length % (sizeof(u32))) != 0) {\n \t\tDEBUGOUT(\"Buffer length failure, not aligned to dword\");\n-\t\treturn IXGBE_ERR_INVALID_ARGUMENT;\n+\t\tstatus = IXGBE_ERR_INVALID_ARGUMENT;\n+\t\tgoto rel_out;\n \t}\n \n \tdword_len = length >> 2;\n@@ -4432,11 +4441,12 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,\n \t    !(IXGBE_READ_REG(hw, IXGBE_HICR) & IXGBE_HICR_SV)) {\n \t\tERROR_REPORT1(IXGBE_ERROR_CAUTION,\n \t\t\t     \"Command has failed with no status valid.\\n\");\n-\t\treturn IXGBE_ERR_HOST_INTERFACE_COMMAND;\n+\t\tstatus = IXGBE_ERR_HOST_INTERFACE_COMMAND;\n+\t\tgoto rel_out;\n \t}\n \n \tif (!return_data)\n-\t\treturn 0;\n+\t\tgoto rel_out;\n \n \t/* Calculate length in DWORDs */\n \tdword_len = hdr_size >> 2;\n@@ -4450,11 +4460,12 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,\n \t/* If there is any thing in data position pull it in */\n \tbuf_len = ((struct ixgbe_hic_hdr *)buffer)->buf_len;\n \tif (buf_len == 0)\n-\t\treturn 0;\n+\t\tgoto rel_out;\n \n \tif (length < buf_len + hdr_size) {\n \t\tDEBUGOUT(\"Buffer not large enough for reply message.\\n\");\n-\t\treturn IXGBE_ERR_HOST_INTERFACE_COMMAND;\n+\t\tstatus = IXGBE_ERR_HOST_INTERFACE_COMMAND;\n+\t\tgoto rel_out;\n \t}\n \n \t/* Calculate length in DWORDs, add 3 for odd lengths */\n@@ -4466,7 +4477,10 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,\n \t\tIXGBE_LE32_TO_CPUS(&buffer[bi]);\n \t}\n \n-\treturn 0;\n+rel_out:\n+\thw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_SW_MNG_SM);\n+\n+\treturn status;\n }\n \n /**\n@@ -4491,12 +4505,6 @@ s32 ixgbe_set_fw_drv_ver_generic(struct ixgbe_hw *hw, u8 maj, u8 min,\n \n \tDEBUGFUNC(\"ixgbe_set_fw_drv_ver_generic\");\n \n-\tif (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_SW_MNG_SM)\n-\t    != IXGBE_SUCCESS) {\n-\t\tret_val = IXGBE_ERR_SWFW_SYNC;\n-\t\tgoto out;\n-\t}\n-\n \tfw_cmd.hdr.cmd = FW_CEM_CMD_DRIVER_INFO;\n \tfw_cmd.hdr.buf_len = FW_CEM_CMD_DRIVER_INFO_LEN;\n \tfw_cmd.hdr.cmd_or_resp.cmd_resv = FW_CEM_CMD_RESERVED;\n@@ -4528,8 +4536,6 @@ s32 ixgbe_set_fw_drv_ver_generic(struct ixgbe_hw *hw, u8 maj, u8 min,\n \t\tbreak;\n \t}\n \n-\thw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_SW_MNG_SM);\n-out:\n \treturn ret_val;\n }\n \n",
    "prefixes": [
        "dpdk-dev",
        "v4",
        "18/29"
    ]
}