Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/6908/?format=api
https://patches.dpdk.org/api/patches/6908/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1441523526-26202-4-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-4-git-send-email-jingjing.wu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1441523526-26202-4-git-send-email-jingjing.wu@intel.com", "date": "2015-09-06T07:11:17", "name": "[dpdk-dev,03/52] i40e/base: add error status value decoding", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "ab5e012e1e33b62d083e6394af45a3139d7005dc", "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-4-git-send-email-jingjing.wu@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/6908/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/6908/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 EF6EA8E75;\n\tSun, 6 Sep 2015 09:12:22 +0200 (CEST)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id EEEBF8E62\n\tfor <dev@dpdk.org>; Sun, 6 Sep 2015 09:12:20 +0200 (CEST)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga102.fm.intel.com with ESMTP; 06 Sep 2015 00:12:20 -0700", "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby FMSMGA003.fm.intel.com with ESMTP; 06 Sep 2015 00:12:19 -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 t867CHof018296;\n\tSun, 6 Sep 2015 15:12:17 +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 t867CESi026258; Sun, 6 Sep 2015 15:12:16 +0800", "(from wujingji@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t867CEP7026254; \n\tSun, 6 Sep 2015 15:12:14 +0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.17,478,1437462000\"; d=\"scan'208\";a=\"556310138\"", "From": "Jingjing Wu <jingjing.wu@intel.com>", "To": "dev@dpdk.org", "Date": "Sun, 6 Sep 2015 15:11:17 +0800", "Message-Id": "<1441523526-26202-4-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 03/52] i40e/base: add error status value decoding", "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": "Add status value to string decoding routines to be used in error reporting\nin order to give more readable error messages rather than bare error\nnumbers. This decodes both the i40e_status and the AQ error codes.\n\nSigned-off-by: Jingjing Wu <jingjing.wu@intel.com>\n---\n drivers/net/i40e/base/i40e_common.c | 208 +++++++++++++++++++++++++++++++++\n drivers/net/i40e/base/i40e_prototype.h | 4 +\n drivers/net/i40e/base/i40e_type.h | 3 +\n 3 files changed, 215 insertions(+)", "diff": "diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c\nindex 3ec0e94..ba7bc67 100644\n--- a/drivers/net/i40e/base/i40e_common.c\n+++ b/drivers/net/i40e/base/i40e_common.c\n@@ -87,6 +87,214 @@ STATIC enum i40e_status_code i40e_set_mac_type(struct i40e_hw *hw)\n \treturn status;\n }\n \n+#ifndef I40E_NDIS_SUPPORT\n+/**\n+ * i40e_aq_str - convert AQ err code to a string\n+ * @hw: pointer to the HW structure\n+ * @aq_err: the AQ error code to convert\n+ **/\n+const char *i40e_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err)\n+{\n+\tswitch (aq_err) {\n+\tcase I40E_AQ_RC_OK:\n+\t\treturn \"OK\";\n+\tcase I40E_AQ_RC_EPERM:\n+\t\treturn \"I40E_AQ_RC_EPERM\";\n+\tcase I40E_AQ_RC_ENOENT:\n+\t\treturn \"I40E_AQ_RC_ENOENT\";\n+\tcase I40E_AQ_RC_ESRCH:\n+\t\treturn \"I40E_AQ_RC_ESRCH\";\n+\tcase I40E_AQ_RC_EINTR:\n+\t\treturn \"I40E_AQ_RC_EINTR\";\n+\tcase I40E_AQ_RC_EIO:\n+\t\treturn \"I40E_AQ_RC_EIO\";\n+\tcase I40E_AQ_RC_ENXIO:\n+\t\treturn \"I40E_AQ_RC_ENXIO\";\n+\tcase I40E_AQ_RC_E2BIG:\n+\t\treturn \"I40E_AQ_RC_E2BIG\";\n+\tcase I40E_AQ_RC_EAGAIN:\n+\t\treturn \"I40E_AQ_RC_EAGAIN\";\n+\tcase I40E_AQ_RC_ENOMEM:\n+\t\treturn \"I40E_AQ_RC_ENOMEM\";\n+\tcase I40E_AQ_RC_EACCES:\n+\t\treturn \"I40E_AQ_RC_EACCES\";\n+\tcase I40E_AQ_RC_EFAULT:\n+\t\treturn \"I40E_AQ_RC_EFAULT\";\n+\tcase I40E_AQ_RC_EBUSY:\n+\t\treturn \"I40E_AQ_RC_EBUSY\";\n+\tcase I40E_AQ_RC_EEXIST:\n+\t\treturn \"I40E_AQ_RC_EEXIST\";\n+\tcase I40E_AQ_RC_EINVAL:\n+\t\treturn \"I40E_AQ_RC_EINVAL\";\n+\tcase I40E_AQ_RC_ENOTTY:\n+\t\treturn \"I40E_AQ_RC_ENOTTY\";\n+\tcase I40E_AQ_RC_ENOSPC:\n+\t\treturn \"I40E_AQ_RC_ENOSPC\";\n+\tcase I40E_AQ_RC_ENOSYS:\n+\t\treturn \"I40E_AQ_RC_ENOSYS\";\n+\tcase I40E_AQ_RC_ERANGE:\n+\t\treturn \"I40E_AQ_RC_ERANGE\";\n+\tcase I40E_AQ_RC_EFLUSHED:\n+\t\treturn \"I40E_AQ_RC_EFLUSHED\";\n+\tcase I40E_AQ_RC_BAD_ADDR:\n+\t\treturn \"I40E_AQ_RC_BAD_ADDR\";\n+\tcase I40E_AQ_RC_EMODE:\n+\t\treturn \"I40E_AQ_RC_EMODE\";\n+\tcase I40E_AQ_RC_EFBIG:\n+\t\treturn \"I40E_AQ_RC_EFBIG\";\n+\t}\n+\n+\tsnprintf(hw->err_str, sizeof(hw->err_str), \"%d\", aq_err);\n+\treturn hw->err_str;\n+}\n+\n+/**\n+ * i40e_stat_str - convert status err code to a string\n+ * @hw: pointer to the HW structure\n+ * @stat_err: the status error code to convert\n+ **/\n+const char *i40e_stat_str(struct i40e_hw *hw, enum i40e_status_code stat_err)\n+{\n+\tswitch (stat_err) {\n+\tcase I40E_SUCCESS:\n+\t\treturn \"OK\";\n+\tcase I40E_ERR_NVM:\n+\t\treturn \"I40E_ERR_NVM\";\n+\tcase I40E_ERR_NVM_CHECKSUM:\n+\t\treturn \"I40E_ERR_NVM_CHECKSUM\";\n+\tcase I40E_ERR_PHY:\n+\t\treturn \"I40E_ERR_PHY\";\n+\tcase I40E_ERR_CONFIG:\n+\t\treturn \"I40E_ERR_CONFIG\";\n+\tcase I40E_ERR_PARAM:\n+\t\treturn \"I40E_ERR_PARAM\";\n+\tcase I40E_ERR_MAC_TYPE:\n+\t\treturn \"I40E_ERR_MAC_TYPE\";\n+\tcase I40E_ERR_UNKNOWN_PHY:\n+\t\treturn \"I40E_ERR_UNKNOWN_PHY\";\n+\tcase I40E_ERR_LINK_SETUP:\n+\t\treturn \"I40E_ERR_LINK_SETUP\";\n+\tcase I40E_ERR_ADAPTER_STOPPED:\n+\t\treturn \"I40E_ERR_ADAPTER_STOPPED\";\n+\tcase I40E_ERR_INVALID_MAC_ADDR:\n+\t\treturn \"I40E_ERR_INVALID_MAC_ADDR\";\n+\tcase I40E_ERR_DEVICE_NOT_SUPPORTED:\n+\t\treturn \"I40E_ERR_DEVICE_NOT_SUPPORTED\";\n+\tcase I40E_ERR_MASTER_REQUESTS_PENDING:\n+\t\treturn \"I40E_ERR_MASTER_REQUESTS_PENDING\";\n+\tcase I40E_ERR_INVALID_LINK_SETTINGS:\n+\t\treturn \"I40E_ERR_INVALID_LINK_SETTINGS\";\n+\tcase I40E_ERR_AUTONEG_NOT_COMPLETE:\n+\t\treturn \"I40E_ERR_AUTONEG_NOT_COMPLETE\";\n+\tcase I40E_ERR_RESET_FAILED:\n+\t\treturn \"I40E_ERR_RESET_FAILED\";\n+\tcase I40E_ERR_SWFW_SYNC:\n+\t\treturn \"I40E_ERR_SWFW_SYNC\";\n+\tcase I40E_ERR_NO_AVAILABLE_VSI:\n+\t\treturn \"I40E_ERR_NO_AVAILABLE_VSI\";\n+\tcase I40E_ERR_NO_MEMORY:\n+\t\treturn \"I40E_ERR_NO_MEMORY\";\n+\tcase I40E_ERR_BAD_PTR:\n+\t\treturn \"I40E_ERR_BAD_PTR\";\n+\tcase I40E_ERR_RING_FULL:\n+\t\treturn \"I40E_ERR_RING_FULL\";\n+\tcase I40E_ERR_INVALID_PD_ID:\n+\t\treturn \"I40E_ERR_INVALID_PD_ID\";\n+\tcase I40E_ERR_INVALID_QP_ID:\n+\t\treturn \"I40E_ERR_INVALID_QP_ID\";\n+\tcase I40E_ERR_INVALID_CQ_ID:\n+\t\treturn \"I40E_ERR_INVALID_CQ_ID\";\n+\tcase I40E_ERR_INVALID_CEQ_ID:\n+\t\treturn \"I40E_ERR_INVALID_CEQ_ID\";\n+\tcase I40E_ERR_INVALID_AEQ_ID:\n+\t\treturn \"I40E_ERR_INVALID_AEQ_ID\";\n+\tcase I40E_ERR_INVALID_SIZE:\n+\t\treturn \"I40E_ERR_INVALID_SIZE\";\n+\tcase I40E_ERR_INVALID_ARP_INDEX:\n+\t\treturn \"I40E_ERR_INVALID_ARP_INDEX\";\n+\tcase I40E_ERR_INVALID_FPM_FUNC_ID:\n+\t\treturn \"I40E_ERR_INVALID_FPM_FUNC_ID\";\n+\tcase I40E_ERR_QP_INVALID_MSG_SIZE:\n+\t\treturn \"I40E_ERR_QP_INVALID_MSG_SIZE\";\n+\tcase I40E_ERR_QP_TOOMANY_WRS_POSTED:\n+\t\treturn \"I40E_ERR_QP_TOOMANY_WRS_POSTED\";\n+\tcase I40E_ERR_INVALID_FRAG_COUNT:\n+\t\treturn \"I40E_ERR_INVALID_FRAG_COUNT\";\n+\tcase I40E_ERR_QUEUE_EMPTY:\n+\t\treturn \"I40E_ERR_QUEUE_EMPTY\";\n+\tcase I40E_ERR_INVALID_ALIGNMENT:\n+\t\treturn \"I40E_ERR_INVALID_ALIGNMENT\";\n+\tcase I40E_ERR_FLUSHED_QUEUE:\n+\t\treturn \"I40E_ERR_FLUSHED_QUEUE\";\n+\tcase I40E_ERR_INVALID_PUSH_PAGE_INDEX:\n+\t\treturn \"I40E_ERR_INVALID_PUSH_PAGE_INDEX\";\n+\tcase I40E_ERR_INVALID_IMM_DATA_SIZE:\n+\t\treturn \"I40E_ERR_INVALID_IMM_DATA_SIZE\";\n+\tcase I40E_ERR_TIMEOUT:\n+\t\treturn \"I40E_ERR_TIMEOUT\";\n+\tcase I40E_ERR_OPCODE_MISMATCH:\n+\t\treturn \"I40E_ERR_OPCODE_MISMATCH\";\n+\tcase I40E_ERR_CQP_COMPL_ERROR:\n+\t\treturn \"I40E_ERR_CQP_COMPL_ERROR\";\n+\tcase I40E_ERR_INVALID_VF_ID:\n+\t\treturn \"I40E_ERR_INVALID_VF_ID\";\n+\tcase I40E_ERR_INVALID_HMCFN_ID:\n+\t\treturn \"I40E_ERR_INVALID_HMCFN_ID\";\n+\tcase I40E_ERR_BACKING_PAGE_ERROR:\n+\t\treturn \"I40E_ERR_BACKING_PAGE_ERROR\";\n+\tcase I40E_ERR_NO_PBLCHUNKS_AVAILABLE:\n+\t\treturn \"I40E_ERR_NO_PBLCHUNKS_AVAILABLE\";\n+\tcase I40E_ERR_INVALID_PBLE_INDEX:\n+\t\treturn \"I40E_ERR_INVALID_PBLE_INDEX\";\n+\tcase I40E_ERR_INVALID_SD_INDEX:\n+\t\treturn \"I40E_ERR_INVALID_SD_INDEX\";\n+\tcase I40E_ERR_INVALID_PAGE_DESC_INDEX:\n+\t\treturn \"I40E_ERR_INVALID_PAGE_DESC_INDEX\";\n+\tcase I40E_ERR_INVALID_SD_TYPE:\n+\t\treturn \"I40E_ERR_INVALID_SD_TYPE\";\n+\tcase I40E_ERR_MEMCPY_FAILED:\n+\t\treturn \"I40E_ERR_MEMCPY_FAILED\";\n+\tcase I40E_ERR_INVALID_HMC_OBJ_INDEX:\n+\t\treturn \"I40E_ERR_INVALID_HMC_OBJ_INDEX\";\n+\tcase I40E_ERR_INVALID_HMC_OBJ_COUNT:\n+\t\treturn \"I40E_ERR_INVALID_HMC_OBJ_COUNT\";\n+\tcase I40E_ERR_INVALID_SRQ_ARM_LIMIT:\n+\t\treturn \"I40E_ERR_INVALID_SRQ_ARM_LIMIT\";\n+\tcase I40E_ERR_SRQ_ENABLED:\n+\t\treturn \"I40E_ERR_SRQ_ENABLED\";\n+\tcase I40E_ERR_ADMIN_QUEUE_ERROR:\n+\t\treturn \"I40E_ERR_ADMIN_QUEUE_ERROR\";\n+\tcase I40E_ERR_ADMIN_QUEUE_TIMEOUT:\n+\t\treturn \"I40E_ERR_ADMIN_QUEUE_TIMEOUT\";\n+\tcase I40E_ERR_BUF_TOO_SHORT:\n+\t\treturn \"I40E_ERR_BUF_TOO_SHORT\";\n+\tcase I40E_ERR_ADMIN_QUEUE_FULL:\n+\t\treturn \"I40E_ERR_ADMIN_QUEUE_FULL\";\n+\tcase I40E_ERR_ADMIN_QUEUE_NO_WORK:\n+\t\treturn \"I40E_ERR_ADMIN_QUEUE_NO_WORK\";\n+\tcase I40E_ERR_BAD_IWARP_CQE:\n+\t\treturn \"I40E_ERR_BAD_IWARP_CQE\";\n+\tcase I40E_ERR_NVM_BLANK_MODE:\n+\t\treturn \"I40E_ERR_NVM_BLANK_MODE\";\n+\tcase I40E_ERR_NOT_IMPLEMENTED:\n+\t\treturn \"I40E_ERR_NOT_IMPLEMENTED\";\n+\tcase I40E_ERR_PE_DOORBELL_NOT_ENABLED:\n+\t\treturn \"I40E_ERR_PE_DOORBELL_NOT_ENABLED\";\n+\tcase I40E_ERR_DIAG_TEST_FAILED:\n+\t\treturn \"I40E_ERR_DIAG_TEST_FAILED\";\n+\tcase I40E_ERR_NOT_READY:\n+\t\treturn \"I40E_ERR_NOT_READY\";\n+\tcase I40E_NOT_SUPPORTED:\n+\t\treturn \"I40E_NOT_SUPPORTED\";\n+\tcase I40E_ERR_FIRMWARE_API_VERSION:\n+\t\treturn \"I40E_ERR_FIRMWARE_API_VERSION\";\n+\t}\n+\n+\tsnprintf(hw->err_str, sizeof(hw->err_str), \"%d\", stat_err);\n+\treturn hw->err_str;\n+}\n+\n+#endif /* I40E_NDIS_SUPPORT */\n /**\n * i40e_debug_aq\n * @hw: debug mask related to admin queue\ndiff --git a/drivers/net/i40e/base/i40e_prototype.h b/drivers/net/i40e/base/i40e_prototype.h\nindex ef541f7..54df577 100644\n--- a/drivers/net/i40e/base/i40e_prototype.h\n+++ b/drivers/net/i40e/base/i40e_prototype.h\n@@ -77,6 +77,10 @@ void i40e_idle_aq(struct i40e_hw *hw);\n void i40e_resume_aq(struct i40e_hw *hw);\n bool i40e_check_asq_alive(struct i40e_hw *hw);\n enum i40e_status_code i40e_aq_queue_shutdown(struct i40e_hw *hw, bool unloading);\n+#ifndef I40E_NDIS_SUPPORT\n+const char *i40e_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err);\n+const char *i40e_stat_str(struct i40e_hw *hw, enum i40e_status_code stat_err);\n+#endif /* I40E_NDIS_SUPPORT */\n \n #ifdef PF_DRIVER\n \ndiff --git a/drivers/net/i40e/base/i40e_type.h b/drivers/net/i40e/base/i40e_type.h\nindex 237e3be..d9dc59f 100644\n--- a/drivers/net/i40e/base/i40e_type.h\n+++ b/drivers/net/i40e/base/i40e_type.h\n@@ -544,6 +544,9 @@ struct i40e_hw {\n \n \t/* debug mask */\n \tu32 debug_mask;\n+#ifndef I40E_NDIS_SUPPORT\n+\tchar err_str[16];\n+#endif /* I40E_NDIS_SUPPORT */\n };\n \n static inline bool i40e_is_vf(struct i40e_hw *hw)\n", "prefixes": [ "dpdk-dev", "03/52" ] }{ "id": 6908, "url": "