From 565829db8b8fa70605cc3a00e19c37c561c9dc18 Mon Sep 17 00:00:00 2001 From: "Wei Hu (Xavier)" Date: Thu, 26 Sep 2019 22:01:47 +0800 Subject: [PATCH] net/hns3: add build and doc infrastructure This patch adds build and doc infrastructure for hns3 PMD driver. Signed-off-by: Wei Hu (Xavier) Signed-off-by: Min Hu (Connor) Signed-off-by: Chunsong Feng Signed-off-by: Hao Chen Signed-off-by: Huisong Li Reviewed-by: Ferruh Yigit --- MAINTAINERS | 8 +++ config/common_base | 5 ++ config/common_linux | 5 ++ config/defconfig_arm-armv7a-linuxapp-gcc | 1 + config/defconfig_i686-native-linuxapp-gcc | 5 ++ config/defconfig_i686-native-linuxapp-icc | 5 ++ config/defconfig_ppc_64-power8-linuxapp-gcc | 1 + config/defconfig_x86_64-native-linuxapp-icc | 5 ++ config/defconfig_x86_x32-native-linuxapp-gcc | 5 ++ doc/guides/nics/features/hns3.ini | 9 +++ doc/guides/nics/hns3.rst | 60 ++++++++++++++++++++ doc/guides/nics/index.rst | 1 + doc/guides/rel_notes/release_19_11.rst | 6 ++ drivers/net/Makefile | 1 + drivers/net/hns3/Makefile | 23 ++++++++ drivers/net/hns3/hns3_ethdev.c | 3 + drivers/net/hns3/meson.build | 19 +++++++ drivers/net/hns3/rte_pmd_hns3_version.map | 3 + drivers/net/meson.build | 1 + mk/rte.app.mk | 1 + 20 files changed, 167 insertions(+) create mode 100644 doc/guides/nics/features/hns3.ini create mode 100644 doc/guides/nics/hns3.rst create mode 100644 drivers/net/hns3/Makefile create mode 100644 drivers/net/hns3/hns3_ethdev.c create mode 100644 drivers/net/hns3/meson.build create mode 100644 drivers/net/hns3/rte_pmd_hns3_version.map diff --git a/MAINTAINERS b/MAINTAINERS index 61f7911f7a..dc6ffc5ec5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -605,6 +605,14 @@ F: drivers/net/enic/ F: doc/guides/nics/enic.rst F: doc/guides/nics/features/enic.ini +Hisilicon hns3 +M: Wei Hu (Xavier) +M: Min Hu (Connor) +M: Yisen Zhuang +F: drivers/net/hns3/ +F: doc/guides/nics/hns3.rst +F: doc/guides/nics/features/hns3.ini + Huawei hinic M: Ziyang Xuan M: Xiaoyun Wang diff --git a/config/common_base b/config/common_base index 19a4523458..46ca2b2e13 100644 --- a/config/common_base +++ b/config/common_base @@ -281,6 +281,11 @@ CONFIG_RTE_LIBRTE_E1000_PF_DISABLE_STRIP_CRC=n # CONFIG_RTE_LIBRTE_HINIC_PMD=n +# +# Compile burst-oriented HNS3 PMD driver +# +CONFIG_RTE_LIBRTE_HNS3_PMD=n + # # Compile burst-oriented IXGBE PMD driver # diff --git a/config/common_linux b/config/common_linux index 6e252553a5..96e2e1f2e4 100644 --- a/config/common_linux +++ b/config/common_linux @@ -63,3 +63,8 @@ CONFIG_RTE_LIBRTE_ENETC_PMD=y # HINIC PMD driver # CONFIG_RTE_LIBRTE_HINIC_PMD=y + +# +# Hisilicon HNS3 PMD driver +# +CONFIG_RTE_LIBRTE_HNS3_PMD=y diff --git a/config/defconfig_arm-armv7a-linuxapp-gcc b/config/defconfig_arm-armv7a-linuxapp-gcc index 26ab5c57d5..c91423f0e6 100644 --- a/config/defconfig_arm-armv7a-linuxapp-gcc +++ b/config/defconfig_arm-armv7a-linuxapp-gcc @@ -55,4 +55,5 @@ CONFIG_RTE_LIBRTE_SFC_EFX_PMD=n CONFIG_RTE_LIBRTE_AVP_PMD=n CONFIG_RTE_LIBRTE_NFP_PMD=n CONFIG_RTE_LIBRTE_HINIC_PMD=n +CONFIG_RTE_LIBRTE_HNS3_PMD=n CONFIG_RTE_LIBRTE_PMD_IOAT_RAWDEV=n diff --git a/config/defconfig_i686-native-linuxapp-gcc b/config/defconfig_i686-native-linuxapp-gcc index 07fc5f8800..61ea1606f4 100644 --- a/config/defconfig_i686-native-linuxapp-gcc +++ b/config/defconfig_i686-native-linuxapp-gcc @@ -59,3 +59,8 @@ CONFIG_RTE_MAX_MEM_MB=2048 # HINIC PMD is not supported on 32-bit # CONFIG_RTE_LIBRTE_HINIC_PMD=n + +# +# HNS3 PMD is not supported on 32-bit +# +CONFIG_RTE_LIBRTE_HNS3_PMD=n diff --git a/config/defconfig_i686-native-linuxapp-icc b/config/defconfig_i686-native-linuxapp-icc index 34f34d5cee..7f614d3467 100644 --- a/config/defconfig_i686-native-linuxapp-icc +++ b/config/defconfig_i686-native-linuxapp-icc @@ -59,3 +59,8 @@ CONFIG_RTE_MAX_MEM_MB=2048 # HINIC PMD is not supported on 32-bit # CONFIG_RTE_LIBRTE_HINIC_PMD=n + +# +# HNS3 PMD is not supported on 32-bit +# +CONFIG_RTE_LIBRTE_HNS3_PMD=n diff --git a/config/defconfig_ppc_64-power8-linuxapp-gcc b/config/defconfig_ppc_64-power8-linuxapp-gcc index de411e9c9f..b7b9d6f48c 100644 --- a/config/defconfig_ppc_64-power8-linuxapp-gcc +++ b/config/defconfig_ppc_64-power8-linuxapp-gcc @@ -30,4 +30,5 @@ CONFIG_RTE_LIBRTE_FM10K_PMD=n CONFIG_RTE_LIBRTE_SFC_EFX_PMD=n CONFIG_RTE_LIBRTE_AVP_PMD=n CONFIG_RTE_LIBRTE_HINIC_PMD=n +CONFIG_RTE_LIBRTE_HNS3_PMD=n CONFIG_RTE_LIBRTE_PMD_IOAT_RAWDEV=n diff --git a/config/defconfig_x86_64-native-linuxapp-icc b/config/defconfig_x86_64-native-linuxapp-icc index d82b9229d3..8aa7af7e20 100644 --- a/config/defconfig_x86_64-native-linuxapp-icc +++ b/config/defconfig_x86_64-native-linuxapp-icc @@ -22,3 +22,8 @@ CONFIG_RTE_LIBRTE_SFC_EFX_PMD=n # HINIC PMD build is not supported using icc toolchain # CONFIG_RTE_LIBRTE_HINIC_PMD=n + +# +# HNS3 PMD build is not supported using icc toolchain +# +CONFIG_RTE_LIBRTE_HNS3_PMD=n diff --git a/config/defconfig_x86_x32-native-linuxapp-gcc b/config/defconfig_x86_x32-native-linuxapp-gcc index bcc72086a3..c188f4331c 100644 --- a/config/defconfig_x86_x32-native-linuxapp-gcc +++ b/config/defconfig_x86_x32-native-linuxapp-gcc @@ -39,3 +39,8 @@ CONFIG_RTE_MAX_MEM_MB=2048 # HINIC PMD is not supported on 32-bit # CONFIG_RTE_LIBRTE_HINIC_PMD=n + +# +# HNS3 PMD is not supported on 32-bit +# +CONFIG_RTE_LIBRTE_HNS3_PMD=n diff --git a/doc/guides/nics/features/hns3.ini b/doc/guides/nics/features/hns3.ini new file mode 100644 index 0000000000..2eb57c8ced --- /dev/null +++ b/doc/guides/nics/features/hns3.ini @@ -0,0 +1,9 @@ +; +; Supported features of the 'hns3' network poll mode driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Linux UIO = Y +Linux VFIO = Y +ARMv8 = Y diff --git a/doc/guides/nics/hns3.rst b/doc/guides/nics/hns3.rst new file mode 100644 index 0000000000..505488b6ca --- /dev/null +++ b/doc/guides/nics/hns3.rst @@ -0,0 +1,60 @@ +.. SPDX-License-Identifier: BSD-3-Clause + Copyright(c) 2018-2019 Hisilicon Limited. + +HNS3 Poll Mode Driver +=============================== + +The hns3 PMD (librte_pmd_hns3) provides poll mode driver support +for the inbuilt Hisilicon Network Subsystem(HNS) network engine +found in the Hisilicon Kunpeng 920 SoC. + +Features +-------- + +Features of the HNS3 PMD are: + +- Multiple queues for TX and RX +- Receive Side Scaling (RSS) +- Packet type information +- Checksum offload +- Promiscuous mode +- Multicast mode +- Port hardware statistics +- Jumbo frames +- Link state information +- VLAN stripping +- NUMA support + +Prerequisites +------------- +- Get the information about Kunpeng920 chip using + ``_. + +- Follow the DPDK :ref:`Getting Started Guide for Linux ` to setup the basic DPDK environment. + +Pre-Installation Configuration +------------------------------ + +Config File Options +~~~~~~~~~~~~~~~~~~~ + +The following options can be modified in the ``config`` file. +Please note that enabling debugging options may affect system performance. + +- ``CONFIG_RTE_LIBRTE_HNS3_PMD`` (default ``y``) + +Driver compilation and testing +------------------------------ + +Refer to the document :ref:`compiling and testing a PMD for a NIC ` +for details. + +Limitations or Known issues +--------------------------- +Currently, we only support VF device is bound to vfio_pci or +igb_uio and then driven by DPDK driver when PF is driven by +kernel mode hns3 ethdev driver, VF is not supported when PF +is driven by DPDK driver. + +Build with ICC is not supported yet. +X86-32, Power8, ARMv7 and BSD are not supported yet. diff --git a/doc/guides/nics/index.rst b/doc/guides/nics/index.rst index 9fec02f3ec..d477001d9f 100644 --- a/doc/guides/nics/index.rst +++ b/doc/guides/nics/index.rst @@ -28,6 +28,7 @@ Network Interface Controller Drivers enic fm10k hinic + hns3 i40e ice ifc diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst index d5815948ce..45ed1586c7 100644 --- a/doc/guides/rel_notes/release_19_11.rst +++ b/doc/guides/rel_notes/release_19_11.rst @@ -56,6 +56,12 @@ New Features Also, make sure to start the actual text at the margin. ========================================================= +* **Added Hisilicon hns3 PMD.** + + Added the new ``hns3`` net driver for the inbuilt Hisilicon Network + Subsystem 3(HNS3) network engine found in the Hisilicon Kunpeng 920 SoC. + See the :doc:`../nics/hns3` guide for more details on this new driver. + * **Updated the Intel ice driver.** Updated the Intel ice driver with new features and improvements, including: diff --git a/drivers/net/Makefile b/drivers/net/Makefile index 5767fdf654..1770d8b230 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile @@ -30,6 +30,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic DIRS-$(CONFIG_RTE_LIBRTE_PMD_FAILSAFE) += failsafe DIRS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += fm10k DIRS-$(CONFIG_RTE_LIBRTE_HINIC_PMD) += hinic +DIRS-$(CONFIG_RTE_LIBRTE_HNS3_PMD) += hns3 DIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e DIRS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf DIRS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice diff --git a/drivers/net/hns3/Makefile b/drivers/net/hns3/Makefile new file mode 100644 index 0000000000..ddf3bfb607 --- /dev/null +++ b/drivers/net/hns3/Makefile @@ -0,0 +1,23 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018-2019 Hisilicon Limited. + +include $(RTE_SDK)/mk/rte.vars.mk + +# +# library name +# +LIB = librte_pmd_hns3.a + +CFLAGS += -O3 +CFLAGS += $(WERROR_FLAGS) + +EXPORT_MAP := rte_pmd_hns3_version.map + +LIBABIVER := 1 + +# +# all source are stored in SRCS-y +# +SRCS-$(CONFIG_RTE_LIBRTE_HNS3_PMD) += hns3_ethdev.c + +include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c new file mode 100644 index 0000000000..3f74e54469 --- /dev/null +++ b/drivers/net/hns3/hns3_ethdev.c @@ -0,0 +1,3 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018-2019 Hisilicon Limited. + */ diff --git a/drivers/net/hns3/meson.build b/drivers/net/hns3/meson.build new file mode 100644 index 0000000000..1a307a7fc3 --- /dev/null +++ b/drivers/net/hns3/meson.build @@ -0,0 +1,19 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018-2019 Hisilicon Limited + +if not is_linux + build = false + reason = 'only supported on Linux' + subdir_done() +endif + +if arch_subdir != 'x86' and arch_subdir != 'arm' or not dpdk_conf.get('RTE_ARCH_64') + build = false + reason = 'only supported on x86_64 and arm64' + subdir_done() +endif + +sources = files( + 'hns3_ethdev.c', + ) +deps += ['hash'] diff --git a/drivers/net/hns3/rte_pmd_hns3_version.map b/drivers/net/hns3/rte_pmd_hns3_version.map new file mode 100644 index 0000000000..35e5f2debb --- /dev/null +++ b/drivers/net/hns3/rte_pmd_hns3_version.map @@ -0,0 +1,3 @@ +DPDK_19.11 { + local: *; +}; diff --git a/drivers/net/meson.build b/drivers/net/meson.build index 513f19b337..eb1c6b638c 100644 --- a/drivers/net/meson.build +++ b/drivers/net/meson.build @@ -18,6 +18,7 @@ drivers = ['af_packet', 'failsafe', 'fm10k', 'i40e', 'hinic', + 'hns3', 'iavf', 'ice', 'ifc', diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 219c54043a..b91273f20e 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -172,6 +172,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += -lrte_pmd_enic _LDLIBS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += -lrte_pmd_fm10k _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_FAILSAFE) += -lrte_pmd_failsafe _LDLIBS-$(CONFIG_RTE_LIBRTE_HINIC_PMD) += -lrte_pmd_hinic +_LDLIBS-$(CONFIG_RTE_LIBRTE_HNS3_PMD) += -lrte_pmd_hns3 _LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e _LDLIBS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += -lrte_pmd_iavf _LDLIBS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += -lrte_pmd_ice -- 2.20.1