[PATCH v8 0/7] hinic3 change for support new SPx NIC

Stephen Hemminger stephen at networkplumber.org
Tue Mar 24 04:31:53 CET 2026


On Tue, 24 Mar 2026 09:55:03 +0800
Feifei Wang <wff_light at vip.163.com> wrote:

> From: Feifei Wang <wangfeifei40 at huawei.com>
> 
> Change hinic3 driver to support Huawei new SPx series NIC.
> 
> v2:
> --fix build issues
> 
> v3:
> --fix community review comments and err reports
> 
> v4:
> --fix rss type assignment error
> 
> v5:
> --fix community ubuntu-22.04-clang err
> 
> v6:
> --fix atomic compilation error
> 
> v6:
> --fix community review comments
> 
> v7:
> --fix htn/stn ops function name error
> --update doc/guides for hinic3 driver
> 
> v8:
> --fix guides grammar issue
> --fix rss_type.ipv6_ext = 0 error
> 
> Feifei Wang (7):
>   net/hinic3: add support for new SPx series NIC
>   net/hinic3: add enhance cmdq support for new SPx series NIC
>   net/hinic3: use different callback func to split new/old cmdq
>     operations
>   net/hinic3: add fun init ops to support Compact CQE
>   net/hinic3: add rx ops to support Compact CQE
>   net/hinic3: add tx ops to support Compact CQE
>   net/hinic3: use different callback func to support htn fdir
> 
>  doc/guides/nics/features/hinic3.ini           |  11 +-
>  doc/guides/nics/hinic3.rst                    |   5 +-
>  doc/guides/rel_notes/release_26_03.rst        |   8 +
>  drivers/net/hinic3/base/hinic3_cmd.h          |  80 ++-
>  drivers/net/hinic3/base/hinic3_cmdq.c         | 370 ++++------
>  drivers/net/hinic3/base/hinic3_cmdq.h         | 112 ++-
>  drivers/net/hinic3/base/hinic3_cmdq_enhance.c | 111 +++
>  drivers/net/hinic3/base/hinic3_cmdq_enhance.h | 125 ++++
>  drivers/net/hinic3/base/hinic3_csr.h          |  18 +-
>  drivers/net/hinic3/base/hinic3_hw_comm.c      |  15 +-
>  drivers/net/hinic3/base/hinic3_hw_comm.h      |  31 +-
>  drivers/net/hinic3/base/hinic3_hwdev.c        |  13 +-
>  drivers/net/hinic3/base/hinic3_hwdev.h        |  18 +
>  drivers/net/hinic3/base/hinic3_hwif.c         |  10 +-
>  drivers/net/hinic3/base/hinic3_mgmt.c         |   5 +-
>  drivers/net/hinic3/base/hinic3_mgmt.h         |   2 +
>  drivers/net/hinic3/base/hinic3_nic_cfg.c      | 182 ++---
>  drivers/net/hinic3/base/hinic3_nic_cfg.h      |  98 ++-
>  drivers/net/hinic3/base/meson.build           |   1 +
>  drivers/net/hinic3/hinic3_ethdev.c            | 275 ++++++--
>  drivers/net/hinic3/hinic3_ethdev.h            | 120 ++--
>  drivers/net/hinic3/hinic3_fdir.c              | 657 +++++++++++++-----
>  drivers/net/hinic3/hinic3_fdir.h              | 361 ++++++++--
>  drivers/net/hinic3/hinic3_nic_io.c            | 525 ++++++--------
>  drivers/net/hinic3/hinic3_nic_io.h            | 163 ++++-
>  drivers/net/hinic3/hinic3_rx.c                | 267 +++++--
>  drivers/net/hinic3/hinic3_rx.h                | 182 ++++-
>  drivers/net/hinic3/hinic3_tx.c                | 456 ++++++------
>  drivers/net/hinic3/hinic3_tx.h                | 154 +++-
>  .../net/hinic3/htn_adapt/hinic3_htn_cmdq.c    | 167 +++++
>  .../net/hinic3/htn_adapt/hinic3_htn_cmdq.h    |  63 ++
>  drivers/net/hinic3/htn_adapt/meson.build      |   7 +
>  drivers/net/hinic3/meson.build                |   8 +-
>  .../net/hinic3/stn_adapt/hinic3_stn_cmdq.c    | 151 ++++
>  .../net/hinic3/stn_adapt/hinic3_stn_cmdq.h    |  46 ++
>  drivers/net/hinic3/stn_adapt/meson.build      |   7 +
>  36 files changed, 3379 insertions(+), 1445 deletions(-)
>  create mode 100644 drivers/net/hinic3/base/hinic3_cmdq_enhance.c
>  create mode 100644 drivers/net/hinic3/base/hinic3_cmdq_enhance.h
>  create mode 100644 drivers/net/hinic3/htn_adapt/hinic3_htn_cmdq.c
>  create mode 100644 drivers/net/hinic3/htn_adapt/hinic3_htn_cmdq.h
>  create mode 100644 drivers/net/hinic3/htn_adapt/meson.build
>  create mode 100644 drivers/net/hinic3/stn_adapt/hinic3_stn_cmdq.c
>  create mode 100644 drivers/net/hinic3/stn_adapt/hinic3_stn_cmdq.h
>  create mode 100644 drivers/net/hinic3/stn_adapt/meson.build
> 

Here is list of places identified by AI that use rte_zmalloc but
may not need to.

Places where rte_zmalloc is used but not needed in hinic3 driver.

rte_zmalloc allocates from hugepage memory. It should only be used
when the memory will be accessed by DMA, shared between primary and
secondary DPDK processes, or requires specific NUMA node placement.
For ordinary control-plane data structures, standard calloc/free
is faster and does not consume limited hugepage resources.

The following allocations are pure software bookkeeping and do not
require hugepage memory:

Temporary buffers (allocated and freed in the same function):
  hinic3_rx.c: hinic3_refill_indir_rqid() - indir_tbl array
  hinic3_nic_cfg.c: hinic3_get_phy_port_stats() - port_stats struct

Command queue bookkeeping:
  hinic3_cmdq.c: hinic3_alloc_cmd_buf() - cmd_buf wrapper struct
  hinic3_cmdq.c: init_cmdq() - cmdq->errcode array
  hinic3_cmdq.c: init_cmdq() - cmdq->cmd_infos array
  hinic3_cmdq.c: hinic3_init_cmdqs() - cmdqs struct
  hinic3_cmdq.c: hinic3_init_cmdqs() - cmdqs->saved_wqs array

Event queue tracking arrays (track DMA pages but are not DMA'd):
  hinic3_eqs.c: alloc_eq_pages() - eq->dma_addr array
  hinic3_eqs.c: alloc_eq_pages() - eq->virt_addr array
  hinic3_eqs.c: alloc_eq_pages() - eq->eq_mz array
  hinic3_eqs.c: hinic3_aeqs_init() - aeqs struct

Mailbox and management channel buffers:
  hinic3_mbox.c: init_mbox_info() - mbox_info->mbox buffer
  hinic3_mbox.c: init_mbox_info() - mbox_info->buf_out buffer
  hinic3_mbox.c: hinic3_func_to_func_init() - func_to_func struct
  hinic3_mgmt.c: alloc_recv_msg() - recv_msg->msg buffer (x2)
  hinic3_mgmt.c: alloc_msg_buf() - mgmt_ack_buf buffer
  hinic3_mgmt.c: hinic3_pf_to_mgmt_init() - pf_to_mgmt struct

Configuration and control structs:
  hinic3_hw_cfg.c: init_cfg_mgmt() - cfg_mgmt struct
  hinic3_hwdev.c: hinic3_init_comm_ch() - chip_fault_stats buffer
  hinic3_hwif.c: hinic3_hwif_res_init() - hwif struct
  hinic3_ethdev.c: hinic3_init_sw_rxtxqs() - txqs pointer array
  hinic3_ethdev.c: hinic3_init_sw_rxtxqs() - rxqs pointer array
  hinic3_ethdev.c: hinic3_func_init() - hwdev struct
  hinic3_ethdev.c: hinic3_func_init() - mc_list MAC address array
  hinic3_ethdev.c: hinic3_enable_interrupt() - intr_vec array

Flow director and flow API:
  hinic3_fdir.c: hinic3_alloc_dynamic_block_resource() - tcam block
  hinic3_fdir.c: hinic3_add_tcam_filter() - tcam_filter struct
  hinic3_flow.c: hinic3_flow_create() - filter_rules struct
  hinic3_flow.c: hinic3_flow_create() - flow struct

New allocations added by this patch series:
  hinic3_ethdev.c: hinic3_func_init() - cmdq_ops table
  hinic3_ethdev.c: hinic3_func_init() - rx_ops table
  hinic3_ethdev.c: hinic3_func_init() - tx_ops table

Note: eth_dev->data->mac_addrs must remain rte_zmalloc because the
ethdev framework frees it with rte_free. The rte_zmalloc_socket
calls for rxq, txq, rx_info, and tx_info are correct because those
are hot-path queue structures that benefit from NUMA-local placement.


More information about the dev mailing list