Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/69978/?format=api
https://patches.dpdk.org/api/patches/69978/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200508071340.75836-1-shougangx.wang@intel.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": "<20200508071340.75836-1-shougangx.wang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200508071340.75836-1-shougangx.wang@intel.com", "date": "2020-05-08T07:13:40", "name": "net/ice: fix incorrect EEPROM data", "commit_ref": null, "pull_url": null, "state": "rejected", "archived": true, "hash": "38ac52bca9de7b9e7360ca0640628f34aca59ff5", "submitter": { "id": 1418, "url": "https://patches.dpdk.org/api/people/1418/?format=api", "name": "Shougang Wang", "email": "shougangx.wang@intel.com" }, "delegate": { "id": 31221, "url": "https://patches.dpdk.org/api/users/31221/?format=api", "username": "yexl", "first_name": "xiaolong", "last_name": "ye", "email": "xiaolong.ye@intel.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200508071340.75836-1-shougangx.wang@intel.com/mbox/", "series": [ { "id": 9937, "url": "https://patches.dpdk.org/api/series/9937/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=9937", "date": "2020-05-08T07:13:40", "name": "net/ice: fix incorrect EEPROM data", "version": 1, "mbox": "https://patches.dpdk.org/series/9937/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/69978/comments/", "check": "warning", "checks": "https://patches.dpdk.org/api/patches/69978/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 7A2EDA00C5;\n\tFri, 8 May 2020 09:14:53 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id F17201DAAC;\n\tFri, 8 May 2020 09:14:52 +0200 (CEST)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n by dpdk.org (Postfix) with ESMTP id 52AE41D97E;\n Fri, 8 May 2020 09:14:50 +0200 (CEST)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 08 May 2020 00:14:50 -0700", "from intel.sh.intel.com ([10.239.255.64])\n by fmsmga001.fm.intel.com with ESMTP; 08 May 2020 00:14:48 -0700" ], "IronPort-SDR": [ "\n Bcoxhxa05s+JslWmNxKtAshtLgQNDECnwwEbQcThIRkGp7clz0ZBFqVSWii2YTA3f5jE0VFH3y\n fBIryV06Vzlg==", "\n V4th8wLpo0tUu25FeNX9/o2DNGpOdjUBR24pv3Sloeb6oBvMloXauSUZ6b03PR2iwgmqM2rC4V\n +NjYTbRI1e7Q==" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.73,366,1583222400\"; d=\"scan'208\";a=\"370363315\"", "From": "Shougang Wang <shougangx.wang@intel.com>", "To": "dev@dpdk.org", "Cc": "Qiming Yang <qiming.yang@intel.com>,\n Shougang Wang <shougangx.wang@intel.com>, stable@dpdk.org", "Date": "Fri, 8 May 2020 07:13:40 +0000", "Message-Id": "<20200508071340.75836-1-shougangx.wang@intel.com>", "X-Mailer": "git-send-email 2.17.1", "Subject": "[dpdk-dev] [PATCH] net/ice: fix incorrect EEPROM data", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Kernel driver reads EEPROM data from flash but DPDK reads from\nshadow ram. This patch fixes the issue by changing method to get\nEEPROM data from flash.\n\nFixes: 68a1ab82ad74 (\"net/ice: speed up to retrieve EEPROM\")\nCc: stable@dpdk.org\n\nSigned-off-by: Shougang Wang <shougangx.wang@intel.com>\n---\n drivers/net/ice/base/ice_nvm.c | 4 ++--\n drivers/net/ice/base/ice_nvm.h | 3 +++\n drivers/net/ice/ice_ethdev.c | 26 +++++++++++---------------\n 3 files changed, 16 insertions(+), 17 deletions(-)", "diff": "diff --git a/drivers/net/ice/base/ice_nvm.c b/drivers/net/ice/base/ice_nvm.c\nindex 1bbd6e209..a5f9f8fe6 100644\n--- a/drivers/net/ice/base/ice_nvm.c\n+++ b/drivers/net/ice/base/ice_nvm.c\n@@ -186,7 +186,7 @@ ice_read_sr_buf_aq(struct ice_hw *hw, u16 offset, u16 *words, u16 *data)\n *\n * This function will request NVM ownership.\n */\n-static enum ice_status\n+enum ice_status\n ice_acquire_nvm(struct ice_hw *hw, enum ice_aq_res_access_type access)\n {\n \tice_debug(hw, ICE_DBG_TRACE, \"%s\\n\", __func__);\n@@ -203,7 +203,7 @@ ice_acquire_nvm(struct ice_hw *hw, enum ice_aq_res_access_type access)\n *\n * This function will release NVM ownership.\n */\n-static void ice_release_nvm(struct ice_hw *hw)\n+void ice_release_nvm(struct ice_hw *hw)\n {\n \tice_debug(hw, ICE_DBG_TRACE, \"%s\\n\", __func__);\n \ndiff --git a/drivers/net/ice/base/ice_nvm.h b/drivers/net/ice/base/ice_nvm.h\nindex e5f8888e3..075e7a59f 100644\n--- a/drivers/net/ice/base/ice_nvm.h\n+++ b/drivers/net/ice/base/ice_nvm.h\n@@ -85,6 +85,9 @@ enum ice_status\n ice_handle_nvm_access(struct ice_hw *hw, struct ice_nvm_access_cmd *cmd,\n \t\t union ice_nvm_access_data *data);\n enum ice_status\n+ice_acquire_nvm(struct ice_hw *hw, enum ice_aq_res_access_type access);\n+void ice_release_nvm(struct ice_hw *hw);\n+enum ice_status\n ice_read_flat_nvm(struct ice_hw *hw, u32 offset, u32 *length, u8 *data,\n \t\t bool read_shadow_ram);\n enum ice_status\ndiff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c\nindex d5110c439..3d8118e37 100644\n--- a/drivers/net/ice/ice_ethdev.c\n+++ b/drivers/net/ice/ice_ethdev.c\n@@ -3951,8 +3951,7 @@ ice_get_eeprom_length(struct rte_eth_dev *dev)\n {\n \tstruct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n \n-\t/* Convert word count to byte count */\n-\treturn hw->nvm.sr_words << 1;\n+\treturn hw->nvm.flash_size;\n }\n \n static int\n@@ -3960,26 +3959,23 @@ ice_get_eeprom(struct rte_eth_dev *dev,\n \t struct rte_dev_eeprom_info *eeprom)\n {\n \tstruct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n-\tuint16_t *data = eeprom->data;\n-\tuint16_t first_word, last_word, nwords;\n+\tuint8_t *data = eeprom->data;\n \tenum ice_status status = ICE_SUCCESS;\n+\teeprom->magic = hw->vendor_id | (hw->device_id << 16);\n \n-\tfirst_word = eeprom->offset >> 1;\n-\tlast_word = (eeprom->offset + eeprom->length - 1) >> 1;\n-\tnwords = last_word - first_word + 1;\n-\n-\tif (first_word >= hw->nvm.sr_words ||\n-\t last_word >= hw->nvm.sr_words) {\n-\t\tPMD_DRV_LOG(ERR, \"Requested EEPROM bytes out of range.\");\n-\t\treturn -EINVAL;\n+\tstatus = ice_acquire_nvm(hw, ICE_RES_READ);\n+\tif (status) {\n+\t\tPMD_DRV_LOG(ERR, \"acquire nvm failed.\");\n+\t\treturn -EIO;\n \t}\n \n-\teeprom->magic = hw->vendor_id | (hw->device_id << 16);\n+\tstatus = ice_read_flat_nvm(hw, eeprom->offset, &eeprom->length,\n+\t\t\tdata, false);\n+\n+\tice_release_nvm(hw);\n \n-\tstatus = ice_read_sr_buf(hw, first_word, &nwords, data);\n \tif (status) {\n \t\tPMD_DRV_LOG(ERR, \"EEPROM read failed.\");\n-\t\teeprom->length = sizeof(uint16_t) * nwords;\n \t\treturn -EIO;\n \t}\n \n", "prefixes": [] }{ "id": 69978, "url": "