Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/509/?format=api
https://patches.dpdk.org/api/patches/509/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1411654744-9460-4-git-send-email-changchun.ouyang@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": "<1411654744-9460-4-git-send-email-changchun.ouyang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1411654744-9460-4-git-send-email-changchun.ouyang@intel.com", "date": "2014-09-25T14:18:49", "name": "[dpdk-dev,03/18] ixgbe: New function to check command complete in IXGBE base code", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "1b9c905be5e553405e844570becdf941982c45d0", "submitter": { "id": 31, "url": "https://patches.dpdk.org/api/people/31/?format=api", "name": "Ouyang Changchun", "email": "changchun.ouyang@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1411654744-9460-4-git-send-email-changchun.ouyang@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/509/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/509/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 C318CB3EA;\n\tThu, 25 Sep 2014 16:13:04 +0200 (CEST)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id DB0B7B3E4\n\tfor <dev@dpdk.org>; Thu, 25 Sep 2014 16:13:03 +0200 (CEST)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga101.jf.intel.com with ESMTP; 25 Sep 2014 07:19:20 -0700", "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga002.jf.intel.com with ESMTP; 25 Sep 2014 07:19: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 s8PEJGvx027580;\n\tThu, 25 Sep 2014 22:19:16 +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 s8PEJEvh009514; Thu, 25 Sep 2014 22:19:16 +0800", "(from couyang@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s8PEJEsc009510; \n\tThu, 25 Sep 2014 22:19:14 +0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.04,597,1406617200\"; d=\"scan'208\";a=\"608500026\"", "From": "Ouyang Changchun <changchun.ouyang@intel.com>", "To": "dev@dpdk.org", "Date": "Thu, 25 Sep 2014 22:18:49 +0800", "Message-Id": "<1411654744-9460-4-git-send-email-changchun.ouyang@intel.com>", "X-Mailer": "git-send-email 1.7.4.1", "In-Reply-To": "<1411654744-9460-1-git-send-email-changchun.ouyang@intel.com>", "References": "<1411654744-9460-1-git-send-email-changchun.ouyang@intel.com>", "Subject": "[dpdk-dev] [PATCH 03/18] ixgbe: New function to check command\n\tcomplete 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 implements a function to check command complete for flow director in\nIXGBE base code, and replaces related code snippet with this function.\n\nSigned-off-by: Changchun Ouyang <changchun.ouyang@intel.com>\n---\n lib/librte_pmd_ixgbe/ixgbe/ixgbe_82599.c | 63 +++++++++++++++++++-------------\n 1 file changed, 38 insertions(+), 25 deletions(-)", "diff": "diff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_82599.c b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_82599.c\nindex 046a35e..126aa24 100644\n--- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_82599.c\n+++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_82599.c\n@@ -1313,11 +1313,30 @@ reset_hw_out:\n }\n \n /**\n+ * ixgbe_fdir_check_cmd_complete - poll to check whether FDIRCMD is complete\n+ * @hw: pointer to hardware structure\n+ */\n+STATIC s32 ixgbe_fdir_check_cmd_complete(struct ixgbe_hw *hw)\n+{\n+\tint i;\n+\n+\tfor (i = 0; i < IXGBE_FDIRCMD_CMD_POLL; i++) {\n+\t\tif (!(IXGBE_READ_REG(hw, IXGBE_FDIRCMD) &\n+\t\t IXGBE_FDIRCMD_CMD_MASK))\n+\t\t\treturn IXGBE_SUCCESS;\n+\t\tusec_delay(10);\n+\t}\n+\n+\treturn IXGBE_ERR_FDIR_CMD_INCOMPLETE;\n+}\n+\n+/**\n * ixgbe_reinit_fdir_tables_82599 - Reinitialize Flow Director tables.\n * @hw: pointer to hardware structure\n **/\n s32 ixgbe_reinit_fdir_tables_82599(struct ixgbe_hw *hw)\n {\n+\ts32 err;\n \tint i;\n \tu32 fdirctrl = IXGBE_READ_REG(hw, IXGBE_FDIRCTRL);\n \tfdirctrl &= ~IXGBE_FDIRCTRL_INIT_DONE;\n@@ -1328,16 +1347,10 @@ s32 ixgbe_reinit_fdir_tables_82599(struct ixgbe_hw *hw)\n \t * Before starting reinitialization process,\n \t * FDIRCMD.CMD must be zero.\n \t */\n-\tfor (i = 0; i < IXGBE_FDIRCMD_CMD_POLL; i++) {\n-\t\tif (!(IXGBE_READ_REG(hw, IXGBE_FDIRCMD) &\n-\t\t IXGBE_FDIRCMD_CMD_MASK))\n-\t\t\tbreak;\n-\t\tusec_delay(10);\n-\t}\n-\tif (i >= IXGBE_FDIRCMD_CMD_POLL) {\n-\t\tDEBUGOUT(\"Flow Director previous command isn't complete, \"\n-\t\t\t \"aborting table re-initialization.\\n\");\n-\t\treturn IXGBE_ERR_FDIR_REINIT_FAILED;\n+\terr = ixgbe_fdir_check_cmd_complete(hw);\n+\tif (err) {\n+\t\tDEBUGOUT(\"Flow Director previous command did not complete, aborting table re-initialization.\\n\");\n+\t\treturn err;\n \t}\n \n \tIXGBE_WRITE_REG(hw, IXGBE_FDIRFREE, 0);\n@@ -1593,8 +1606,9 @@ s32 ixgbe_fdir_add_signature_filter_82599(struct ixgbe_hw *hw,\n \t\t\t\t\t union ixgbe_atr_hash_dword common,\n \t\t\t\t\t u8 queue)\n {\n-\tu64 fdirhashcmd;\n-\tu32 fdircmd;\n+\tu64 fdirhashcmd;\n+\tu32 fdircmd;\n+\ts32 err;\n \n \tDEBUGFUNC(\"ixgbe_fdir_add_signature_filter_82599\");\n \n@@ -1630,6 +1644,12 @@ s32 ixgbe_fdir_add_signature_filter_82599(struct ixgbe_hw *hw,\n \tfdirhashcmd |= ixgbe_atr_compute_sig_hash_82599(input, common);\n \tIXGBE_WRITE_REG64(hw, IXGBE_FDIRHASH, fdirhashcmd);\n \n+\terr = ixgbe_fdir_check_cmd_complete(hw);\n+\tif (err) {\n+\t\tDEBUGOUT(\"Flow Director command did not complete!\\n\");\n+\t\treturn err;\n+\t}\n+\n \tDEBUGOUT2(\"Tx Queue=%x hash=%x\\n\", queue, (u32)fdirhashcmd);\n \n \treturn IXGBE_SUCCESS;\n@@ -1906,8 +1926,7 @@ s32 ixgbe_fdir_erase_perfect_filter_82599(struct ixgbe_hw *hw,\n {\n \tu32 fdirhash;\n \tu32 fdircmd = 0;\n-\tu32 retry_count;\n-\ts32 err = IXGBE_SUCCESS;\n+\ts32 err;\n \n \t/* configure FDIRHASH register */\n \tfdirhash = input->formatted.bkt_hash;\n@@ -1920,18 +1939,12 @@ s32 ixgbe_fdir_erase_perfect_filter_82599(struct ixgbe_hw *hw,\n \t/* Query if filter is present */\n \tIXGBE_WRITE_REG(hw, IXGBE_FDIRCMD, IXGBE_FDIRCMD_CMD_QUERY_REM_FILT);\n \n-\tfor (retry_count = 10; retry_count; retry_count--) {\n-\t\t/* allow 10us for query to process */\n-\t\tusec_delay(10);\n-\t\t/* verify query completed successfully */\n-\t\tfdircmd = IXGBE_READ_REG(hw, IXGBE_FDIRCMD);\n-\t\tif (!(fdircmd & IXGBE_FDIRCMD_CMD_MASK))\n-\t\t\tbreak;\n+\terr = ixgbe_fdir_check_cmd_complete(hw);\n+\tif (err) {\n+\t\tDEBUGOUT(\"Flow Director command did not complete!\\n\");\n+\t\treturn err;\n \t}\n \n-\tif (!retry_count)\n-\t\terr = IXGBE_ERR_FDIR_REINIT_FAILED;\n-\n \t/* if filter exists in hardware then remove it */\n \tif (fdircmd & IXGBE_FDIRCMD_FILTER_VALID) {\n \t\tIXGBE_WRITE_REG(hw, IXGBE_FDIRHASH, fdirhash);\n@@ -1940,7 +1953,7 @@ s32 ixgbe_fdir_erase_perfect_filter_82599(struct ixgbe_hw *hw,\n \t\t\t\tIXGBE_FDIRCMD_CMD_REMOVE_FLOW);\n \t}\n \n-\treturn err;\n+\treturn IXGBE_SUCCESS;\n }\n \n /**\n", "prefixes": [ "dpdk-dev", "03/18" ] }{ "id": 509, "url": "