Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/806287/?format=api
{ "id": 806287, "url": "http://patchwork.ozlabs.org/api/patches/806287/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1503855330-84810-1-git-send-email-aviad.krawczyk@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": "<1503855330-84810-1-git-send-email-aviad.krawczyk@huawei.com>", "list_archive_url": null, "date": "2017-08-27T17:35:30", "name": "[net-next] net-next/hinic: fix comparison of a uint16_t type with -1", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "e6ca722661fbc02119355491a579e7eb88637843", "submitter": { "id": 71962, "url": "http://patchwork.ozlabs.org/api/people/71962/?format=api", "name": "Aviad Krawczyk", "email": "aviad.krawczyk@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/1503855330-84810-1-git-send-email-aviad.krawczyk@huawei.com/mbox/", "series": [ { "id": 35, "url": "http://patchwork.ozlabs.org/api/series/35/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=35", "date": "2017-08-27T17:35:30", "name": "[net-next] net-next/hinic: fix comparison of a uint16_t type with -1", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/35/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/806287/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/806287/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 3xgMX86kbjz9sMN\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon, 28 Aug 2017 03:36:40 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751264AbdH0RgZ (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tSun, 27 Aug 2017 13:36:25 -0400", "from szxga04-in.huawei.com ([45.249.212.190]:5468 \"EHLO\n\tszxga04-in.huawei.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751169AbdH0RgX (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Sun, 27 Aug 2017 13:36:23 -0400", "from 172.30.72.60 (EHLO DGGEMS405-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 DFZ81519; Mon, 28 Aug 2017 01:36:06 +0800 (CST)", "from SZV1000299114.huawei.com (10.162.197.60) by\n\tDGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP\n\tServer id 14.3.301.0; Mon, 28 Aug 2017 01:35:57 +0800" ], "From": "Aviad Krawczyk <aviad.krawczyk@huawei.com>", "To": "<davem@davemloft.net>", "CC": "<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,\n\t<zhaochen6@huawei.com>, <colin.king@canonical.com>,\n\t<dan.carpenter@oracle.com>, Aviad Krawczyk <aviad.krawczyk@huawei.com>", "Subject": "[PATCH net-next] net-next/hinic: fix comparison of a uint16_t type\n\twith -1", "Date": "Mon, 28 Aug 2017 01:35:30 +0800", "Message-ID": "<1503855330-84810-1-git-send-email-aviad.krawczyk@huawei.com>", "X-Mailer": "git-send-email 1.9.1", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Originating-IP": "[10.162.197.60]", "X-CFilter-Loop": "Reflected", "X-Mirapoint-Virus-RAPID-Raw": "score=unknown(0),\n\trefid=str=0001.0A090202.59A30307.0035, 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": "ddc818704fef245b0ffe1af65b948086", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "Remove the search for index of constant buffer size\n\nSigned-off-by: Aviad Krawczyk <aviad.krawczyk@huawei.com>\nSigned-off-by: Zhao Chen <zhaochen6@huawei.com>\n---\n drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c | 37 +-----------------------\n drivers/net/ethernet/huawei/hinic/hinic_hw_qp.h | 21 ++++++++++++++\n 2 files changed, 22 insertions(+), 36 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c\nindex 09dec6d..79b5674 100644\n--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c\n+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c\n@@ -69,31 +69,6 @@ struct hinic_dev_cap {\n \tu8 rsvd3[208];\n };\n \n-struct rx_buf_sz {\n-\tint idx;\n-\tsize_t sz;\n-};\n-\n-static struct rx_buf_sz rx_buf_sz_table[] = {\n-\t{0, 32},\n-\t{1, 64},\n-\t{2, 96},\n-\t{3, 128},\n-\t{4, 192},\n-\t{5, 256},\n-\t{6, 384},\n-\t{7, 512},\n-\t{8, 768},\n-\t{9, 1024},\n-\t{10, 1536},\n-\t{11, 2048},\n-\t{12, 3072},\n-\t{13, 4096},\n-\t{14, 8192},\n-\t{15, 16384},\n-\t{-1, -1},\n-};\n-\n /**\n * get_capability - convert device capabilities to NIC capabilities\n * @hwdev: the HW device to set and convert device capabilities for\n@@ -330,7 +305,6 @@ static int set_hw_ioctxt(struct hinic_hwdev *hwdev, unsigned int rq_depth,\n \tstruct hinic_cmd_hw_ioctxt hw_ioctxt;\n \tstruct pci_dev *pdev = hwif->pdev;\n \tstruct hinic_pfhwdev *pfhwdev;\n-\tint i;\n \n \tif (!HINIC_IS_PF(hwif) && !HINIC_IS_PPF(hwif)) {\n \t\tdev_err(&pdev->dev, \"Unsupported PCI Function type\\n\");\n@@ -344,16 +318,7 @@ static int set_hw_ioctxt(struct hinic_hwdev *hwdev, unsigned int rq_depth,\n \n \thw_ioctxt.rq_depth = ilog2(rq_depth);\n \n-\tfor (i = 0; ; i++) {\n-\t\tif ((rx_buf_sz_table[i].sz == HINIC_RX_BUF_SZ) ||\n-\t\t (rx_buf_sz_table[i].sz == -1)) {\n-\t\t\thw_ioctxt.rx_buf_sz_idx = rx_buf_sz_table[i].idx;\n-\t\t\tbreak;\n-\t\t}\n-\t}\n-\n-\tif (hw_ioctxt.rx_buf_sz_idx == -1)\n-\t\treturn -EINVAL;\n+\thw_ioctxt.rx_buf_sz_idx = HINIC_RX_BUF_SZ_IDX;\n \n \thw_ioctxt.sq_depth = ilog2(sq_depth);\n \ndiff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_qp.h b/drivers/net/ethernet/huawei/hinic/hinic_hw_qp.h\nindex e642a8a..df729a1 100644\n--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_qp.h\n+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_qp.h\n@@ -53,7 +53,9 @@\n #define HINIC_SQ_DEPTH SZ_4K\n #define HINIC_RQ_DEPTH SZ_4K\n \n+/* In any change to HINIC_RX_BUF_SZ, HINIC_RX_BUF_SZ_IDX must be changed */\n #define HINIC_RX_BUF_SZ 2048\n+#define HINIC_RX_BUF_SZ_IDX\t\t\tHINIC_RX_BUF_SZ_2048_IDX\n \n #define HINIC_MIN_TX_WQE_SIZE(wq) \\\n \t\tALIGN(HINIC_SQ_WQE_SIZE(1), (wq)->wqebb_size)\n@@ -61,6 +63,25 @@\n #define HINIC_MIN_TX_NUM_WQEBBS(sq) \\\n \t\t(HINIC_MIN_TX_WQE_SIZE((sq)->wq) / (sq)->wq->wqebb_size)\n \n+enum hinic_rx_buf_sz_idx {\n+\tHINIC_RX_BUF_SZ_32_IDX,\n+\tHINIC_RX_BUF_SZ_64_IDX,\n+\tHINIC_RX_BUF_SZ_96_IDX,\n+\tHINIC_RX_BUF_SZ_128_IDX,\n+\tHINIC_RX_BUF_SZ_192_IDX,\n+\tHINIC_RX_BUF_SZ_256_IDX,\n+\tHINIC_RX_BUF_SZ_384_IDX,\n+\tHINIC_RX_BUF_SZ_512_IDX,\n+\tHINIC_RX_BUF_SZ_768_IDX,\n+\tHINIC_RX_BUF_SZ_1024_IDX,\n+\tHINIC_RX_BUF_SZ_1536_IDX,\n+\tHINIC_RX_BUF_SZ_2048_IDX,\n+\tHINIC_RX_BUF_SZ_3072_IDX,\n+\tHINIC_RX_BUF_SZ_4096_IDX,\n+\tHINIC_RX_BUF_SZ_8192_IDX,\n+\tHINIC_RX_BUF_SZ_16384_IDX,\n+};\n+\n struct hinic_sq {\n \tstruct hinic_hwif *hwif;\n \n", "prefixes": [ "net-next" ] }