Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/57845/?format=api
http://patches.dpdk.org/api/patches/57845/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1566568031-45991-4-git-send-email-xavier.huwei@huawei.com/", "project": { "id": 1, "url": "http://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": "<1566568031-45991-4-git-send-email-xavier.huwei@huawei.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1566568031-45991-4-git-send-email-xavier.huwei@huawei.com", "date": "2019-08-23T13:46:52", "name": "[03/22] net/hns3: register hns3 PMD driver", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "b0e063009dab900ffb048483d734f26954c90670", "submitter": { "id": 1405, "url": "http://patches.dpdk.org/api/people/1405/?format=api", "name": "Wei Hu (Xavier)", "email": "xavier.huwei@huawei.com" }, "delegate": { "id": 319, "url": "http://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1566568031-45991-4-git-send-email-xavier.huwei@huawei.com/mbox/", "series": [ { "id": 6114, "url": "http://patches.dpdk.org/api/series/6114/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=6114", "date": "2019-08-23T13:46:49", "name": "add hns3 ethernet PMD driver", "version": 1, "mbox": "http://patches.dpdk.org/series/6114/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/57845/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/57845/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 AC9D01BFD2;\n\tFri, 23 Aug 2019 15:49:43 +0200 (CEST)", "from huawei.com (szxga07-in.huawei.com [45.249.212.35])\n\tby dpdk.org (Postfix) with ESMTP id 407141BFC1\n\tfor <dev@dpdk.org>; Fri, 23 Aug 2019 15:49:33 +0200 (CEST)", "from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58])\n\tby Forcepoint Email with ESMTP id 91F16497B0914D1292C6;\n\tFri, 23 Aug 2019 21:49:31 +0800 (CST)", "from localhost.localdomain (10.67.212.132) by\n\tDGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP\n\tServer id 14.3.439.0; Fri, 23 Aug 2019 21:49:25 +0800" ], "From": "\"Wei Hu (Xavier)\" <xavier.huwei@huawei.com>", "To": "<dev@dpdk.org>", "CC": "<linuxarm@huawei.com>, <xavier_huwei@163.com>, <liudongdong3@huawei.com>,\n\t<forest.zhouchang@huawei.com>", "Date": "Fri, 23 Aug 2019 21:46:52 +0800", "Message-ID": "<1566568031-45991-4-git-send-email-xavier.huwei@huawei.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1566568031-45991-1-git-send-email-xavier.huwei@huawei.com>", "References": "<1566568031-45991-1-git-send-email-xavier.huwei@huawei.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Originating-IP": "[10.67.212.132]", "X-CFilter-Loop": "Reflected", "Subject": "[dpdk-dev] [PATCH 03/22] net/hns3: register hns3 PMD driver", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "This patch registers hns3 PMD driver and adds the definition for log\ninterfaces.\n\nSigned-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>\nSigned-off-by: Chunsong Feng <fengchunsong@huawei.com>\nSigned-off-by: Min Hu (Connor) <humin29@huawei.com>\nSigned-off-by: Hao Chen <chenhao164@huawei.com>\nSigned-off-by: Huisong Li <lihuisong@huawei.com>\n---\n drivers/net/hns3/hns3_ethdev.c | 141 +++++++++++++++++++++++++++++++++++++++++\n drivers/net/hns3/hns3_logs.h | 34 ++++++++++\n 2 files changed, 175 insertions(+)\n create mode 100644 drivers/net/hns3/hns3_ethdev.c\n create mode 100644 drivers/net/hns3/hns3_logs.h", "diff": "diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c\nnew file mode 100644\nindex 0000000..0587a9c\n--- /dev/null\n+++ b/drivers/net/hns3/hns3_ethdev.c\n@@ -0,0 +1,141 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2018-2019 Hisilicon Limited.\n+ */\n+\n+#include <errno.h>\n+#include <stdarg.h>\n+#include <stdbool.h>\n+#include <stdio.h>\n+#include <stdint.h>\n+#include <string.h>\n+#include <sys/queue.h>\n+#include <inttypes.h>\n+#include <unistd.h>\n+#include <arpa/inet.h>\n+#include <rte_alarm.h>\n+#include <rte_atomic.h>\n+#include <rte_bus_pci.h>\n+#include <rte_byteorder.h>\n+#include <rte_common.h>\n+#include <rte_cycles.h>\n+#include <rte_debug.h>\n+#include <rte_dev.h>\n+#include <rte_eal.h>\n+#include <rte_ether.h>\n+#include <rte_ethdev_driver.h>\n+#include <rte_ethdev_pci.h>\n+#include <rte_interrupts.h>\n+#include <rte_io.h>\n+#include <rte_log.h>\n+#include <rte_pci.h>\n+\n+#include \"hns3_ethdev.h\"\n+#include \"hns3_logs.h\"\n+#include \"hns3_regs.h\"\n+\n+int hns3_logtype_init;\n+int hns3_logtype_driver;\n+\n+static void\n+hns3_dev_close(struct rte_eth_dev *eth_dev)\n+{\n+\tstruct hns3_adapter *hns = eth_dev->data->dev_private;\n+\tstruct hns3_hw *hw = &hns->hw;\n+\n+\thw->adapter_state = HNS3_NIC_CLOSED;\n+}\n+\n+static const struct eth_dev_ops hns3_eth_dev_ops = {\n+\t.dev_close = hns3_dev_close,\n+};\n+\n+static int\n+hns3_dev_init(struct rte_eth_dev *eth_dev)\n+{\n+\tstruct rte_device *dev = eth_dev->device;\n+\tstruct rte_pci_device *pci_dev = RTE_DEV_TO_PCI(dev);\n+\tstruct hns3_adapter *hns = eth_dev->data->dev_private;\n+\tstruct hns3_hw *hw = &hns->hw;\n+\tuint16_t device_id = pci_dev->id.device_id;\n+\tint ret;\n+\n+\tPMD_INIT_FUNC_TRACE();\n+\n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n+\t\treturn 0;\n+\n+\teth_dev->dev_ops = &hns3_eth_dev_ops;\n+\trte_eth_copy_pci_info(eth_dev, pci_dev);\n+\n+\thns->is_vf = false;\n+\thw->data = eth_dev->data;\n+\thw->adapter_state = HNS3_NIC_INITIALIZED;\n+\n+\treturn 0;\n+}\n+\n+static int\n+hns3_dev_uninit(struct rte_eth_dev *eth_dev)\n+{\n+\tstruct hns3_adapter *hns = eth_dev->data->dev_private;\n+\tstruct hns3_hw *hw = &hns->hw;\n+\n+\tPMD_INIT_FUNC_TRACE();\n+\n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n+\t\treturn -EPERM;\n+\n+\teth_dev->dev_ops = NULL;\n+\teth_dev->rx_pkt_burst = NULL;\n+\teth_dev->tx_pkt_burst = NULL;\n+\tif (hw->adapter_state < HNS3_NIC_CLOSING)\n+\t\thns3_dev_close(eth_dev);\n+\n+\thw->adapter_state = HNS3_NIC_REMOVED;\n+\treturn 0;\n+}\n+\n+static int\n+eth_hns3_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n+\t\t struct rte_pci_device *pci_dev)\n+{\n+\treturn rte_eth_dev_pci_generic_probe(pci_dev,\n+\t\t\t\t\t sizeof(struct hns3_adapter),\n+\t\t\t\t\t hns3_dev_init);\n+}\n+\n+static int\n+eth_hns3_pci_remove(struct rte_pci_device *pci_dev)\n+{\n+\treturn rte_eth_dev_pci_generic_remove(pci_dev, hns3_dev_uninit);\n+}\n+\n+static const struct rte_pci_id pci_id_hns3_map[] = {\n+\t{ RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_GE) },\n+\t{ RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_25GE) },\n+\t{ RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_25GE_RDMA) },\n+\t{ RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_50GE_RDMA) },\n+\t{ RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_100G_RDMA_MACSEC) },\n+\t{ .vendor_id = 0, /* sentinel */ },\n+};\n+\n+static struct rte_pci_driver rte_hns3_pmd = {\n+\t.id_table = pci_id_hns3_map,\n+\t.drv_flags = RTE_PCI_DRV_NEED_MAPPING,\n+\t.probe = eth_hns3_pci_probe,\n+\t.remove = eth_hns3_pci_remove,\n+};\n+\n+RTE_PMD_REGISTER_PCI(net_hns3, rte_hns3_pmd);\n+RTE_PMD_REGISTER_PCI_TABLE(net_hns3, pci_id_hns3_map);\n+RTE_PMD_REGISTER_KMOD_DEP(net_hns3, \"* igb_uio | vfio-pci\");\n+\n+RTE_INIT(hns3_init_log)\n+{\n+\thns3_logtype_init = rte_log_register(\"pmd.net.hns3.init\");\n+\tif (hns3_logtype_init >= 0)\n+\t\trte_log_set_level(hns3_logtype_init, RTE_LOG_NOTICE);\n+\thns3_logtype_driver = rte_log_register(\"pmd.net.hns3.driver\");\n+\tif (hns3_logtype_driver >= 0)\n+\t\trte_log_set_level(hns3_logtype_driver, RTE_LOG_NOTICE);\n+}\ndiff --git a/drivers/net/hns3/hns3_logs.h b/drivers/net/hns3/hns3_logs.h\nnew file mode 100644\nindex 0000000..8d069a2\n--- /dev/null\n+++ b/drivers/net/hns3/hns3_logs.h\n@@ -0,0 +1,34 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2018-2019 Hisilicon Limited.\n+ */\n+\n+#ifndef _HNS3_LOGS_H_\n+#define _HNS3_LOGS_H_\n+\n+extern int hns3_logtype_init;\n+#define PMD_INIT_LOG(level, fmt, args...) \\\n+\trte_log(RTE_LOG_ ## level, hns3_logtype_init, \"%s(): \" fmt \"\\n\", \\\n+\t\t__func__, ##args)\n+#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, \" >>\")\n+\n+extern int hns3_logtype_driver;\n+#define PMD_DRV_LOG_RAW(hw, level, fmt, args...) \\\n+\trte_log(level, hns3_logtype_driver, \"%s %s(): \" fmt, \\\n+\t\t(hw)->data->name, __func__, ## args)\n+\n+#define hns3_err(hw, fmt, args...) \\\n+\tPMD_DRV_LOG_RAW(hw, RTE_LOG_ERR, fmt \"\\n\", ## args)\n+\n+#define hns3_warn(hw, fmt, args...) \\\n+\t PMD_DRV_LOG_RAW(hw, RTE_LOG_WARNING, fmt \"\\n\", ## args)\n+\n+#define hns3_notice(hw, fmt, args...) \\\n+\tPMD_DRV_LOG_RAW(hw, RTE_LOG_NOTICE, fmt \"\\n\", ## args)\n+\n+#define hns3_info(hw, fmt, args...) \\\n+\t PMD_DRV_LOG_RAW(hw, RTE_LOG_INFO, fmt \"\\n\", ## args)\n+\n+#define hns3_dbg(hw, fmt, args...) \\\n+\t PMD_DRV_LOG_RAW(hw, RTE_LOG_DEBUG, fmt \"\\n\", ## args)\n+\n+#endif /* _HNS3_LOGS_H_ */\n", "prefixes": [ "03/22" ] }{ "id": 57845, "url": "