mbox series

[00/22] add hns3 ethernet PMD driver

Message ID 1566568031-45991-1-git-send-email-xavier.huwei@huawei.com (mailing list archive)
Headers
Series add hns3 ethernet PMD driver |

Message

Wei Hu (Xavier) Aug. 23, 2019, 1:46 p.m. UTC
  The Hisilicon Network Subsystem is a long term evolution IP which is
supposed to be used in Hisilicon ICT SoCs such as Kunpeng 920.

This series add DPDK rte_ethdev poll mode driver for hns3(Hisilicon
Network Subsystem 3) network engine.

Wei Hu (Xavier) (22):
  net/hns3: add hardware registers definition
  net/hns3: add some definitions for data structure and macro
  net/hns3: register hns3 PMD driver
  net/hns3: add support for cmd of hns3 PMD driver
  net/hns3: add the initialization of hns3 PMD driver
  net/hns3: add support for MAC address related operations
  net/hns3: add support for some misc operations
  net/hns3: add support for link update operation
  net/hns3: add support for flow directory of hns3 PMD driver
  net/hns3: add support for RSS of hns3 PMD driver
  net/hns3: add support for flow control of hns3 PMD driver
  net/hns3: add support for VLAN of hns3 PMD driver
  net/hns3: add support for mailbox of hns3 PMD driver
  net/hns3: add support for hns3 VF PMD driver
  net/hns3: add package and queue related operation
  net/hns3: add start stop configure promiscuous ops
  net/hns3: add dump register ops for hns3 PMD driver
  net/hns3: add abnormal interrupt process for hns3 PMD driver
  net/hns3: add stats related ops for hns3 PMD driver
  net/hns3: add reset related process for hns3 PMD driver
  net/hns3: add multiple process support for hns3 PMD driver
  net/hns3: add hns3 build files

 MAINTAINERS                                  |    7 +
 config/common_armv8a_linux                   |    5 +
 config/common_base                           |    5 +
 config/defconfig_arm64-armv8a-linuxapp-clang |    2 +
 doc/guides/nics/features/hns3.ini            |   38 +
 doc/guides/nics/hns3.rst                     |   55 +
 drivers/net/Makefile                         |    1 +
 drivers/net/hns3/Makefile                    |   43 +
 drivers/net/hns3/hns3_cmd.c                  |  559 +++
 drivers/net/hns3/hns3_cmd.h                  |  752 ++++
 drivers/net/hns3/hns3_dcb.c                  | 1650 +++++++++
 drivers/net/hns3/hns3_dcb.h                  |  166 +
 drivers/net/hns3/hns3_ethdev.c               | 4961 ++++++++++++++++++++++++++
 drivers/net/hns3/hns3_ethdev.h               |  637 ++++
 drivers/net/hns3/hns3_ethdev_vf.c            | 1739 +++++++++
 drivers/net/hns3/hns3_fdir.c                 | 1065 ++++++
 drivers/net/hns3/hns3_fdir.h                 |  203 ++
 drivers/net/hns3/hns3_flow.c                 | 1878 ++++++++++
 drivers/net/hns3/hns3_intr.c                 | 1168 ++++++
 drivers/net/hns3/hns3_intr.h                 |   79 +
 drivers/net/hns3/hns3_logs.h                 |   34 +
 drivers/net/hns3/hns3_mbx.c                  |  363 ++
 drivers/net/hns3/hns3_mbx.h                  |  136 +
 drivers/net/hns3/hns3_mp.c                   |  219 ++
 drivers/net/hns3/hns3_mp.h                   |   14 +
 drivers/net/hns3/hns3_regs.c                 |  378 ++
 drivers/net/hns3/hns3_regs.h                 |   99 +
 drivers/net/hns3/hns3_rss.c                  | 1388 +++++++
 drivers/net/hns3/hns3_rss.h                  |  139 +
 drivers/net/hns3/hns3_rxtx.c                 | 1344 +++++++
 drivers/net/hns3/hns3_rxtx.h                 |  287 ++
 drivers/net/hns3/hns3_stats.c                |  847 +++++
 drivers/net/hns3/hns3_stats.h                |  146 +
 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 +
 37 files changed, 20431 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_cmd.c
 create mode 100644 drivers/net/hns3/hns3_cmd.h
 create mode 100644 drivers/net/hns3/hns3_dcb.c
 create mode 100644 drivers/net/hns3/hns3_dcb.h
 create mode 100644 drivers/net/hns3/hns3_ethdev.c
 create mode 100644 drivers/net/hns3/hns3_ethdev.h
 create mode 100644 drivers/net/hns3/hns3_ethdev_vf.c
 create mode 100644 drivers/net/hns3/hns3_fdir.c
 create mode 100644 drivers/net/hns3/hns3_fdir.h
 create mode 100644 drivers/net/hns3/hns3_flow.c
 create mode 100644 drivers/net/hns3/hns3_intr.c
 create mode 100644 drivers/net/hns3/hns3_intr.h
 create mode 100644 drivers/net/hns3/hns3_logs.h
 create mode 100644 drivers/net/hns3/hns3_mbx.c
 create mode 100644 drivers/net/hns3/hns3_mbx.h
 create mode 100644 drivers/net/hns3/hns3_mp.c
 create mode 100644 drivers/net/hns3/hns3_mp.h
 create mode 100644 drivers/net/hns3/hns3_regs.c
 create mode 100644 drivers/net/hns3/hns3_regs.h
 create mode 100644 drivers/net/hns3/hns3_rss.c
 create mode 100644 drivers/net/hns3/hns3_rss.h
 create mode 100644 drivers/net/hns3/hns3_rxtx.c
 create mode 100644 drivers/net/hns3/hns3_rxtx.h
 create mode 100644 drivers/net/hns3/hns3_stats.c
 create mode 100644 drivers/net/hns3/hns3_stats.h
 create mode 100644 drivers/net/hns3/meson.build
 create mode 100644 drivers/net/hns3/rte_pmd_hns3_version.map
  

Comments

Ferruh Yigit Aug. 30, 2019, 3:23 p.m. UTC | #1
On 8/23/2019 2:46 PM, Wei Hu (Xavier) wrote:
> The Hisilicon Network Subsystem is a long term evolution IP which is
> supposed to be used in Hisilicon ICT SoCs such as Kunpeng 920.
> 
> This series add DPDK rte_ethdev poll mode driver for hns3(Hisilicon
> Network Subsystem 3) network engine.
> 
> Wei Hu (Xavier) (22):
>   net/hns3: add hardware registers definition
>   net/hns3: add some definitions for data structure and macro
>   net/hns3: register hns3 PMD driver
>   net/hns3: add support for cmd of hns3 PMD driver
>   net/hns3: add the initialization of hns3 PMD driver
>   net/hns3: add support for MAC address related operations
>   net/hns3: add support for some misc operations
>   net/hns3: add support for link update operation
>   net/hns3: add support for flow directory of hns3 PMD driver
>   net/hns3: add support for RSS of hns3 PMD driver
>   net/hns3: add support for flow control of hns3 PMD driver
>   net/hns3: add support for VLAN of hns3 PMD driver
>   net/hns3: add support for mailbox of hns3 PMD driver
>   net/hns3: add support for hns3 VF PMD driver
>   net/hns3: add package and queue related operation
>   net/hns3: add start stop configure promiscuous ops
>   net/hns3: add dump register ops for hns3 PMD driver
>   net/hns3: add abnormal interrupt process for hns3 PMD driver
>   net/hns3: add stats related ops for hns3 PMD driver
>   net/hns3: add reset related process for hns3 PMD driver
>   net/hns3: add multiple process support for hns3 PMD driver
>   net/hns3: add hns3 build files
> 

There are some build error for 32-bit [1], I am aware that 32-bit is not in the
supported arch list, but build error are just related to the log format
identifiers, it is good practice to use 'PRIx64' and friends which will also fix
the build issue.

[1]
In file included from .../drivers/net/hns3/hns3_regs.c:35:



.../drivers/net/hns3/hns3_regs.c: In function ‘hns3_get_32_bit_regs’:



.../drivers/net/hns3/hns3_logs.h:16:38: error: format ‘%ld’ expects argument of
type ‘long int’, but argument 6 has type ‘unsigned int’ [-Werror=format=]


   16 |  rte_log(level, hns3_logtype_driver, "%s %s(): " fmt, \



      |                                      ^~~~~~~~~~~



.../drivers/net/hns3/hns3_logs.h:20:2: note: in expansion of macro
‘PMD_DRV_LOG_RAW’


   20 |  PMD_DRV_LOG_RAW(hw, RTE_LOG_ERR, fmt "\n", ## args)



      |  ^~~~~~~~~~~~~~~



.../drivers/net/hns3/hns3_regs.c:177:3: note: in expansion of macro ‘hns3_err’



  177 |   hns3_err(hw, "Failed to allocate %ld bytes needed to "



      |   ^~~~~~~~



.../drivers/net/hns3/hns3_regs.c:177:38: note: format string is defined here



  177 |   hns3_err(hw, "Failed to allocate %ld bytes needed to "



      |                                    ~~^



      |                                      |



      |                                      long int



      |                                    %d
  
Wei Hu (Xavier) Aug. 31, 2019, 8:06 a.m. UTC | #2
On 2019/8/30 23:23, Ferruh Yigit wrote:
> On 8/23/2019 2:46 PM, Wei Hu (Xavier) wrote:
>> The Hisilicon Network Subsystem is a long term evolution IP which is
>> supposed to be used in Hisilicon ICT SoCs such as Kunpeng 920.
>>
>> This series add DPDK rte_ethdev poll mode driver for hns3(Hisilicon
>> Network Subsystem 3) network engine.
>>
>> Wei Hu (Xavier) (22):
>>   net/hns3: add hardware registers definition
>>   net/hns3: add some definitions for data structure and macro
>>   net/hns3: register hns3 PMD driver
>>   net/hns3: add support for cmd of hns3 PMD driver
>>   net/hns3: add the initialization of hns3 PMD driver
>>   net/hns3: add support for MAC address related operations
>>   net/hns3: add support for some misc operations
>>   net/hns3: add support for link update operation
>>   net/hns3: add support for flow directory of hns3 PMD driver
>>   net/hns3: add support for RSS of hns3 PMD driver
>>   net/hns3: add support for flow control of hns3 PMD driver
>>   net/hns3: add support for VLAN of hns3 PMD driver
>>   net/hns3: add support for mailbox of hns3 PMD driver
>>   net/hns3: add support for hns3 VF PMD driver
>>   net/hns3: add package and queue related operation
>>   net/hns3: add start stop configure promiscuous ops
>>   net/hns3: add dump register ops for hns3 PMD driver
>>   net/hns3: add abnormal interrupt process for hns3 PMD driver
>>   net/hns3: add stats related ops for hns3 PMD driver
>>   net/hns3: add reset related process for hns3 PMD driver
>>   net/hns3: add multiple process support for hns3 PMD driver
>>   net/hns3: add hns3 build files
>>
> There are some build error for 32-bit [1], I am aware that 32-bit is not in the
> supported arch list, but build error are just related to the log format
> identifiers, it is good practice to use 'PRIx64' and friends which will also fix
> the build issue.
>
> [1]
> In file included from .../drivers/net/hns3/hns3_regs.c:35:
>
>
>
> .../drivers/net/hns3/hns3_regs.c: In function ‘hns3_get_32_bit_regs’:
>
>
>
> .../drivers/net/hns3/hns3_logs.h:16:38: error: format ‘%ld’ expects argument of
> type ‘long int’, but argument 6 has type ‘unsigned int’ [-Werror=format=]
>
>
>    16 |  rte_log(level, hns3_logtype_driver, "%s %s(): " fmt, \
>
>
>
>       |                                      ^~~~~~~~~~~
>
>
>
> .../drivers/net/hns3/hns3_logs.h:20:2: note: in expansion of macro
> ‘PMD_DRV_LOG_RAW’
>
>
>    20 |  PMD_DRV_LOG_RAW(hw, RTE_LOG_ERR, fmt "\n", ## args)
>
>
>
>       |  ^~~~~~~~~~~~~~~
>
>
>
> .../drivers/net/hns3/hns3_regs.c:177:3: note: in expansion of macro ‘hns3_err’
>
>
>
>   177 |   hns3_err(hw, "Failed to allocate %ld bytes needed to "
>
>
>
>       |   ^~~~~~~~
>
>
>
> .../drivers/net/hns3/hns3_regs.c:177:38: note: format string is defined here
>
>
>
>   177 |   hns3_err(hw, "Failed to allocate %ld bytes needed to "
>
>
>
>       |                                    ~~^
>
>
>
>       |                                      |
>
>
>
>       |                                      long int
>
>
>
>       |                                    %d
>
>
Hi, Ferruh Yigit

    Thanks for your suggestion.
    We will fix it in patch V2.

    Regards
Xavier