Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/862505/?format=api
{ "id": 862505, "url": "http://patchwork.ozlabs.org/api/patches/862505/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180117161607.49344-8-avinash.dayanand@intel.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20180117161607.49344-8-avinash.dayanand@intel.com>", "list_archive_url": null, "date": "2018-01-17T16:16:02", "name": "[v2,next-queue,07/12] i40evf: Add support to configure bw via tc tool", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "121969b4c110381fd2950c2c18cd7f5b17d25db4", "submitter": { "id": 67689, "url": "http://patchwork.ozlabs.org/api/people/67689/?format=api", "name": "Dayanand, Avinash", "email": "avinash.dayanand@intel.com" }, "delegate": { "id": 68, "url": "http://patchwork.ozlabs.org/api/users/68/?format=api", "username": "jtkirshe", "first_name": "Jeff", "last_name": "Kirsher", "email": "jeffrey.t.kirsher@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180117161607.49344-8-avinash.dayanand@intel.com/mbox/", "series": [ { "id": 23980, "url": "http://patchwork.ozlabs.org/api/series/23980/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=23980", "date": "2018-01-17T16:15:55", "name": "Enable queue channel and cloud filter support on i40evf", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/23980/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/862505/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/862505/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Authentication-Results": "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.136; helo=silver.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "Received": [ "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3zMH0W3708z9t4P\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 18 Jan 2018 06:17:31 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id B9A452DFE2;\n\tWed, 17 Jan 2018 19:17:29 +0000 (UTC)", "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 7xxkPh8OCXUj; Wed, 17 Jan 2018 19:17:28 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 2E6EB3028C;\n\tWed, 17 Jan 2018 19:17:28 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id AA7E51C156B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 17 Jan 2018 19:17:24 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id A744F893EC\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 17 Jan 2018 19:17:24 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id ppqask2G4mIn for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 17 Jan 2018 19:17:23 +0000 (UTC)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id DEBC989424\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 17 Jan 2018 19:17:23 +0000 (UTC)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t17 Jan 2018 11:17:23 -0800", "from avi-linux2.jf.intel.com ([10.166.244.156])\n\tby fmsmga005.fm.intel.com with ESMTP; 17 Jan 2018 11:17:23 -0800" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.46,372,1511856000\"; d=\"scan'208\";a=\"196382216\"", "From": "Avinash Dayanand <avinash.dayanand@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 17 Jan 2018 08:16:02 -0800", "Message-Id": "<20180117161607.49344-8-avinash.dayanand@intel.com>", "X-Mailer": "git-send-email 2.9.4", "In-Reply-To": "<20180117161607.49344-1-avinash.dayanand@intel.com>", "References": "<20180117161607.49344-1-avinash.dayanand@intel.com>", "Subject": "[Intel-wired-lan] [PATCH v2 next-queue 07/12] i40evf: Add support\n\tto configure bw via tc tool", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.24", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>", "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "From: Harshitha Ramamurthy <harshitha.ramamurthy@intel.com>\n\nThis patch adds support to configure bandwidth for the traffic\nclasses via tc tool. The required information is passed to the PF\nwhich is used in the process of setting up the traffic classes.\n\nSigned-off-by: Harshitha Ramamurthy <harshitha.ramamurthy@intel.com>\n---\n drivers/net/ethernet/intel/i40evf/i40evf.h | 1 +\n drivers/net/ethernet/intel/i40evf/i40evf_main.c | 66 +++++++++++++++++++++-\n .../net/ethernet/intel/i40evf/i40evf_virtchnl.c | 3 +\n 3 files changed, 67 insertions(+), 3 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40evf/i40evf.h b/drivers/net/ethernet/intel/i40evf/i40evf.h\nindex c8d68c8..150d676 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf.h\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf.h\n@@ -107,6 +107,7 @@ struct i40e_vsi {\n \n #define I40EVF_HKEY_ARRAY_SIZE ((I40E_VFQF_HKEY_MAX_INDEX + 1) * 4)\n #define I40EVF_HLUT_ARRAY_SIZE ((I40E_VFQF_HLUT_MAX_INDEX + 1) * 4)\n+#define I40EVF_MBPS_DIVISOR\t125000 /* divisor to convert to Mbps */\n \n /* MAX_MSIX_Q_VECTORS of these are allocated,\n * but we only use one per queue-specific vector.\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c\nindex 9d36553..91fff5f 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c\n@@ -2218,6 +2218,48 @@ void i40evf_free_all_rx_resources(struct i40evf_adapter *adapter)\n }\n \n /**\n+ * i40evf_validate_tx_bandwidth - validate the max tx bandwidth\n+ * @adapter: board private structure\n+ * @max_tx_rate: max tx bw for a tc\n+ **/\n+static int i40evf_validate_tx_bandwidth(struct i40evf_adapter *adapter,\n+\t\t\t\t\tu64 max_tx_rate)\n+{\n+\tint speed = 0, ret = 0;\n+\n+\tswitch (adapter->link_speed) {\n+\tcase I40E_LINK_SPEED_40GB:\n+\t\tspeed = 40000;\n+\t\tbreak;\n+\tcase I40E_LINK_SPEED_25GB:\n+\t\tspeed = 25000;\n+\t\tbreak;\n+\tcase I40E_LINK_SPEED_20GB:\n+\t\tspeed = 20000;\n+\t\tbreak;\n+\tcase I40E_LINK_SPEED_10GB:\n+\t\tspeed = 10000;\n+\t\tbreak;\n+\tcase I40E_LINK_SPEED_1GB:\n+\t\tspeed = 1000;\n+\t\tbreak;\n+\tcase I40E_LINK_SPEED_100MB:\n+\t\tspeed = 100;\n+\t\tbreak;\n+\tdefault:\n+\t\tbreak;\n+\t}\n+\n+\tif (max_tx_rate > speed) {\n+\t\tdev_err(&adapter->pdev->dev,\n+\t\t\t\"Invalid tx rate specified\\n\");\n+\t\tret = -EINVAL;\n+\t}\n+\n+\treturn ret;\n+}\n+\n+/**\n * i40evf_validate_channel_config - validate queue mapping info\n * @adapter: board private structure\n * @mqprio_qopt: queue parameters\n@@ -2229,7 +2271,10 @@ void i40evf_free_all_rx_resources(struct i40evf_adapter *adapter)\n static int i40evf_validate_ch_config(struct i40evf_adapter *adapter,\n \t\t\t\t struct tc_mqprio_qopt_offload *mqprio_qopt)\n {\n+\tu64 total_max_rate = 0;\n \tint i, num_qps = 0;\n+\tu64 tx_rate = 0;\n+\tint ret = 0;\n \n \tif (mqprio_qopt->qopt.num_tc > I40EVF_MAX_TRAFFIC_CLASS ||\n \t mqprio_qopt->qopt.num_tc < 1)\n@@ -2237,16 +2282,24 @@ static int i40evf_validate_ch_config(struct i40evf_adapter *adapter,\n \n \tfor (i = 0; i <= mqprio_qopt->qopt.num_tc - 1; i++) {\n \t\tif (!mqprio_qopt->qopt.count[i] ||\n-\t\t mqprio_qopt->min_rate[i] ||\n-\t\t mqprio_qopt->max_rate[i] ||\n \t\t mqprio_qopt->qopt.offset[i] != num_qps)\n \t\t\treturn -EINVAL;\n+\t\tif (mqprio_qopt->min_rate[i]) {\n+\t\t\tdev_err(&adapter->pdev->dev,\n+\t\t\t\t\"Invalid min tx rate (greater than 0) specified\\n\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t\t/*convert to Mbps */\n+\t\ttx_rate = div_u64(mqprio_qopt->max_rate[i],\n+\t\t\t\t I40EVF_MBPS_DIVISOR);\n+\t\ttotal_max_rate += tx_rate;\n \t\tnum_qps += mqprio_qopt->qopt.count[i];\n \t}\n \tif (num_qps > MAX_QUEUES)\n \t\treturn -EINVAL;\n \n-\treturn 0;\n+\tret = i40evf_validate_tx_bandwidth(adapter, total_max_rate);\n+\treturn ret;\n }\n \n /**\n@@ -2267,6 +2320,7 @@ static int __i40evf_setup_tc(struct net_device *netdev, void *type_data)\n \tstruct virtchnl_vf_resource *vfres = adapter->vf_res;\n \tu8 num_tc = 0, total_qps = 0;\n \tint ret = 0, netdev_tc = 0;\n+\tu64 max_tx_rate;\n \tu16 mode;\n \tint i;\n \n@@ -2314,6 +2368,12 @@ static int __i40evf_setup_tc(struct net_device *netdev, void *type_data)\n \t\t\t\tadapter->ch_config.ch_info[i].offset =\n \t\t\t\t\tmqprio_qopt->qopt.offset[i];\n \t\t\t\ttotal_qps += mqprio_qopt->qopt.count[i];\n+\t\t\t\tmax_tx_rate = mqprio_qopt->max_rate[i];\n+\t\t\t\t/* convert to Mbps */\n+\t\t\t\tmax_tx_rate = div_u64(max_tx_rate,\n+\t\t\t\t\t\t I40EVF_MBPS_DIVISOR);\n+\t\t\t\tadapter->ch_config.ch_info[i].max_tx_rate =\n+\t\t\t\t\tmax_tx_rate;\n \t\t\t} else {\n \t\t\t\tadapter->ch_config.ch_info[i].count = 1;\n \t\t\t\tadapter->ch_config.ch_info[i].offset = 0;\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c\nindex c4b3105..b5a509f 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c\n@@ -1003,6 +1003,9 @@ void i40evf_enable_channels(struct i40evf_adapter *adapter)\n \tfor (i = 0; i < vti->num_tc; i++) {\n \t\tvti->list[i].count = adapter->ch_config.ch_info[i].count;\n \t\tvti->list[i].offset = adapter->ch_config.ch_info[i].offset;\n+\t\tvti->list[i].pad = 0;\n+\t\tvti->list[i].max_tx_rate =\n+\t\t\t\tadapter->ch_config.ch_info[i].max_tx_rate;\n \t}\n \n \tadapter->ch_config.state = __I40EVF_TC_RUNNING;\n", "prefixes": [ "v2", "next-queue", "07/12" ] }