Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/816816/?format=api
{ "id": 816816, "url": "http://patchwork.ozlabs.org/api/patches/816816/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1505992913-107256-5-git-send-email-linyunsheng@huawei.com/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api", "name": "Linux network development", "link_name": "netdev", "list_id": "netdev.vger.kernel.org", "list_email": "netdev@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1505992913-107256-5-git-send-email-linyunsheng@huawei.com>", "list_archive_url": null, "date": "2017-09-21T11:21:47", "name": "[net-next,04/10] net: hns3: Add support for port shaper setting in TM module", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "e002f558b704641981dc4fea1e4bd4ca83269679", "submitter": { "id": 71804, "url": "http://patchwork.ozlabs.org/api/people/71804/?format=api", "name": "Yunsheng Lin", "email": "linyunsheng@huawei.com" }, "delegate": { "id": 34, "url": "http://patchwork.ozlabs.org/api/users/34/?format=api", "username": "davem", "first_name": "David", "last_name": "Miller", "email": "davem@davemloft.net" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/1505992913-107256-5-git-send-email-linyunsheng@huawei.com/mbox/", "series": [ { "id": 4360, "url": "http://patchwork.ozlabs.org/api/series/4360/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=4360", "date": "2017-09-21T11:21:52", "name": "Add support for DCB feature in hns3 driver", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/4360/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/816816/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/816816/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<netdev-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xyZ5W1h4qz9t42\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 21 Sep 2017 21:24:47 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751821AbdIULWX (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 21 Sep 2017 07:22:23 -0400", "from szxga04-in.huawei.com ([45.249.212.190]:6955 \"EHLO\n\tszxga04-in.huawei.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751793AbdIULWV (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Thu, 21 Sep 2017 07:22:21 -0400", "from 172.30.72.60 (EHLO DGGEMS408-HUB.china.huawei.com)\n\t([172.30.72.60])\n\tby dggrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued)\n\twith ESMTP id DHR44637; Thu, 21 Sep 2017 19:22:19 +0800 (CST)", "from localhost.localdomain (10.67.212.75) by\n\tDGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP\n\tServer id 14.3.301.0; Thu, 21 Sep 2017 19:22:08 +0800" ], "From": "Yunsheng Lin <linyunsheng@huawei.com>", "To": "<davem@davemloft.net>", "CC": "<huangdaode@hisilicon.com>, <xuwei5@hisilicon.com>,\n\t<liguozhu@hisilicon.com>, <Yisen.Zhuang@huawei.com>,\n\t<gabriele.paoloni@huawei.com>, <john.garry@huawei.com>,\n\t<linuxarm@huawei.com>, <yisen.zhuang@huawei.com>,\n\t<salil.mehta@huawei.com>, <lipeng321@huawei.com>,\n\t<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>", "Subject": "[PATCH net-next 04/10] net: hns3: Add support for port shaper\n\tsetting in TM module", "Date": "Thu, 21 Sep 2017 19:21:47 +0800", "Message-ID": "<1505992913-107256-5-git-send-email-linyunsheng@huawei.com>", "X-Mailer": "git-send-email 1.9.1", "In-Reply-To": "<1505992913-107256-1-git-send-email-linyunsheng@huawei.com>", "References": "<1505992913-107256-1-git-send-email-linyunsheng@huawei.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Originating-IP": "[10.67.212.75]", "X-CFilter-Loop": "Reflected", "X-Mirapoint-Virus-RAPID-Raw": "score=unknown(0),\n\trefid=str=0001.0A090204.59C3A0EB.0265, ss=1, re=0.000, recu=0.000,\n\treip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0,\n\tso=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32", "X-Mirapoint-Loop-Id": "71e169950daaa77096248d8f216f8cb8", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "This patch add a tm_port_shaper cmd and set port shaper\nto HCLGE_ETHER_MAX_RATE on TM initialization process.\n\nSigned-off-by: Yunsheng Lin <linyunsheng@huawei.com>\n---\n .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 33 ++++++++++++++++++++++\n .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h | 4 +++\n 2 files changed, 37 insertions(+)", "diff": "diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c\nindex 0b4b5d9..33090d0 100644\n--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c\n+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c\n@@ -301,6 +301,35 @@ static int hclge_tm_pg_shapping_cfg(struct hclge_dev *hdev,\n \treturn hclge_cmd_send(&hdev->hw, &desc, 1);\n }\n \n+static int hclge_tm_port_shaper_cfg(struct hclge_dev *hdev)\n+{\n+\tstruct hclge_port_shapping_cmd *shap_cfg_cmd;\n+\tstruct hclge_desc desc;\n+\tu8 ir_u, ir_b, ir_s;\n+\tint ret;\n+\n+\tret = hclge_shaper_para_calc(HCLGE_ETHER_MAX_RATE,\n+\t\t\t\t HCLGE_SHAPER_LVL_PORT,\n+\t\t\t\t &ir_b, &ir_u, &ir_s);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\thclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_TM_PORT_SHAPPING, false);\n+\tshap_cfg_cmd = (struct hclge_port_shapping_cmd *)desc.data;\n+\n+\thclge_tm_set_field(shap_cfg_cmd->port_shapping_para, IR_B, ir_b);\n+\thclge_tm_set_field(shap_cfg_cmd->port_shapping_para, IR_U, ir_u);\n+\thclge_tm_set_field(shap_cfg_cmd->port_shapping_para, IR_S, ir_s);\n+\thclge_tm_set_field(shap_cfg_cmd->port_shapping_para,\n+\t\t\t BS_B, HCLGE_SHAPER_BS_U_DEF);\n+\thclge_tm_set_field(shap_cfg_cmd->port_shapping_para,\n+\t\t\t BS_S, HCLGE_SHAPER_BS_S_DEF);\n+\tshap_cfg_cmd->port_shapping_para =\n+\t\t\t\tcpu_to_le32(shap_cfg_cmd->port_shapping_para);\n+\n+\treturn hclge_cmd_send(&hdev->hw, &desc, 1);\n+}\n+\n static int hclge_tm_pri_shapping_cfg(struct hclge_dev *hdev,\n \t\t\t\t enum hclge_shap_bucket bucket, u8 pri_id,\n \t\t\t\t u8 ir_b, u8 ir_u, u8 ir_s,\n@@ -864,6 +893,10 @@ static int hclge_tm_shaper_cfg(struct hclge_dev *hdev)\n {\n \tint ret;\n \n+\tret = hclge_tm_port_shaper_cfg(hdev);\n+\tif (ret)\n+\t\treturn ret;\n+\n \tret = hclge_tm_pg_shaper_cfg(hdev);\n \tif (ret)\n \t\treturn ret;\ndiff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h\nindex 8ecd83c..19a01e4 100644\n--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h\n+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h\n@@ -99,6 +99,10 @@ struct hclge_pfc_en_cmd {\n \tu8 pri_en_bitmap;\n };\n \n+struct hclge_port_shapping_cmd {\n+\t__le32 port_shapping_para;\n+};\n+\n #define hclge_tm_set_field(dest, string, val) \\\n \t\t\thnae_set_field((dest), (HCLGE_TM_SHAP_##string##_MSK), \\\n \t\t\t\t (HCLGE_TM_SHAP_##string##_LSH), val)\n", "prefixes": [ "net-next", "04/10" ] }