get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/55449/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 55449,
    "url": "http://patches.dpdk.org/api/patches/55449/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/ba6edfc93a7c6a680b5b5c4170cdc0168f6c442e.1561620219.git.xuanziyang2@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": "<ba6edfc93a7c6a680b5b5c4170cdc0168f6c442e.1561620219.git.xuanziyang2@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/ba6edfc93a7c6a680b5b5c4170cdc0168f6c442e.1561620219.git.xuanziyang2@huawei.com",
    "date": "2019-06-27T08:18:20",
    "name": "[v6,11/15] net/hinic: add hinic PMD build and doc files",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "82995570d4d88270fa59f154bd89582e948f5a01",
    "submitter": {
        "id": 1321,
        "url": "http://patches.dpdk.org/api/people/1321/?format=api",
        "name": "Ziyang Xuan",
        "email": "xuanziyang2@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/ba6edfc93a7c6a680b5b5c4170cdc0168f6c442e.1561620219.git.xuanziyang2@huawei.com/mbox/",
    "series": [
        {
            "id": 5191,
            "url": "http://patches.dpdk.org/api/series/5191/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5191",
            "date": "2019-06-27T08:10:12",
            "name": "A new net PMD - hinic",
            "version": 6,
            "mbox": "http://patches.dpdk.org/series/5191/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/55449/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/55449/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 DE80F2C12;\n\tThu, 27 Jun 2019 10:06:36 +0200 (CEST)",
            "from huawei.com (szxga06-in.huawei.com [45.249.212.32])\n\tby dpdk.org (Postfix) with ESMTP id D91662C12\n\tfor <dev@dpdk.org>; Thu, 27 Jun 2019 10:06:34 +0200 (CEST)",
            "from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59])\n\tby Forcepoint Email with ESMTP id C52F7290CBDD125D9905\n\tfor <dev@dpdk.org>; Thu, 27 Jun 2019 16:06:32 +0800 (CST)",
            "from tester_149.localdomain (10.175.119.39) by\n\tDGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP\n\tServer id 14.3.439.0; Thu, 27 Jun 2019 16:06:22 +0800"
        ],
        "From": "Ziyang Xuan <xuanziyang2@huawei.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<ferruh.yigit@intel.com>, <cloud.wangxiaoyun@huawei.com>,\n\t<shahar.belkar@huawei.com>, <luoxianjun@huawei.com>,\n\t<tanya.brokhman@huawei.com>, Ziyang Xuan <xuanziyang2@huawei.com>",
        "Date": "Thu, 27 Jun 2019 16:18:20 +0800",
        "Message-ID": "<ba6edfc93a7c6a680b5b5c4170cdc0168f6c442e.1561620219.git.xuanziyang2@huawei.com>",
        "X-Mailer": "git-send-email 2.18.0",
        "In-Reply-To": "<cover.1561620219.git.xuanziyang2@huawei.com>",
        "References": "<cover.1561620219.git.xuanziyang2@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.175.119.39]",
        "X-CFilter-Loop": "Reflected",
        "Subject": "[dpdk-dev] [PATCH v6 11/15] net/hinic: add hinic PMD build and doc\n\tfiles",
        "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": "Add build and doc files along with hinic_pmd_ethdev.c\nwhich just includes PMD register and log initialization\nfor compilation.\n\nSigned-off-by: Ziyang Xuan <xuanziyang2@huawei.com>\n---\n MAINTAINERS                                  |   8 +\n config/common_base                           |   5 +\n config/common_linux                          |   5 +\n config/defconfig_arm-armv7a-linuxapp-gcc     |   1 +\n config/defconfig_i686-native-linuxapp-gcc    |   5 +\n config/defconfig_i686-native-linuxapp-icc    |   5 +\n config/defconfig_ppc_64-power8-linuxapp-gcc  |   1 +\n config/defconfig_x86_64-native-linuxapp-icc  |   5 +\n config/defconfig_x86_x32-native-linuxapp-gcc |   5 +\n doc/guides/nics/features/hinic.ini           |  37 +++\n doc/guides/nics/hinic.rst                    |  58 +++++\n doc/guides/rel_notes/release_19_08.rst       |   6 +\n drivers/net/Makefile                         |   1 +\n drivers/net/hinic/Makefile                   |  46 ++++\n drivers/net/hinic/base/meson.build           |  24 ++\n drivers/net/hinic/hinic_pmd_ethdev.c         | 229 +++++++++++++++++++\n drivers/net/hinic/hinic_pmd_ethdev.h         |  71 ++++++\n drivers/net/hinic/meson.build                |  11 +\n drivers/net/hinic/rte_pmd_hinic_version.map  |   4 +\n drivers/net/meson.build                      |   1 +\n mk/rte.app.mk                                |   1 +\n 21 files changed, 529 insertions(+)\n create mode 100644 doc/guides/nics/features/hinic.ini\n create mode 100644 doc/guides/nics/hinic.rst\n create mode 100644 drivers/net/hinic/Makefile\n create mode 100644 drivers/net/hinic/base/meson.build\n create mode 100644 drivers/net/hinic/hinic_pmd_ethdev.c\n create mode 100644 drivers/net/hinic/hinic_pmd_ethdev.h\n create mode 100644 drivers/net/hinic/meson.build\n create mode 100644 drivers/net/hinic/rte_pmd_hinic_version.map",
    "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex 0c3b48920..24431832a 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -595,6 +595,14 @@ F: drivers/net/enic/\n F: doc/guides/nics/enic.rst\n F: doc/guides/nics/features/enic.ini\n \n+Huawei hinic\n+M: Ziyang Xuan <xuanziyang2@huawei.com>\n+M: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>\n+M: Guoyang Zhou <zhouguoyang@huawei.com>\n+F: drivers/net/hinic/\n+F: doc/guides/nics/hinic.rst\n+F: doc/guides/nics/features/hinic.ini\n+\n Intel e1000\n M: Wenzhuo Lu <wenzhuo.lu@intel.com>\n T: git://dpdk.org/next/dpdk-next-net-intel\ndiff --git a/config/common_base b/config/common_base\nindex fa1ae249a..e700bf1e7 100644\n--- a/config/common_base\n+++ b/config/common_base\n@@ -276,6 +276,11 @@ CONFIG_RTE_LIBRTE_E1000_DEBUG_TX=n\n CONFIG_RTE_LIBRTE_E1000_DEBUG_TX_FREE=n\n CONFIG_RTE_LIBRTE_E1000_PF_DISABLE_STRIP_CRC=n\n \n+#\n+# Compile burst-oriented HINIC PMD driver\n+#\n+CONFIG_RTE_LIBRTE_HINIC_PMD=n\n+\n #\n # Compile burst-oriented IXGBE PMD driver\n #\ndiff --git a/config/common_linux b/config/common_linux\nindex 87514fe4f..6e252553a 100644\n--- a/config/common_linux\n+++ b/config/common_linux\n@@ -58,3 +58,8 @@ CONFIG_RTE_LIBRTE_PMD_DPAA2_QDMA_RAWDEV=y\n # NXP ENETC PMD Driver\n #\n CONFIG_RTE_LIBRTE_ENETC_PMD=y\n+\n+#\n+# HINIC PMD driver\n+#\n+CONFIG_RTE_LIBRTE_HINIC_PMD=y\ndiff --git a/config/defconfig_arm-armv7a-linuxapp-gcc b/config/defconfig_arm-armv7a-linuxapp-gcc\nindex c9509b274..562439c0b 100644\n--- a/config/defconfig_arm-armv7a-linuxapp-gcc\n+++ b/config/defconfig_arm-armv7a-linuxapp-gcc\n@@ -54,3 +54,4 @@ CONFIG_RTE_LIBRTE_QEDE_PMD=n\n CONFIG_RTE_LIBRTE_SFC_EFX_PMD=n\n CONFIG_RTE_LIBRTE_AVP_PMD=n\n CONFIG_RTE_LIBRTE_NFP_PMD=n\n+CONFIG_RTE_LIBRTE_HINIC_PMD=n\ndiff --git a/config/defconfig_i686-native-linuxapp-gcc b/config/defconfig_i686-native-linuxapp-gcc\nindex 0340c84cf..07fc5f880 100644\n--- a/config/defconfig_i686-native-linuxapp-gcc\n+++ b/config/defconfig_i686-native-linuxapp-gcc\n@@ -54,3 +54,8 @@ CONFIG_RTE_LIBRTE_NFP_PMD=n\n \n # 32-bit doesn't break up memory in lists, but does have VA allocation limit\n CONFIG_RTE_MAX_MEM_MB=2048\n+\n+#\n+# HINIC PMD is not supported on 32-bit\n+#\n+CONFIG_RTE_LIBRTE_HINIC_PMD=n\ndiff --git a/config/defconfig_i686-native-linuxapp-icc b/config/defconfig_i686-native-linuxapp-icc\nindex 34a55fd18..34f34d5ce 100644\n--- a/config/defconfig_i686-native-linuxapp-icc\n+++ b/config/defconfig_i686-native-linuxapp-icc\n@@ -54,3 +54,8 @@ CONFIG_RTE_LIBRTE_NFP_PMD=n\n \n # 32-bit doesn't break up memory in lists, but does have VA allocation limit\n CONFIG_RTE_MAX_MEM_MB=2048\n+\n+#\n+# HINIC PMD is not supported on 32-bit\n+#\n+CONFIG_RTE_LIBRTE_HINIC_PMD=n\ndiff --git a/config/defconfig_ppc_64-power8-linuxapp-gcc b/config/defconfig_ppc_64-power8-linuxapp-gcc\nindex 7e248b755..cec434563 100644\n--- a/config/defconfig_ppc_64-power8-linuxapp-gcc\n+++ b/config/defconfig_ppc_64-power8-linuxapp-gcc\n@@ -56,3 +56,4 @@ CONFIG_RTE_LIBRTE_ENIC_PMD=n\n CONFIG_RTE_LIBRTE_FM10K_PMD=n\n CONFIG_RTE_LIBRTE_SFC_EFX_PMD=n\n CONFIG_RTE_LIBRTE_AVP_PMD=n\n+CONFIG_RTE_LIBRTE_HINIC_PMD=n\ndiff --git a/config/defconfig_x86_64-native-linuxapp-icc b/config/defconfig_x86_64-native-linuxapp-icc\nindex d3ecae475..d82b9229d 100644\n--- a/config/defconfig_x86_64-native-linuxapp-icc\n+++ b/config/defconfig_x86_64-native-linuxapp-icc\n@@ -17,3 +17,8 @@ CONFIG_RTE_TOOLCHAIN_ICC=y\n # Solarflare PMD build is not supported using icc toolchain\n #\n CONFIG_RTE_LIBRTE_SFC_EFX_PMD=n\n+\n+#\n+# HINIC PMD build is not supported using icc toolchain\n+#\n+CONFIG_RTE_LIBRTE_HINIC_PMD=n\ndiff --git a/config/defconfig_x86_x32-native-linuxapp-gcc b/config/defconfig_x86_x32-native-linuxapp-gcc\nindex 14445abaa..bcc72086a 100644\n--- a/config/defconfig_x86_x32-native-linuxapp-gcc\n+++ b/config/defconfig_x86_x32-native-linuxapp-gcc\n@@ -34,3 +34,8 @@ CONFIG_RTE_LIBRTE_NFP_PMD=n\n \n # 32-bit doesn't break up memory in lists, but does have VA allocation limit\n CONFIG_RTE_MAX_MEM_MB=2048\n+\n+#\n+# HINIC PMD is not supported on 32-bit\n+#\n+CONFIG_RTE_LIBRTE_HINIC_PMD=n\ndiff --git a/doc/guides/nics/features/hinic.ini b/doc/guides/nics/features/hinic.ini\nnew file mode 100644\nindex 000000000..fe063d6f5\n--- /dev/null\n+++ b/doc/guides/nics/features/hinic.ini\n@@ -0,0 +1,37 @@\n+;\n+; Supported features of the 'hinic' network poll mode driver.\n+;\n+; Refer to default.ini for the full list of available PMD features.\n+;\n+[Features]\n+Speed capabilities   = Y\n+Link status          = Y\n+Link status event    = Y\n+Free Tx mbuf on demand = Y\n+Queue start/stop     = Y\n+Jumbo frame          = N\n+Scattered Rx         = Y\n+TSO                  = Y\n+Promiscuous mode     = Y\n+Unicast MAC filter   = Y\n+Multicast MAC filter = Y\n+RSS hash             = Y\n+RSS key update       = Y\n+RSS reta update      = Y\n+Inner RSS            = Y\n+CRC offload          = Y\n+L3 checksum offload  = Y\n+L4 checksum offload  = Y\n+Inner L3 checksum    = Y\n+Inner L4 checksum    = Y\n+Basic stats          = Y\n+Extended stats       = Y\n+Stats per queue      = Y\n+Linux UIO            = Y\n+Linux VFIO           = Y\n+BSD nic_uio          = N\n+x86-64               = Y\n+ARMv8                = Y\n+ARMv7                = N\n+x86-32               = N\n+Power8               = N\ndiff --git a/doc/guides/nics/hinic.rst b/doc/guides/nics/hinic.rst\nnew file mode 100644\nindex 000000000..c9329bcf1\n--- /dev/null\n+++ b/doc/guides/nics/hinic.rst\n@@ -0,0 +1,58 @@\n+..  SPDX-License-Identifier: BSD-3-Clause\n+    Copyright(c) 2017 Huawei Technologies Co., Ltd\n+\n+\n+HINIC Poll Mode Driver\n+======================\n+\n+The hinic PMD (librte_pmd_hinic) provides poll mode driver support\n+for 25Gbps Huawei Intelligent PCIE Network Adapters based on the\n+Huawei Ethernet Controller Hi1822.\n+\n+\n+Features\n+--------\n+\n+- Multi arch support: x86_64, ARMv8.\n+- Multiple queues for TX and RX\n+- Receiver Side Scaling (RSS)\n+- MAC/VLAN filtering\n+- Checksum offload\n+- TSO offload\n+- Promiscuous mode\n+- Port hardware statistics\n+- Link state information\n+- Link flow control\n+- Scattered and gather for TX and RX\n+\n+Prerequisites\n+-------------\n+\n+- Learning about Huawei Hi1822 IN200 Series Intelligent NICs using\n+  `<https://e.huawei.com/en/products/cloud-computing-dc/servers/pcie-ssd/in-card>`_.\n+\n+- Getting the latest product documents and software supports using\n+  `<https://support.huawei.com/enterprise/en/intelligent-accelerator-components/in500-solution-pid-23507369>`_.\n+\n+- Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>` to setup the basic DPDK environment.\n+\n+Pre-Installation Configuration\n+------------------------------\n+\n+Config File Options\n+~~~~~~~~~~~~~~~~~~~\n+\n+The following options can be modified in the ``config`` file.\n+\n+- ``CONFIG_RTE_LIBRTE_HINIC_PMD`` (default ``y``)\n+\n+Driver compilation and testing\n+------------------------------\n+\n+Refer to the document :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`\n+for details.\n+\n+Limitations or Known issues\n+---------------------------\n+Build with ICC is not supported yet.\n+X86-32, Power8, ARMv7 and BSD are not supported yet.\ndiff --git a/doc/guides/rel_notes/release_19_08.rst b/doc/guides/rel_notes/release_19_08.rst\nindex 3da266705..b574dcf49 100644\n--- a/doc/guides/rel_notes/release_19_08.rst\n+++ b/doc/guides/rel_notes/release_19_08.rst\n@@ -99,6 +99,12 @@ New Features\n   Updated ``librte_telemetry`` to fetch the global metrics from the\n   ``librte_metrics`` library.\n \n+* **Added hinic PMD.**\n+\n+  Added the new ``hinic`` net driver for Huawei Intelligent PCIE Network\n+  Adapters based on the Huawei Ethernet Controller Hi1822.\n+  See the :doc:`../nics/hinic` guide for more details on this new driver.\n+\n \n Removed Items\n -------------\ndiff --git a/drivers/net/Makefile b/drivers/net/Makefile\nindex 78cb10fc6..a1d45d9cb 100644\n--- a/drivers/net/Makefile\n+++ b/drivers/net/Makefile\n@@ -29,6 +29,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_ENETC_PMD) += enetc\n DIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic\n DIRS-$(CONFIG_RTE_LIBRTE_PMD_FAILSAFE) += failsafe\n DIRS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += fm10k\n+DIRS-$(CONFIG_RTE_LIBRTE_HINIC_PMD) += hinic\n DIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e\n DIRS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf\n DIRS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice\ndiff --git a/drivers/net/hinic/Makefile b/drivers/net/hinic/Makefile\nnew file mode 100644\nindex 000000000..8b7475b59\n--- /dev/null\n+++ b/drivers/net/hinic/Makefile\n@@ -0,0 +1,46 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2017 Huawei Technologies Co., Ltd\n+\n+include $(RTE_SDK)/mk/rte.vars.mk\n+\n+#\n+# library name\n+#\n+LIB = librte_pmd_hinic.a\n+\n+CFLAGS += -O3\n+CFLAGS += $(WERROR_FLAGS)\n+\n+ifeq ($(CONFIG_RTE_ARCH_ARM64),y)\n+CFLAGS += -D__ARM64_NEON__\n+else ifeq ($(CONFIG_RTE_ARCH_X86_64),y)\n+CFLAGS += -D__X86_64_SSE__\n+endif\n+\n+LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring\n+LDLIBS += -lrte_ethdev -lrte_net -lrte_hash\n+LDLIBS += -lrte_bus_pci\n+\n+EXPORT_MAP := rte_pmd_hinic_version.map\n+\n+LIBABIVER := 1\n+\n+VPATH += $(SRCDIR)/base\n+\n+#\n+# all source are stored in SRCS-y\n+#\n+SRCS-$(CONFIG_RTE_LIBRTE_HINIC_PMD) += hinic_pmd_api_cmd.c\n+SRCS-$(CONFIG_RTE_LIBRTE_HINIC_PMD) += hinic_pmd_cfg.c\n+SRCS-$(CONFIG_RTE_LIBRTE_HINIC_PMD) += hinic_pmd_cmdq.c\n+SRCS-$(CONFIG_RTE_LIBRTE_HINIC_PMD) += hinic_pmd_eqs.c\n+SRCS-$(CONFIG_RTE_LIBRTE_HINIC_PMD) += hinic_pmd_hwdev.c\n+SRCS-$(CONFIG_RTE_LIBRTE_HINIC_PMD) += hinic_pmd_hwif.c\n+SRCS-$(CONFIG_RTE_LIBRTE_HINIC_PMD) += hinic_pmd_mgmt.c\n+SRCS-$(CONFIG_RTE_LIBRTE_HINIC_PMD) += hinic_pmd_niccfg.c\n+SRCS-$(CONFIG_RTE_LIBRTE_HINIC_PMD) += hinic_pmd_nicio.c\n+SRCS-$(CONFIG_RTE_LIBRTE_HINIC_PMD) += hinic_pmd_wq.c\n+\n+SRCS-$(CONFIG_RTE_LIBRTE_HINIC_PMD) += hinic_pmd_ethdev.c\n+\n+include $(RTE_SDK)/mk/rte.lib.mk\ndiff --git a/drivers/net/hinic/base/meson.build b/drivers/net/hinic/base/meson.build\nnew file mode 100644\nindex 000000000..21a246cd1\n--- /dev/null\n+++ b/drivers/net/hinic/base/meson.build\n@@ -0,0 +1,24 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2017 Huawei Technologies Co., Ltd\n+\n+sources = [\n+\t'hinic_pmd_api_cmd.c',\n+\t'hinic_pmd_cfg.c',\n+\t'hinic_pmd_cmdq.c',\n+\t'hinic_pmd_eqs.c',\n+\t'hinic_pmd_hwdev.c',\n+\t'hinic_pmd_hwif.c',\n+\t'hinic_pmd_mgmt.c',\n+\t'hinic_pmd_niccfg.c',\n+\t'hinic_pmd_nicio.c',\n+\t'hinic_pmd_wq.c',\n+]\n+\n+deps += ['hash']\n+\n+c_args = cflags\n+\n+base_lib = static_library('hinic_base', sources,\n+\tdependencies: [static_rte_eal, static_rte_ethdev, static_rte_bus_pci, static_rte_hash],\n+\tc_args: c_args)\n+base_objs = base_lib.extract_all_objects()\ndiff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c\nnew file mode 100644\nindex 000000000..2491b7a38\n--- /dev/null\n+++ b/drivers/net/hinic/hinic_pmd_ethdev.c\n@@ -0,0 +1,229 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2017 Huawei Technologies Co., Ltd\n+ */\n+\n+#include <rte_pci.h>\n+#include <rte_bus_pci.h>\n+#include <rte_ethdev_pci.h>\n+#include <rte_malloc.h>\n+#include <rte_memcpy.h>\n+\n+#include \"base/hinic_compat.h\"\n+#include \"base/hinic_pmd_hwdev.h\"\n+#include \"base/hinic_pmd_niccfg.h\"\n+#include \"hinic_pmd_ethdev.h\"\n+\n+/* Vendor ID used by Huawei devices */\n+#define HINIC_HUAWEI_VENDOR_ID\t\t0x19E5\n+\n+/* Hinic devices */\n+#define HINIC_DEV_ID_PRD\t\t0x1822\n+#define HINIC_DEV_ID_MEZZ_25GE\t\t0x0210\n+#define HINIC_DEV_ID_MEZZ_40GE\t\t0x020D\n+#define HINIC_DEV_ID_MEZZ_100GE\t\t0x0205\n+\n+#define HINIC_MIN_RX_BUF_SIZE\t\t1024\n+#define HINIC_MAX_MAC_ADDRS\t\t1\n+\n+/** Driver-specific log messages type. */\n+int hinic_logtype;\n+\n+static const struct rte_eth_desc_lim hinic_rx_desc_lim = {\n+\t.nb_max = HINIC_MAX_QUEUE_DEPTH,\n+\t.nb_min = HINIC_MIN_QUEUE_DEPTH,\n+\t.nb_align = HINIC_RXD_ALIGN,\n+};\n+\n+static const struct rte_eth_desc_lim hinic_tx_desc_lim = {\n+\t.nb_max = HINIC_MAX_QUEUE_DEPTH,\n+\t.nb_min = HINIC_MIN_QUEUE_DEPTH,\n+\t.nb_align = HINIC_TXD_ALIGN,\n+};\n+\n+/**\n+ * Get link speed from NIC.\n+ *\n+ * @param dev\n+ *   Pointer to Ethernet device structure.\n+ * @param speed_capa\n+ *   Pointer to link speed structure.\n+ */\n+static void hinic_get_speed_capa(struct rte_eth_dev *dev, uint32_t *speed_capa)\n+{\n+\tstruct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);\n+\tu32 supported_link, advertised_link;\n+\tint err;\n+\n+#define HINIC_LINK_MODE_SUPPORT_1G\t(1U << HINIC_GE_BASE_KX)\n+\n+#define HINIC_LINK_MODE_SUPPORT_10G\t(1U << HINIC_10GE_BASE_KR)\n+\n+#define HINIC_LINK_MODE_SUPPORT_25G\t((1U << HINIC_25GE_BASE_KR_S) | \\\n+\t\t\t\t\t(1U << HINIC_25GE_BASE_CR_S) | \\\n+\t\t\t\t\t(1U << HINIC_25GE_BASE_KR) | \\\n+\t\t\t\t\t(1U << HINIC_25GE_BASE_CR))\n+\n+#define HINIC_LINK_MODE_SUPPORT_40G\t((1U << HINIC_40GE_BASE_KR4) | \\\n+\t\t\t\t\t(1U << HINIC_40GE_BASE_CR4))\n+\n+#define HINIC_LINK_MODE_SUPPORT_100G\t((1U << HINIC_100GE_BASE_KR4) | \\\n+\t\t\t\t\t(1U << HINIC_100GE_BASE_CR4))\n+\n+\terr = hinic_get_link_mode(nic_dev->hwdev,\n+\t\t\t\t  &supported_link, &advertised_link);\n+\tif (err || supported_link == HINIC_SUPPORTED_UNKNOWN ||\n+\t    advertised_link == HINIC_SUPPORTED_UNKNOWN) {\n+\t\tPMD_DRV_LOG(WARNING, \"Get speed capability info failed, device: %s, port_id: %u\",\n+\t\t\t  nic_dev->proc_dev_name, dev->data->port_id);\n+\t} else {\n+\t\t*speed_capa = 0;\n+\t\tif (!!(supported_link & HINIC_LINK_MODE_SUPPORT_1G))\n+\t\t\t*speed_capa |= ETH_LINK_SPEED_1G;\n+\t\tif (!!(supported_link & HINIC_LINK_MODE_SUPPORT_10G))\n+\t\t\t*speed_capa |= ETH_LINK_SPEED_10G;\n+\t\tif (!!(supported_link & HINIC_LINK_MODE_SUPPORT_25G))\n+\t\t\t*speed_capa |= ETH_LINK_SPEED_25G;\n+\t\tif (!!(supported_link & HINIC_LINK_MODE_SUPPORT_40G))\n+\t\t\t*speed_capa |= ETH_LINK_SPEED_40G;\n+\t\tif (!!(supported_link & HINIC_LINK_MODE_SUPPORT_100G))\n+\t\t\t*speed_capa |= ETH_LINK_SPEED_100G;\n+\t}\n+}\n+\n+/**\n+ * DPDK callback to get information about the device.\n+ *\n+ * @param dev\n+ *   Pointer to Ethernet device structure.\n+ * @param info\n+ *   Pointer to Info structure output buffer.\n+ */\n+static void\n+hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)\n+{\n+\tstruct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);\n+\n+\tinfo->max_rx_queues  = nic_dev->nic_cap.max_rqs;\n+\tinfo->max_tx_queues  = nic_dev->nic_cap.max_sqs;\n+\tinfo->min_rx_bufsize = HINIC_MIN_RX_BUF_SIZE;\n+\tinfo->max_rx_pktlen  = HINIC_MAX_JUMBO_FRAME_SIZE;\n+\tinfo->max_mac_addrs  = HINIC_MAX_MAC_ADDRS;\n+\n+\thinic_get_speed_capa(dev, &info->speed_capa);\n+\tinfo->rx_queue_offload_capa = 0;\n+\tinfo->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP |\n+\t\t\t\tDEV_RX_OFFLOAD_IPV4_CKSUM |\n+\t\t\t\tDEV_RX_OFFLOAD_UDP_CKSUM |\n+\t\t\t\tDEV_RX_OFFLOAD_TCP_CKSUM;\n+\n+\tinfo->tx_queue_offload_capa = 0;\n+\tinfo->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |\n+\t\t\t\tDEV_TX_OFFLOAD_IPV4_CKSUM |\n+\t\t\t\tDEV_TX_OFFLOAD_UDP_CKSUM |\n+\t\t\t\tDEV_TX_OFFLOAD_TCP_CKSUM |\n+\t\t\t\tDEV_TX_OFFLOAD_SCTP_CKSUM |\n+\t\t\t\tDEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |\n+\t\t\t\tDEV_TX_OFFLOAD_TCP_TSO |\n+\t\t\t\tDEV_TX_OFFLOAD_MULTI_SEGS;\n+\n+\tinfo->hash_key_size = HINIC_RSS_KEY_SIZE;\n+\tinfo->reta_size = HINIC_RSS_INDIR_SIZE;\n+\tinfo->rx_desc_lim = hinic_rx_desc_lim;\n+\tinfo->tx_desc_lim = hinic_tx_desc_lim;\n+}\n+\n+static int hinic_func_init(__rte_unused struct rte_eth_dev *eth_dev)\n+{\n+\treturn 0;\n+}\n+\n+/**\n+ * DPDK callback to close the device.\n+ *\n+ * @param dev\n+ *   Pointer to Ethernet device structure.\n+ */\n+static void hinic_dev_close(__rte_unused struct rte_eth_dev *dev)\n+{\n+}\n+\n+static const struct eth_dev_ops hinic_pmd_ops = {\n+\t.dev_infos_get                 = hinic_dev_infos_get,\n+};\n+\n+static int hinic_dev_init(struct rte_eth_dev *eth_dev)\n+{\n+\tstruct rte_pci_device *pci_dev;\n+\n+\tpci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);\n+\n+\tPMD_DRV_LOG(INFO, \"Initializing pf hinic-%.4x:%.2x:%.2x.%x in %s process\",\n+\t\t    pci_dev->addr.domain, pci_dev->addr.bus,\n+\t\t    pci_dev->addr.devid, pci_dev->addr.function,\n+\t\t    (rte_eal_process_type() == RTE_PROC_PRIMARY) ?\n+\t\t    \"primary\" : \"secondary\");\n+\n+\t/* rte_eth_dev ops, rx_burst and tx_burst */\n+\teth_dev->dev_ops = &hinic_pmd_ops;\n+\n+\treturn hinic_func_init(eth_dev);\n+}\n+\n+static int hinic_dev_uninit(struct rte_eth_dev *dev)\n+{\n+\tstruct hinic_nic_dev *nic_dev;\n+\n+\tnic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);\n+\thinic_clear_bit(HINIC_DEV_INIT, &nic_dev->dev_status);\n+\n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n+\t\treturn 0;\n+\n+\thinic_dev_close(dev);\n+\n+\tdev->dev_ops = NULL;\n+\tdev->rx_pkt_burst = NULL;\n+\tdev->tx_pkt_burst = NULL;\n+\n+\trte_free(dev->data->mac_addrs);\n+\tdev->data->mac_addrs = NULL;\n+\n+\treturn HINIC_OK;\n+}\n+\n+static struct rte_pci_id pci_id_hinic_map[] = {\n+\t{ RTE_PCI_DEVICE(HINIC_HUAWEI_VENDOR_ID, HINIC_DEV_ID_PRD) },\n+\t{ RTE_PCI_DEVICE(HINIC_HUAWEI_VENDOR_ID, HINIC_DEV_ID_MEZZ_25GE) },\n+\t{ RTE_PCI_DEVICE(HINIC_HUAWEI_VENDOR_ID, HINIC_DEV_ID_MEZZ_40GE) },\n+\t{ RTE_PCI_DEVICE(HINIC_HUAWEI_VENDOR_ID, HINIC_DEV_ID_MEZZ_100GE) },\n+\t{.vendor_id = 0},\n+};\n+\n+static int hinic_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n+\t\t\t   struct rte_pci_device *pci_dev)\n+{\n+\treturn rte_eth_dev_pci_generic_probe(pci_dev,\n+\t\tsizeof(struct hinic_nic_dev), hinic_dev_init);\n+}\n+\n+static int hinic_pci_remove(struct rte_pci_device *pci_dev)\n+{\n+\treturn rte_eth_dev_pci_generic_remove(pci_dev, hinic_dev_uninit);\n+}\n+\n+static struct rte_pci_driver rte_hinic_pmd = {\n+\t.id_table = pci_id_hinic_map,\n+\t.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,\n+\t.probe = hinic_pci_probe,\n+\t.remove = hinic_pci_remove,\n+};\n+\n+RTE_PMD_REGISTER_PCI(net_hinic, rte_hinic_pmd);\n+RTE_PMD_REGISTER_PCI_TABLE(net_hinic, pci_id_hinic_map);\n+\n+RTE_INIT(hinic_init_log)\n+{\n+\thinic_logtype = rte_log_register(\"pmd.net.hinic\");\n+\tif (hinic_logtype >= 0)\n+\t\trte_log_set_level(hinic_logtype, RTE_LOG_INFO);\n+}\ndiff --git a/drivers/net/hinic/hinic_pmd_ethdev.h b/drivers/net/hinic/hinic_pmd_ethdev.h\nnew file mode 100644\nindex 000000000..4aeddc24d\n--- /dev/null\n+++ b/drivers/net/hinic/hinic_pmd_ethdev.h\n@@ -0,0 +1,71 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2017 Huawei Technologies Co., Ltd\n+ */\n+\n+#ifndef _HINIC_PMD_ETHDEV_H_\n+#define _HINIC_PMD_ETHDEV_H_\n+\n+#include <rte_ethdev.h>\n+#include <rte_ethdev_core.h>\n+\n+#include \"base/hinic_compat.h\"\n+#include \"base/hinic_pmd_cfg.h\"\n+\n+#define HINIC_DEV_NAME_LEN\t(32)\n+#define HINIC_MAX_RX_QUEUES\t(64)\n+\n+/* mbuf pool for copy invalid mbuf segs */\n+#define HINIC_COPY_MEMPOOL_DEPTH (128)\n+#define HINIC_COPY_MBUF_SIZE     (4096)\n+\n+#define SIZE_8BYTES(size)\t(ALIGN((u32)(size), 8) >> 3)\n+\n+#define HINIC_PKTLEN_TO_MTU(pktlen)\t\\\n+\t((pktlen) - (ETH_HLEN + ETH_CRC_LEN))\n+\n+#define HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev) \\\n+\t((struct hinic_nic_dev *)(dev)->data->dev_private)\n+\n+#define HINIC_MAX_QUEUE_DEPTH\t\t4096\n+#define HINIC_MIN_QUEUE_DEPTH\t\t128\n+#define HINIC_TXD_ALIGN                 1\n+#define HINIC_RXD_ALIGN                 1\n+\n+enum hinic_dev_status {\n+\tHINIC_DEV_INIT,\n+\tHINIC_DEV_CLOSE,\n+\tHINIC_DEV_START,\n+\tHINIC_DEV_INTR_EN,\n+};\n+\n+/* hinic nic_device */\n+struct hinic_nic_dev {\n+\t/* hardware device */\n+\tstruct hinic_hwdev *hwdev;\n+\tstruct hinic_txq **txqs;\n+\tstruct hinic_rxq **rxqs;\n+\tstruct rte_mempool *cpy_mpool;\n+\tu16 num_qps;\n+\tu16 num_sq;\n+\tu16 num_rq;\n+\tu16 mtu_size;\n+\tu8 rss_tmpl_idx;\n+\tu8 rss_indir_flag;\n+\tu8 num_rss;\n+\tu8 rx_queue_list[HINIC_MAX_RX_QUEUES];\n+\n+\t/* info */\n+\tunsigned int flags;\n+\tstruct nic_service_cap nic_cap;\n+\tu32 rx_mode_status;\t/* promisc allmulticast */\n+\tunsigned long dev_status;\n+\n+\t/* dpdk only */\n+\tchar proc_dev_name[HINIC_DEV_NAME_LEN];\n+\t/* PF0->COS4, PF1->COS5, PF2->COS6, PF3->COS7,\n+\t * vf: the same with associate pf\n+\t */\n+\tu32 default_cos;\n+};\n+\n+#endif /* _HINIC_PMD_ETHDEV_H_ */\ndiff --git a/drivers/net/hinic/meson.build b/drivers/net/hinic/meson.build\nnew file mode 100644\nindex 000000000..d1c3ecc77\n--- /dev/null\n+++ b/drivers/net/hinic/meson.build\n@@ -0,0 +1,11 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2017 Huawei Technologies Co., Ltd\n+\n+subdir('base')\n+objs = [base_objs]\n+\n+sources = files(\n+\t'hinic_pmd_ethdev.c',\n+\t)\n+\n+includes += include_directories('base')\ndiff --git a/drivers/net/hinic/rte_pmd_hinic_version.map b/drivers/net/hinic/rte_pmd_hinic_version.map\nnew file mode 100644\nindex 000000000..9a61188cd\n--- /dev/null\n+++ b/drivers/net/hinic/rte_pmd_hinic_version.map\n@@ -0,0 +1,4 @@\n+DPDK_19.08 {\n+\n+\tlocal: *;\n+};\ndiff --git a/drivers/net/meson.build b/drivers/net/meson.build\nindex b57073483..86e704e13 100644\n--- a/drivers/net/meson.build\n+++ b/drivers/net/meson.build\n@@ -17,6 +17,7 @@ drivers = ['af_packet',\n \t'enic',\n \t'failsafe',\n \t'fm10k', 'i40e',\n+\t'hinic',\n \t'iavf',\n \t'ice',\n \t'ifc',\ndiff --git a/mk/rte.app.mk b/mk/rte.app.mk\nindex 81be289a8..2b5696a27 100644\n--- a/mk/rte.app.mk\n+++ b/mk/rte.app.mk\n@@ -168,6 +168,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_ENETC_PMD)      += -lrte_pmd_enetc\n _LDLIBS-$(CONFIG_RTE_LIBRTE_ENIC_PMD)       += -lrte_pmd_enic\n _LDLIBS-$(CONFIG_RTE_LIBRTE_FM10K_PMD)      += -lrte_pmd_fm10k\n _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_FAILSAFE)   += -lrte_pmd_failsafe\n+_LDLIBS-$(CONFIG_RTE_LIBRTE_HINIC_PMD)      += -lrte_pmd_hinic\n _LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD)       += -lrte_pmd_i40e\n _LDLIBS-$(CONFIG_RTE_LIBRTE_IAVF_PMD)       += -lrte_pmd_iavf\n _LDLIBS-$(CONFIG_RTE_LIBRTE_ICE_PMD)        += -lrte_pmd_ice\n",
    "prefixes": [
        "v6",
        "11/15"
    ]
}