Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/30453/?format=api
https://patches.dpdk.org/api/patches/30453/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1508219440-97150-6-git-send-email-wenzhuo.lu@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": "<1508219440-97150-6-git-send-email-wenzhuo.lu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1508219440-97150-6-git-send-email-wenzhuo.lu@intel.com", "date": "2017-10-17T05:50:38", "name": "[dpdk-dev,v2,5/7] net/i40e: fix not supporting NULL TM profile", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "22f3de97a8eefebf63b9630d391d8f32fdd5b68b", "submitter": { "id": 258, "url": "https://patches.dpdk.org/api/people/258/?format=api", "name": "Wenzhuo Lu", "email": "wenzhuo.lu@intel.com" }, "delegate": { "id": 319, "url": "https://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1508219440-97150-6-git-send-email-wenzhuo.lu@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/30453/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/30453/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id BC46D1B7C3;\n\tTue, 17 Oct 2017 07:49:33 +0200 (CEST)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 657C11B799\n\tfor <dev@dpdk.org>; Tue, 17 Oct 2017 07:49:26 +0200 (CEST)", "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t16 Oct 2017 22:49:26 -0700", "from dpdk26.sh.intel.com ([10.67.110.152])\n\tby orsmga003.jf.intel.com with ESMTP; 16 Oct 2017 22:49:24 -0700" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos; i=\"5.43,389,1503385200\"; d=\"scan'208\";\n\ta=\"1025909296\"", "From": "Wenzhuo Lu <wenzhuo.lu@intel.com>", "To": "dev@dpdk.org", "Cc": "Wenzhuo Lu <wenzhuo.lu@intel.com>", "Date": "Tue, 17 Oct 2017 13:50:38 +0800", "Message-Id": "<1508219440-97150-6-git-send-email-wenzhuo.lu@intel.com>", "X-Mailer": "git-send-email 1.9.3", "In-Reply-To": "<1508219440-97150-1-git-send-email-wenzhuo.lu@intel.com>", "References": "<1507863488-41191-1-git-send-email-wenzhuo.lu@intel.com>\n\t<1508219440-97150-1-git-send-email-wenzhuo.lu@intel.com>", "Subject": "[dpdk-dev] [PATCH v2 5/7] net/i40e: fix not supporting NULL TM\n\tprofile", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <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": "It's by design that APP can add a TM node without shaper\nprofile. But i40e doesn't support it currently.\n\nFixes: 03a249b62bbd (\"net/i40e: support adding TM node\")\nFixes: cac29c3c00a4 (\"net/i40e: support committing TM hierarchy\")\nSigned-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>\n---\n drivers/net/i40e/i40e_tm.c | 47 +++++++++++++++++++++++++++++++---------------\n 1 file changed, 32 insertions(+), 15 deletions(-)", "diff": "diff --git a/drivers/net/i40e/i40e_tm.c b/drivers/net/i40e/i40e_tm.c\nindex d46a972..f4d1cb8 100644\n--- a/drivers/net/i40e/i40e_tm.c\n+++ b/drivers/net/i40e/i40e_tm.c\n@@ -480,7 +480,7 @@ static int i40e_hierarchy_commit(struct rte_eth_dev *dev,\n \tstruct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n \tenum i40e_tm_node_type node_type = I40E_TM_NODE_TYPE_MAX;\n \tenum i40e_tm_node_type parent_node_type = I40E_TM_NODE_TYPE_MAX;\n-\tstruct i40e_tm_shaper_profile *shaper_profile;\n+\tstruct i40e_tm_shaper_profile *shaper_profile = NULL;\n \tstruct i40e_tm_node *tm_node;\n \tstruct i40e_tm_node *parent_node;\n \tuint16_t tc_nb = 0;\n@@ -509,12 +509,15 @@ static int i40e_hierarchy_commit(struct rte_eth_dev *dev,\n \t}\n \n \t/* check the shaper profile id */\n-\tshaper_profile = i40e_shaper_profile_search(dev,\n-\t\t\t\t\t\t params->shaper_profile_id);\n-\tif (!shaper_profile) {\n-\t\terror->type = RTE_TM_ERROR_TYPE_NODE_PARAMS_SHAPER_PROFILE_ID;\n-\t\terror->message = \"shaper profile not exist\";\n-\t\treturn -EINVAL;\n+\tif (params->shaper_profile_id != RTE_TM_SHAPER_PROFILE_ID_NONE) {\n+\t\tshaper_profile = i40e_shaper_profile_search(\n+\t\t\t\t\tdev, params->shaper_profile_id);\n+\t\tif (!shaper_profile) {\n+\t\t\terror->type =\n+\t\t\t\tRTE_TM_ERROR_TYPE_NODE_PARAMS_SHAPER_PROFILE_ID;\n+\t\t\terror->message = \"shaper profile not exist\";\n+\t\t\treturn -EINVAL;\n+\t\t}\n \t}\n \n \t/* root node if not have a parent */\n@@ -551,7 +554,8 @@ static int i40e_hierarchy_commit(struct rte_eth_dev *dev,\n \t\tpf->tm_conf.root = tm_node;\n \n \t\t/* increase the reference counter of the shaper profile */\n-\t\tshaper_profile->reference_count++;\n+\t\tif (shaper_profile)\n+\t\t\tshaper_profile->reference_count++;\n \n \t\treturn 0;\n \t}\n@@ -633,7 +637,8 @@ static int i40e_hierarchy_commit(struct rte_eth_dev *dev,\n \ttm_node->parent->reference_count++;\n \n \t/* increase the reference counter of the shaper profile */\n-\tshaper_profile->reference_count++;\n+\tif (shaper_profile)\n+\t\tshaper_profile->reference_count++;\n \n \treturn 0;\n }\n@@ -680,14 +685,16 @@ static int i40e_hierarchy_commit(struct rte_eth_dev *dev,\n \n \t/* root node */\n \tif (node_type == I40E_TM_NODE_TYPE_PORT) {\n-\t\ttm_node->shaper_profile->reference_count--;\n+\t\tif (tm_node->shaper_profile)\n+\t\t\ttm_node->shaper_profile->reference_count--;\n \t\trte_free(tm_node);\n \t\tpf->tm_conf.root = NULL;\n \t\treturn 0;\n \t}\n \n \t/* TC or queue node */\n-\ttm_node->shaper_profile->reference_count--;\n+\tif (tm_node->shaper_profile)\n+\t\ttm_node->shaper_profile->reference_count--;\n \ttm_node->parent->reference_count--;\n \tif (node_type == I40E_TM_NODE_TYPE_TC) {\n \t\tTAILQ_REMOVE(&pf->tm_conf.tc_list, tm_node, node);\n@@ -895,11 +902,15 @@ static int i40e_hierarchy_commit(struct rte_eth_dev *dev,\n \t * If the port has a max bandwidth, the TCs should have none.\n \t */\n \t/* port */\n-\tbw = pf->tm_conf.root->shaper_profile->profile.peak.rate;\n+\tif (pf->tm_conf.root->shaper_profile)\n+\t\tbw = pf->tm_conf.root->shaper_profile->profile.peak.rate;\n+\telse\n+\t\tbw = 0;\n \tif (bw) {\n \t\t/* check if any TC has a max bandwidth */\n \t\tTAILQ_FOREACH(tm_node, tc_list, node) {\n-\t\t\tif (tm_node->shaper_profile->profile.peak.rate) {\n+\t\t\tif (tm_node->shaper_profile &&\n+\t\t\t tm_node->shaper_profile->profile.peak.rate) {\n \t\t\t\terror->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE;\n \t\t\t\terror->message = \"no port and TC max bandwidth\"\n \t\t\t\t\t\t \" in parallel\";\n@@ -943,7 +954,10 @@ static int i40e_hierarchy_commit(struct rte_eth_dev *dev,\n \t\t}\n \t\ttc_map &= ~BIT_ULL(i);\n \n-\t\tbw = tm_node->shaper_profile->profile.peak.rate;\n+\t\tif (tm_node->shaper_profile)\n+\t\t\tbw = tm_node->shaper_profile->profile.peak.rate;\n+\t\telse\n+\t\t\tbw = 0;\n \t\tif (!bw)\n \t\t\tcontinue;\n \n@@ -954,7 +968,10 @@ static int i40e_hierarchy_commit(struct rte_eth_dev *dev,\n \t}\n \n \tTAILQ_FOREACH(tm_node, queue_list, node) {\n-\t\tbw = tm_node->shaper_profile->profile.peak.rate;\n+\t\tif (tm_node->shaper_profile)\n+\t\t\tbw = tm_node->shaper_profile->profile.peak.rate;\n+\t\telse\n+\t\t\tbw = 0;\n \t\tif (bw) {\n \t\t\terror->type = RTE_TM_ERROR_TYPE_NODE_PARAMS;\n \t\t\terror->message = \"not support queue QoS\";\n", "prefixes": [ "dpdk-dev", "v2", "5/7" ] }{ "id": 30453, "url": "