get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 633,
    "url": "http://patchwork.dpdk.org/api/patches/633/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1411974986-28137-6-git-send-email-changchun.ouyang@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": "<1411974986-28137-6-git-send-email-changchun.ouyang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1411974986-28137-6-git-send-email-changchun.ouyang@intel.com",
    "date": "2014-09-29T07:16:13",
    "name": "[dpdk-dev,v2,05/18] ixgbe: eeprom checksum calculation return new value in IXGBE base code",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "e02591df73647bb413f5c3b6d89583e7dcdea365",
    "submitter": {
        "id": 31,
        "url": "http://patchwork.dpdk.org/api/people/31/?format=api",
        "name": "Ouyang Changchun",
        "email": "changchun.ouyang@intel.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1411974986-28137-6-git-send-email-changchun.ouyang@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.dpdk.org/api/patches/633/comments/",
    "check": "pending",
    "checks": "http://patchwork.dpdk.org/api/patches/633/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 ADEF97E5F;\n\tMon, 29 Sep 2014 09:10:51 +0200 (CEST)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id EEC1A7E48\n\tfor <dev@dpdk.org>; Mon, 29 Sep 2014 09:10:47 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga103.jf.intel.com with ESMTP; 29 Sep 2014 00:15:10 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga001.jf.intel.com with ESMTP; 29 Sep 2014 00:16:59 -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 s8T7GvXR012671;\n\tMon, 29 Sep 2014 15:16:57 +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 s8T7GtK3028369; Mon, 29 Sep 2014 15:16:57 +0800",
            "(from couyang@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s8T7GtE4028365; \n\tMon, 29 Sep 2014 15:16:55 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.04,618,1406617200\"; d=\"scan'208\";a=\"580488562\"",
        "From": "Ouyang Changchun <changchun.ouyang@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Mon, 29 Sep 2014 15:16:13 +0800",
        "Message-Id": "<1411974986-28137-6-git-send-email-changchun.ouyang@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1411974986-28137-1-git-send-email-changchun.ouyang@intel.com>",
        "References": "<1411974986-28137-1-git-send-email-changchun.ouyang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 05/18] ixgbe: eeprom checksum calculation\n\treturn new value in IXGBE base code",
        "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 refines function to let eeprom checksum calculation return\neither a negative error code on error, or the 16-bit checksum in IXGBE \nbase code.\n\nSigned-off-by: Changchun Ouyang <changchun.ouyang@intel.com>\n---\n lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c |  96 ++++++++++++++----------\n lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.h |   2 +-\n lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h   |   2 +-\n lib/librte_pmd_ixgbe/ixgbe/ixgbe_x540.c   | 118 +++++++++++++++---------------\n lib/librte_pmd_ixgbe/ixgbe/ixgbe_x540.h   |   2 +-\n 5 files changed, 123 insertions(+), 97 deletions(-)",
    "diff": "diff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c\nindex e36b3a8..4bd004c 100644\n--- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c\n+++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c\n@@ -2096,8 +2096,10 @@ STATIC void ixgbe_release_eeprom(struct ixgbe_hw *hw)\n /**\n  *  ixgbe_calc_eeprom_checksum_generic - Calculates and returns the checksum\n  *  @hw: pointer to hardware structure\n+ *\n+ *  Returns a negative error code on error, or the 16-bit checksum\n  **/\n-u16 ixgbe_calc_eeprom_checksum_generic(struct ixgbe_hw *hw)\n+s32 ixgbe_calc_eeprom_checksum_generic(struct ixgbe_hw *hw)\n {\n \tu16 i;\n \tu16 j;\n@@ -2110,33 +2112,44 @@ u16 ixgbe_calc_eeprom_checksum_generic(struct ixgbe_hw *hw)\n \n \t/* Include 0x0-0x3F in the checksum */\n \tfor (i = 0; i < IXGBE_EEPROM_CHECKSUM; i++) {\n-\t\tif (hw->eeprom.ops.read(hw, i, &word) != IXGBE_SUCCESS) {\n+\t\tif (hw->eeprom.ops.read(hw, i, &word)) {\n \t\t\tDEBUGOUT(\"EEPROM read failed\\n\");\n-\t\t\tbreak;\n+\t\t\treturn IXGBE_ERR_EEPROM;\n \t\t}\n \t\tchecksum += word;\n \t}\n \n \t/* Include all data from pointers except for the fw pointer */\n \tfor (i = IXGBE_PCIE_ANALOG_PTR; i < IXGBE_FW_PTR; i++) {\n-\t\thw->eeprom.ops.read(hw, i, &pointer);\n+\t\tif (hw->eeprom.ops.read(hw, i, &pointer)) {\n+\t\t\tDEBUGOUT(\"EEPROM read failed\\n\");\n+\t\t\treturn IXGBE_ERR_EEPROM;\n+\t\t}\n \n-\t\t/* Make sure the pointer seems valid */\n-\t\tif (pointer != 0xFFFF && pointer != 0) {\n-\t\t\thw->eeprom.ops.read(hw, pointer, &length);\n+\t\t/* If the pointer seems invalid */\n+\t\tif (pointer == 0xFFFF || pointer == 0)\n+\t\t\tcontinue;\n+\n+\t\tif (hw->eeprom.ops.read(hw, pointer, &length)) {\n+\t\t\tDEBUGOUT(\"EEPROM read failed\\n\");\n+\t\t\treturn IXGBE_ERR_EEPROM;\n+\t\t}\n \n-\t\t\tif (length != 0xFFFF && length != 0) {\n-\t\t\t\tfor (j = pointer+1; j <= pointer+length; j++) {\n-\t\t\t\t\thw->eeprom.ops.read(hw, j, &word);\n-\t\t\t\t\tchecksum += word;\n-\t\t\t\t}\n+\t\tif (length == 0xFFFF || length == 0)\n+\t\t\tcontinue;\n+\n+\t\tfor (j = pointer + 1; j <= pointer + length; j++) {\n+\t\t\tif (hw->eeprom.ops.read(hw, j, &word)) {\n+\t\t\t\tDEBUGOUT(\"EEPROM read failed\\n\");\n+\t\t\t\treturn IXGBE_ERR_EEPROM;\n \t\t\t}\n+\t\t\tchecksum += word;\n \t\t}\n \t}\n \n \tchecksum = (u16)IXGBE_EEPROM_SUM - checksum;\n \n-\treturn checksum;\n+\treturn (s32)checksum;\n }\n \n /**\n@@ -2156,32 +2169,38 @@ s32 ixgbe_validate_eeprom_checksum_generic(struct ixgbe_hw *hw,\n \n \tDEBUGFUNC(\"ixgbe_validate_eeprom_checksum_generic\");\n \n-\t/*\n-\t * Read the first word from the EEPROM. If this times out or fails, do\n+\t/* Read the first word from the EEPROM. If this times out or fails, do\n \t * not continue or we could be in for a very long wait while every\n \t * EEPROM read fails\n \t */\n \tstatus = hw->eeprom.ops.read(hw, 0, &checksum);\n+\tif (status) {\n+\t\tDEBUGOUT(\"EEPROM read failed\\n\");\n+\t\treturn status;\n+\t}\n \n-\tif (status == IXGBE_SUCCESS) {\n-\t\tchecksum = hw->eeprom.ops.calc_checksum(hw);\n-\n-\t\thw->eeprom.ops.read(hw, IXGBE_EEPROM_CHECKSUM, &read_checksum);\n+\tstatus = hw->eeprom.ops.calc_checksum(hw);\n+\tif (status < 0)\n+\t\treturn status;\n \n-\t\t/*\n-\t\t * Verify read checksum from EEPROM is the same as\n-\t\t * calculated checksum\n-\t\t */\n-\t\tif (read_checksum != checksum)\n-\t\t\tstatus = IXGBE_ERR_EEPROM_CHECKSUM;\n+\tchecksum = (u16)(status & 0xffff);\n \n-\t\t/* If the user cares, return the calculated checksum */\n-\t\tif (checksum_val)\n-\t\t\t*checksum_val = checksum;\n-\t} else {\n+\tstatus = hw->eeprom.ops.read(hw, IXGBE_EEPROM_CHECKSUM, &read_checksum);\n+\tif (status) {\n \t\tDEBUGOUT(\"EEPROM read failed\\n\");\n+\t\treturn status;\n \t}\n \n+\t/* Verify read checksum from EEPROM is the same as\n+\t * calculated checksum\n+\t */\n+\tif (read_checksum != checksum)\n+\t\tstatus = IXGBE_ERR_EEPROM_CHECKSUM;\n+\n+\t/* If the user cares, return the calculated checksum */\n+\tif (checksum_val)\n+\t\t*checksum_val = checksum;\n+\n \treturn status;\n }\n \n@@ -2196,21 +2215,24 @@ s32 ixgbe_update_eeprom_checksum_generic(struct ixgbe_hw *hw)\n \n \tDEBUGFUNC(\"ixgbe_update_eeprom_checksum_generic\");\n \n-\t/*\n-\t * Read the first word from the EEPROM. If this times out or fails, do\n+\t/* Read the first word from the EEPROM. If this times out or fails, do\n \t * not continue or we could be in for a very long wait while every\n \t * EEPROM read fails\n \t */\n \tstatus = hw->eeprom.ops.read(hw, 0, &checksum);\n-\n-\tif (status == IXGBE_SUCCESS) {\n-\t\tchecksum = hw->eeprom.ops.calc_checksum(hw);\n-\t\tstatus = hw->eeprom.ops.write(hw, IXGBE_EEPROM_CHECKSUM,\n-\t\t\t\t\t      checksum);\n-\t} else {\n+\tif (status) {\n \t\tDEBUGOUT(\"EEPROM read failed\\n\");\n+\t\treturn status;\n \t}\n \n+\tstatus = hw->eeprom.ops.calc_checksum(hw);\n+\tif (status < 0)\n+\t\treturn status;\n+\n+\tchecksum = (u16)(status & 0xffff);\n+\n+\tstatus = hw->eeprom.ops.write(hw, IXGBE_EEPROM_CHECKSUM, checksum);\n+\n \treturn status;\n }\n \ndiff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.h b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.h\nindex 8ee1dba..03e71c0 100644\n--- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.h\n+++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.h\n@@ -88,7 +88,7 @@ s32 ixgbe_read_eeprom_bit_bang_generic(struct ixgbe_hw *hw, u16 offset,\n \t\t\t\t       u16 *data);\n s32 ixgbe_read_eeprom_buffer_bit_bang_generic(struct ixgbe_hw *hw, u16 offset,\n \t\t\t\t\t      u16 words, u16 *data);\n-u16 ixgbe_calc_eeprom_checksum_generic(struct ixgbe_hw *hw);\n+s32 ixgbe_calc_eeprom_checksum_generic(struct ixgbe_hw *hw);\n s32 ixgbe_validate_eeprom_checksum_generic(struct ixgbe_hw *hw,\n \t\t\t\t\t   u16 *checksum_val);\n s32 ixgbe_update_eeprom_checksum_generic(struct ixgbe_hw *hw);\ndiff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h\nindex f4c2534..b266e94 100644\n--- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h\n+++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h\n@@ -3075,7 +3075,7 @@ struct ixgbe_eeprom_operations {\n \ts32 (*write_buffer)(struct ixgbe_hw *, u16, u16, u16 *);\n \ts32 (*validate_checksum)(struct ixgbe_hw *, u16 *);\n \ts32 (*update_checksum)(struct ixgbe_hw *);\n-\tu16 (*calc_checksum)(struct ixgbe_hw *);\n+\ts32 (*calc_checksum)(struct ixgbe_hw *);\n };\n \n struct ixgbe_mac_operations {\ndiff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_x540.c b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_x540.c\nindex acb37c3..9cecd29 100644\n--- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_x540.c\n+++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_x540.c\n@@ -475,8 +475,10 @@ s32 ixgbe_write_eewr_buffer_X540(struct ixgbe_hw *hw,\n  *  be used internally by function which utilize ixgbe_acquire_swfw_sync_X540.\n  *\n  *  @hw: pointer to hardware structure\n+ *\n+ *  Returns a negative error code on error, or the 16-bit checksum\n  **/\n-u16 ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw)\n+s32 ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw)\n {\n \tu16 i, j;\n \tu16 checksum = 0;\n@@ -495,9 +497,9 @@ u16 ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw)\n \n \t/* Include 0x0-0x3F in the checksum */\n \tfor (i = 0; i <= checksum_last_word; i++) {\n-\t\tif (ixgbe_read_eerd_generic(hw, i, &word) != IXGBE_SUCCESS) {\n+\t\tif (ixgbe_read_eerd_generic(hw, i, &word)) {\n \t\t\tDEBUGOUT(\"EEPROM read failed\\n\");\n-\t\t\tbreak;\n+\t\t\treturn IXGBE_ERR_EEPROM;\n \t\t}\n \t\tif (i != IXGBE_EEPROM_CHECKSUM)\n \t\t\tchecksum += word;\n@@ -510,9 +512,9 @@ u16 ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw)\n \t\tif (i == IXGBE_PHY_PTR || i == IXGBE_OPTION_ROM_PTR)\n \t\t\tcontinue;\n \n-\t\tif (ixgbe_read_eerd_generic(hw, i, &pointer) != IXGBE_SUCCESS) {\n+\t\tif (ixgbe_read_eerd_generic(hw, i, &pointer)) {\n \t\t\tDEBUGOUT(\"EEPROM read failed\\n\");\n-\t\t\tbreak;\n+\t\t\treturn IXGBE_ERR_EEPROM;\n \t\t}\n \n \t\t/* Skip pointer section if the pointer is invalid. */\n@@ -520,10 +522,9 @@ u16 ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw)\n \t\t    pointer >= hw->eeprom.word_size)\n \t\t\tcontinue;\n \n-\t\tif (ixgbe_read_eerd_generic(hw, pointer, &length) !=\n-\t\t    IXGBE_SUCCESS) {\n+\t\tif (ixgbe_read_eerd_generic(hw, pointer, &length)) {\n \t\t\tDEBUGOUT(\"EEPROM read failed\\n\");\n-\t\t\tbreak;\n+\t\t\treturn IXGBE_ERR_EEPROM;\n \t\t}\n \n \t\t/* Skip pointer section if length is invalid. */\n@@ -531,11 +532,10 @@ u16 ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw)\n \t\t    (pointer + length) >= hw->eeprom.word_size)\n \t\t\tcontinue;\n \n-\t\tfor (j = pointer+1; j <= pointer+length; j++) {\n-\t\t\tif (ixgbe_read_eerd_generic(hw, j, &word) !=\n-\t\t\t    IXGBE_SUCCESS) {\n+\t\tfor (j = pointer + 1; j <= pointer + length; j++) {\n+\t\t\tif (ixgbe_read_eerd_generic(hw, j, &word)) {\n \t\t\t\tDEBUGOUT(\"EEPROM read failed\\n\");\n-\t\t\t\tbreak;\n+\t\t\t\treturn IXGBE_ERR_EEPROM;\n \t\t\t}\n \t\t\tchecksum += word;\n \t\t}\n@@ -543,7 +543,7 @@ u16 ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw)\n \n \tchecksum = (u16)IXGBE_EEPROM_SUM - checksum;\n \n-\treturn checksum;\n+\treturn (s32)checksum;\n }\n \n /**\n@@ -568,42 +568,44 @@ s32 ixgbe_validate_eeprom_checksum_X540(struct ixgbe_hw *hw,\n \t * EEPROM read fails\n \t */\n \tstatus = hw->eeprom.ops.read(hw, 0, &checksum);\n-\n-\tif (status != IXGBE_SUCCESS) {\n+\tif (status) {\n \t\tDEBUGOUT(\"EEPROM read failed\\n\");\n-\t\tgoto out;\n+\t\treturn status;\n \t}\n \n-\tif (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) ==\n-\t    IXGBE_SUCCESS) {\n-\t\tchecksum = hw->eeprom.ops.calc_checksum(hw);\n+\tif (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM))\n+\t\treturn IXGBE_ERR_SWFW_SYNC;\n \n-\t\t/*\n-\t\t * Do not use hw->eeprom.ops.read because we do not want to take\n-\t\t * the synchronization semaphores twice here.\n-\t\t*/\n-\t\tixgbe_read_eerd_generic(hw, IXGBE_EEPROM_CHECKSUM,\n-\t\t\t\t\t&read_checksum);\n+\tstatus = hw->eeprom.ops.calc_checksum(hw);\n+\tif (status < 0)\n+\t\tgoto out;\n \n-\t\t/*\n-\t\t * Verify read checksum from EEPROM is the same as\n-\t\t * calculated checksum\n-\t\t */\n-\t\tif (read_checksum != checksum) {\n-\t\t\tstatus = IXGBE_ERR_EEPROM_CHECKSUM;\n-\t\t\tERROR_REPORT1(IXGBE_ERROR_INVALID_STATE,\n-\t\t\t\t     \"Invalid EEPROM checksum\");\n-\t\t}\n+\tchecksum = (u16)(status & 0xffff);\n \n-\t\t/* If the user cares, return the calculated checksum */\n-\t\tif (checksum_val)\n-\t\t\t*checksum_val = checksum;\n-\t\thw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM);\n-\t} else {\n-\t\tstatus = IXGBE_ERR_SWFW_SYNC;\n+\t/* Do not use hw->eeprom.ops.read because we do not want to take\n+\t * the synchronization semaphores twice here.\n+\t */\n+\tstatus = ixgbe_read_eerd_generic(hw, IXGBE_EEPROM_CHECKSUM,\n+\t\t\t\t\t &read_checksum);\n+\tif (status)\n+\t\tgoto out;\n+\n+\t/* Verify read checksum from EEPROM is the same as\n+\t * calculated checksum\n+\t */\n+\tif (read_checksum != checksum) {\n+\t\tERROR_REPORT1(IXGBE_ERROR_INVALID_STATE,\n+\t\t\t     \"Invalid EEPROM checksum\");\n+\t\tstatus = IXGBE_ERR_EEPROM_CHECKSUM;\n \t}\n \n+\t/* If the user cares, return the calculated checksum */\n+\tif (checksum_val)\n+\t\t*checksum_val = checksum;\n+\n out:\n+\thw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM);\n+\n \treturn status;\n }\n \n@@ -627,29 +629,31 @@ s32 ixgbe_update_eeprom_checksum_X540(struct ixgbe_hw *hw)\n \t * EEPROM read fails\n \t */\n \tstatus = hw->eeprom.ops.read(hw, 0, &checksum);\n-\n-\tif (status != IXGBE_SUCCESS) {\n+\tif (status) {\n \t\tDEBUGOUT(\"EEPROM read failed\\n\");\n \t\treturn status;\n \t}\n \n-\tif (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) ==\n-\t    IXGBE_SUCCESS) {\n-\t\tchecksum = hw->eeprom.ops.calc_checksum(hw);\n+\tif (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM))\n+\t\treturn IXGBE_ERR_SWFW_SYNC;\n \n-\t\t/*\n-\t\t * Do not use hw->eeprom.ops.write because we do not want to\n-\t\t * take the synchronization semaphores twice here.\n-\t\t */\n-\t\tstatus = ixgbe_write_eewr_generic(hw, IXGBE_EEPROM_CHECKSUM,\n-\t\t\t\t\t\t  checksum);\n+\tstatus = hw->eeprom.ops.calc_checksum(hw);\n+\tif (status < 0)\n+\t\tgoto out;\n \n-\t\tif (status == IXGBE_SUCCESS)\n-\t\t\tstatus = ixgbe_update_flash_X540(hw);\n-\t\thw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM);\n-\t} else {\n-\t\tstatus = IXGBE_ERR_SWFW_SYNC;\n-\t}\n+\tchecksum = (u16)(status & 0xffff);\n+\n+\t/* Do not use hw->eeprom.ops.write because we do not want to\n+\t * take the synchronization semaphores twice here.\n+\t */\n+\tstatus = ixgbe_write_eewr_generic(hw, IXGBE_EEPROM_CHECKSUM, checksum);\n+\tif (status)\n+\t\tgoto out;\n+\n+\tstatus = ixgbe_update_flash_X540(hw);\n+\n+out:\n+\thw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM);\n \n \treturn status;\n }\ndiff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_x540.h b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_x540.h\nindex 4742f41..86158e6 100644\n--- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_x540.h\n+++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_x540.h\n@@ -55,7 +55,7 @@ s32 ixgbe_write_eewr_buffer_X540(struct ixgbe_hw *hw, u16 offset, u16 words,\n \t\t\t\t u16 *data);\n s32 ixgbe_update_eeprom_checksum_X540(struct ixgbe_hw *hw);\n s32 ixgbe_validate_eeprom_checksum_X540(struct ixgbe_hw *hw, u16 *checksum_val);\n-u16 ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw);\n+s32 ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw);\n s32 ixgbe_update_flash_X540(struct ixgbe_hw *hw);\n \n s32 ixgbe_acquire_swfw_sync_X540(struct ixgbe_hw *hw, u16 mask);\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "05/18"
    ]
}