Show a patch.

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

{
    "id": 43385,
    "url": "http://patches.dpdk.org/api/patches/43385/",
    "web_url": "http://patches.dpdk.org/patch/43385/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<20180726011548.97788-4-ajit.khaparde@broadcom.com>",
    "date": "2018-07-26T01:15:46",
    "name": "[3/5] net/bnxt: fix to release lock when alloc fails in NVM write",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "29023857cbf8e68c69663c59d96028ec81a1095d",
    "submitter": {
        "id": 501,
        "url": "http://patches.dpdk.org/api/people/501/",
        "name": "Ajit Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@intel.com"
    },
    "mbox": "http://patches.dpdk.org/patch/43385/mbox/",
    "series": [
        {
            "id": 779,
            "url": "http://patches.dpdk.org/api/series/779/",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=779",
            "date": "2018-07-26T01:15:46",
            "name": "bnxt patchset",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/779/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/43385/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/43385/checks/",
    "tags": {},
    "headers": {
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "To": "dev@dpdk.org",
        "In-Reply-To": "<20180726011548.97788-1-ajit.khaparde@broadcom.com>",
        "Message-Id": "<20180726011548.97788-4-ajit.khaparde@broadcom.com>",
        "X-Mailer": "git-send-email 2.15.2 (Apple Git-101.1)",
        "DKIM-Filter": "OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com D68DB30C02B",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n\ts=dkimrelay; t=1532567753;\n\tbh=CVBiiTSN0OWzvFxrNc9advAcIL8GWzr5mphmRu2myOs=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=hlp7pO8w0nOD7Uf+uZnxd4IJ/cc77upTFD9tsTBITLl/8qfvPDMVgg9Gfr+Ffgwm3\n\tRyzLEe/qShkPwDhNKxYB2RjYFx/u9B4/UrJphGbKsofPjAWrH3jJna5Zzzl1zDbcKN\n\tF6CT8cKpdCfBXjLAc0Ga0jkvH1lDl8YB+jlg7POA=",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-BeenThere": "dev@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id E7F9B324D;\n\tThu, 26 Jul 2018 03:16:03 +0200 (CEST)",
            "from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com\n\t[192.19.229.170]) by dpdk.org (Postfix) with ESMTP id A77D01C01;\n\tThu, 26 Jul 2018 03:15:59 +0200 (CEST)",
            "from nis-sj1-27.broadcom.com (nis-sj1-27.lvn.broadcom.net\n\t[10.75.144.136])\n\tby rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id D68DB30C02B;\n\tWed, 25 Jul 2018 18:15:53 -0700 (PDT)",
            "from C02VPB22HTD6.vpn.broadcom.net (unknown [10.10.118.171])\n\tby nis-sj1-27.broadcom.com (Postfix) with ESMTP id 60254AC0761;\n\tWed, 25 Jul 2018 18:15:53 -0700 (PDT)"
        ],
        "Subject": "[dpdk-dev] [PATCH 3/5] net/bnxt: fix to release lock when alloc\n\tfails in NVM write",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Cc": "stable@dpdk.org",
        "Precedence": "list",
        "From": "Ajit Khaparde <ajit.khaparde@broadcom.com>",
        "References": "<20180726011548.97788-1-ajit.khaparde@broadcom.com>",
        "X-Original-To": "patchwork@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Errors-To": "dev-bounces@dpdk.org",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Delivered-To": "patchwork@dpdk.org",
        "Date": "Wed, 25 Jul 2018 18:15:46 -0700",
        "X-Mailman-Version": "2.1.15"
    },
    "content": "In bnxt_hwrm_flash_nvram, before attempting to allocate a buffer\nwe are grabbing the rte_spinlock. And if the allocation fails we\nare returning before releasing the spinlock. We avoid the situation\nby calling HWRM_PREP which grabs the lock after the buffer is\nallocated successfully.\n\nFixes: 19e6af01bb36 (\"net/bnxt: support get/set EEPROM\")\nCc: stable@dpdk.org\n\nReviewed-by: Randy Schacher <stuart.schacher@broadcom.com>\nSigned-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>\n---\n drivers/net/bnxt/bnxt_hwrm.c | 16 ++++++++--------\n 1 file changed, 8 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c\nindex 3f8e26ca3..5e8970ac3 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.c\n+++ b/drivers/net/bnxt/bnxt_hwrm.c\n@@ -3427,14 +3427,6 @@ int bnxt_hwrm_flash_nvram(struct bnxt *bp, uint16_t dir_type,\n \trte_iova_t dma_handle;\n \tuint8_t *buf;\n \n-\tHWRM_PREP(req, NVM_WRITE);\n-\n-\treq.dir_type = rte_cpu_to_le_16(dir_type);\n-\treq.dir_ordinal = rte_cpu_to_le_16(dir_ordinal);\n-\treq.dir_ext = rte_cpu_to_le_16(dir_ext);\n-\treq.dir_attr = rte_cpu_to_le_16(dir_attr);\n-\treq.dir_data_length = rte_cpu_to_le_32(data_len);\n-\n \tbuf = rte_malloc(\"nvm_write\", data_len, 0);\n \trte_mem_lock_page(buf);\n \tif (!buf)\n@@ -3447,6 +3439,14 @@ int bnxt_hwrm_flash_nvram(struct bnxt *bp, uint16_t dir_type,\n \t\treturn -ENOMEM;\n \t}\n \tmemcpy(buf, data, data_len);\n+\n+\tHWRM_PREP(req, NVM_WRITE);\n+\n+\treq.dir_type = rte_cpu_to_le_16(dir_type);\n+\treq.dir_ordinal = rte_cpu_to_le_16(dir_ordinal);\n+\treq.dir_ext = rte_cpu_to_le_16(dir_ext);\n+\treq.dir_attr = rte_cpu_to_le_16(dir_attr);\n+\treq.dir_data_length = rte_cpu_to_le_32(data_len);\n \treq.host_src_addr = rte_cpu_to_le_64(dma_handle);\n \n \trc = bnxt_hwrm_send_message(bp, &req, sizeof(req));\n",
    "prefixes": [
        "3/5"
    ]
}