Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/860165/?format=api
{ "id": 860165, "url": "http://patchwork.ozlabs.org/api/patches/860165/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180112193251.11739-7-jeffrey.t.kirsher@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": "<20180112193251.11739-7-jeffrey.t.kirsher@intel.com>", "list_archive_url": null, "date": "2018-01-12T19:32:46", "name": "[07/12] i40evf: Add support to configure bw via tc tool", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "2308aa1b0042e0ec318340638b8fbdb78e54ec2f", "submitter": { "id": 473, "url": "http://patchwork.ozlabs.org/api/people/473/?format=api", "name": "Kirsher, Jeffrey T", "email": "jeffrey.t.kirsher@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/20180112193251.11739-7-jeffrey.t.kirsher@intel.com/mbox/", "series": [ { "id": 23043, "url": "http://patchwork.ozlabs.org/api/series/23043/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=23043", "date": "2018-01-12T19:32:45", "name": "[01/12] i40evf: Fix link up issue when queues are disabled", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/23043/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/860165/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/860165/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.133; helo=hemlock.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "Received": [ "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\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 3zJCZf6bDdz9sQm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 13 Jan 2018 06:32:58 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 68E9489EFD;\n\tFri, 12 Jan 2018 19:32:57 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id jx3HWdt6YPUb; Fri, 12 Jan 2018 19:32:54 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id A5F9F89F0F;\n\tFri, 12 Jan 2018 19:32:54 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id B0F481C002D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 12 Jan 2018 19:32:51 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id ABD6189E91\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 12 Jan 2018 19:32:51 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 2Yv5pBa6qNVo for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 12 Jan 2018 19:32:48 +0000 (UTC)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id B35EA89EFD\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 12 Jan 2018 19:32:48 +0000 (UTC)", "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t12 Jan 2018 11:32:47 -0800", "from jtkirshe-nuc.jf.intel.com ([134.134.177.151])\n\tby orsmga003.jf.intel.com with ESMTP; 12 Jan 2018 11:32:47 -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,350,1511856000\"; d=\"scan'208\";a=\"19654880\"", "From": "Jeff Kirsher <jeffrey.t.kirsher@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Fri, 12 Jan 2018 11:32:46 -0800", "Message-Id": "<20180112193251.11739-7-jeffrey.t.kirsher@intel.com>", "X-Mailer": "git-send-email 2.14.3", "In-Reply-To": "<20180112193251.11739-1-jeffrey.t.kirsher@intel.com>", "References": "<20180112193251.11739-1-jeffrey.t.kirsher@intel.com>", "Subject": "[Intel-wired-lan] [PATCH 07/12] i40evf: Add support to configure bw\n\tvia 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 c8d68c8d2c33..150d676ab87c 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 9d365537372c..91fff5f285e7 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c\n@@ -2217,6 +2217,48 @@ void i40evf_free_all_rx_resources(struct i40evf_adapter *adapter)\n \t\t\ti40evf_free_rx_resources(&adapter->rx_rings[i]);\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@@ -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 8329f37f431e..76bce1a5c20d 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": [ "07/12" ] }