Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/6933/?format=api
https://patches.dpdk.org/api/patches/6933/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1441523526-26202-33-git-send-email-jingjing.wu@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": "<1441523526-26202-33-git-send-email-jingjing.wu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1441523526-26202-33-git-send-email-jingjing.wu@intel.com", "date": "2015-09-06T07:11:46", "name": "[dpdk-dev,32/52] i40e/base: Handle admin Q timeout when releasing NVM", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "474990970e0f67c08cf3e434b218970db510260a", "submitter": { "id": 47, "url": "https://patches.dpdk.org/api/people/47/?format=api", "name": "Jingjing Wu", "email": "jingjing.wu@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1441523526-26202-33-git-send-email-jingjing.wu@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/6933/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/6933/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 331EB924F;\n\tSun, 6 Sep 2015 09:13:27 +0200 (CEST)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id D41639219\n\tfor <dev@dpdk.org>; Sun, 6 Sep 2015 09:13:25 +0200 (CEST)", "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga102.jf.intel.com with ESMTP; 06 Sep 2015 00:13:25 -0700", "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga001.jf.intel.com with ESMTP; 06 Sep 2015 00:13: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 t867DM0k019640;\n\tSun, 6 Sep 2015 15:13: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 t867DKtA026463; Sun, 6 Sep 2015 15:13:22 +0800", "(from wujingji@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t867DKiW026459; \n\tSun, 6 Sep 2015 15:13:20 +0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.17,478,1437462000\"; d=\"scan'208\";a=\"763415994\"", "From": "Jingjing Wu <jingjing.wu@intel.com>", "To": "dev@dpdk.org", "Date": "Sun, 6 Sep 2015 15:11:46 +0800", "Message-Id": "<1441523526-26202-33-git-send-email-jingjing.wu@intel.com>", "X-Mailer": "git-send-email 1.7.4.1", "In-Reply-To": "<1441523526-26202-1-git-send-email-jingjing.wu@intel.com>", "References": "<1441523526-26202-1-git-send-email-jingjing.wu@intel.com>", "Subject": "[dpdk-dev] [PATCH 32/52] i40e/base: Handle admin Q timeout when\n\treleasing NVM", "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": "There are some rare cases where the release resource call will return an\nadmin Q timeout. In these cases the code needs to try to release the\nresource again until it succeeds or it times out.\n\nAlso add little endian conversion for checksum\n\nSigned-off-by: Jingjing Wu <jingjing.wu@intel.com>\n---\n drivers/net/i40e/base/i40e_nvm.c | 25 ++++++++++++++++++++++---\n 1 file changed, 22 insertions(+), 3 deletions(-)", "diff": "diff --git a/drivers/net/i40e/base/i40e_nvm.c b/drivers/net/i40e/base/i40e_nvm.c\nindex 1c93c56..10c2d77 100644\n--- a/drivers/net/i40e/base/i40e_nvm.c\n+++ b/drivers/net/i40e/base/i40e_nvm.c\n@@ -157,10 +157,26 @@ i40e_i40e_acquire_nvm_exit:\n **/\n void i40e_release_nvm(struct i40e_hw *hw)\n {\n+\tenum i40e_status_code ret_code = I40E_SUCCESS;\n+\tu32 total_delay = 0;\n+\n \tDEBUGFUNC(\"i40e_release_nvm\");\n \n-\tif (!hw->nvm.blank_nvm_mode)\n-\t\ti40e_aq_release_resource(hw, I40E_NVM_RESOURCE_ID, 0, NULL);\n+\tif (hw->nvm.blank_nvm_mode)\n+\t\treturn;\n+\n+\tret_code = i40e_aq_release_resource(hw, I40E_NVM_RESOURCE_ID, 0, NULL);\n+\n+\t/* there are some rare cases when trying to release the resource\n+\t * results in an admin Q timeout, so handle them correctly\n+\t */\n+\twhile ((ret_code == I40E_ERR_ADMIN_QUEUE_TIMEOUT) &&\n+\t (total_delay < hw->aq.asq_cmd_timeout)) {\n+\t\t\ti40e_msec_delay(1);\n+\t\t\tret_code = i40e_aq_release_resource(hw,\n+\t\t\t\t\t\tI40E_NVM_RESOURCE_ID, 0, NULL);\n+\t\t\ttotal_delay++;\n+\t}\n }\n \n /**\n@@ -587,6 +603,7 @@ enum i40e_status_code i40e_calc_nvm_checksum(struct i40e_hw *hw, u16 *checksum)\n \t\t/* Read SR page */\n \t\tif ((i % I40E_SR_SECTOR_SIZE_IN_WORDS) == 0) {\n \t\t\tu16 words = I40E_SR_SECTOR_SIZE_IN_WORDS;\n+\n \t\t\tret_code = i40e_read_nvm_buffer(hw, i, &words, data);\n \t\t\tif (ret_code != I40E_SUCCESS) {\n \t\t\t\tret_code = I40E_ERR_NVM_CHECKSUM;\n@@ -632,13 +649,15 @@ enum i40e_status_code i40e_update_nvm_checksum(struct i40e_hw *hw)\n {\n \tenum i40e_status_code ret_code = I40E_SUCCESS;\n \tu16 checksum;\n+\t__le16 le_sum;\n \n \tDEBUGFUNC(\"i40e_update_nvm_checksum\");\n \n \tret_code = i40e_calc_nvm_checksum(hw, &checksum);\n+\tle_sum = CPU_TO_LE16(checksum);\n \tif (ret_code == I40E_SUCCESS)\n \t\tret_code = i40e_write_nvm_aq(hw, 0x00, I40E_SR_SW_CHECKSUM_WORD,\n-\t\t\t\t\t 1, &checksum, true);\n+\t\t\t\t\t 1, &le_sum, true);\n \n \treturn ret_code;\n }\n", "prefixes": [ "dpdk-dev", "32/52" ] }{ "id": 6933, "url": "