net: hinic3: Add a driver for Huawei 3rd gen NIC
Subsystems (4)
cover net: hinic3: Add a driver for Huawei 3rd gen NIC
The patch-set contains driver for Huawei's 3rd generation HiNIC Ethernet device that will be available in the future.
This is an SRIOV device, designed for data centers. The driver supports both PFs and VFs.
gongfan (1):
net: hinic3: Add a driver for Huawei 3rd gen NIC
.../device_drivers/ethernet/huawei/hinic3.rst | 126 ++ MAINTAINERS | 7 + drivers/net/ethernet/huawei/Kconfig | 1 + drivers/net/ethernet/huawei/Makefile | 1 + drivers/net/ethernet/huawei/hinic3/Kconfig | 16 + drivers/net/ethernet/huawei/hinic3/Makefile | 27 + .../net/ethernet/huawei/hinic3/hinic3_cmdq.c | 1196 +++++++++++++++ .../net/ethernet/huawei/hinic3/hinic3_cmdq.h | 184 +++ .../ethernet/huawei/hinic3/hinic3_common.c | 105 ++ .../ethernet/huawei/hinic3/hinic3_common.h | 57 + .../net/ethernet/huawei/hinic3/hinic3_csr.h | 85 ++ .../net/ethernet/huawei/hinic3/hinic3_eqs.c | 914 +++++++++++ .../net/ethernet/huawei/hinic3/hinic3_eqs.h | 152 ++ .../ethernet/huawei/hinic3/hinic3_ethtool.c | 1340 +++++++++++++++++ .../ethernet/huawei/hinic3/hinic3_filter.c | 405 +++++ .../ethernet/huawei/hinic3/hinic3_hw_cfg.c | 475 ++++++ .../ethernet/huawei/hinic3/hinic3_hw_cfg.h | 102 ++ .../ethernet/huawei/hinic3/hinic3_hw_comm.c | 632 ++++++++ .../ethernet/huawei/hinic3/hinic3_hw_comm.h | 50 + .../ethernet/huawei/hinic3/hinic3_hw_intf.h | 316 ++++ .../net/ethernet/huawei/hinic3/hinic3_hwdev.c | 736 +++++++++ .../net/ethernet/huawei/hinic3/hinic3_hwdev.h | 117 ++ .../net/ethernet/huawei/hinic3/hinic3_hwif.c | 576 +++++++ .../net/ethernet/huawei/hinic3/hinic3_hwif.h | 125 ++ .../net/ethernet/huawei/hinic3/hinic3_irq.c | 324 ++++ .../net/ethernet/huawei/hinic3/hinic3_lld.c | 503 +++++++ .../net/ethernet/huawei/hinic3/hinic3_lld.h | 19 + .../net/ethernet/huawei/hinic3/hinic3_main.c | 691 +++++++++ .../net/ethernet/huawei/hinic3/hinic3_mbox.c | 1054 +++++++++++++ .../net/ethernet/huawei/hinic3/hinic3_mbox.h | 158 ++ .../net/ethernet/huawei/hinic3/hinic3_mgmt.c | 358 +++++ .../net/ethernet/huawei/hinic3/hinic3_mgmt.h | 78 + .../huawei/hinic3/hinic3_mgmt_interface.h | 389 +++++ .../huawei/hinic3/hinic3_netdev_ops.c | 951 ++++++++++++ .../ethernet/huawei/hinic3/hinic3_nic_cfg.c | 808 ++++++++++ .../ethernet/huawei/hinic3/hinic3_nic_cfg.h | 471 ++++++ .../ethernet/huawei/hinic3/hinic3_nic_dev.h | 213 +++ .../ethernet/huawei/hinic3/hinic3_nic_io.c | 897 +++++++++++ .../ethernet/huawei/hinic3/hinic3_nic_io.h | 155 ++ .../huawei/hinic3/hinic3_pci_id_tbl.h | 11 + .../huawei/hinic3/hinic3_queue_common.c | 66 + .../huawei/hinic3/hinic3_queue_common.h | 51 + .../net/ethernet/huawei/hinic3/hinic3_rss.c | 873 +++++++++++ .../net/ethernet/huawei/hinic3/hinic3_rss.h | 33 + .../net/ethernet/huawei/hinic3/hinic3_rx.c | 735 +++++++++ .../net/ethernet/huawei/hinic3/hinic3_rx.h | 174 +++ .../net/ethernet/huawei/hinic3/hinic3_tx.c | 881 +++++++++++ .../net/ethernet/huawei/hinic3/hinic3_tx.h | 182 +++ .../net/ethernet/huawei/hinic3/hinic3_wq.c | 142 ++ .../net/ethernet/huawei/hinic3/hinic3_wq.h | 96 ++ 50 files changed, 18058 insertions(+) create mode 100644 Documentation/networking/device_drivers/ethernet/huawei/hinic3.rst create mode 100644 drivers/net/ethernet/huawei/hinic3/Kconfig create mode 100644 drivers/net/ethernet/huawei/hinic3/Makefile create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.h create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_common.c create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_common.h create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_csr.h create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_eqs.c create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_eqs.h create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_ethtool.c create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_filter.c create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_hw_cfg.c create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_hw_cfg.h create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_hw_comm.c create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_hw_comm.h create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_hw_intf.h create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_hwdev.c create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_hwdev.h create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_hwif.c create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_hwif.h create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_irq.c create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_lld.c create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_lld.h create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_main.c create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_mbox.c create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_mbox.h create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_mgmt.c create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_mgmt.h create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_mgmt_interface.h create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_netdev_ops.c create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_nic_cfg.c create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_nic_cfg.h create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_nic_dev.h create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.c create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.h create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_pci_id_tbl.h create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_queue_common.c create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_queue_common.h create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_rss.c create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_rss.h create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_rx.c create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_rx.h create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_tx.c create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_tx.h create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_wq.c create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_wq.h
base-commit: b8ee7a11c75436b85fa1641aa5f970de0f8a575c
Signature · 1 line
2.45.2
RFC 1/1 net: hinic3: Add a driver for Huawei 3rd gen NIC
From: gongfan <[email protected]>
The patch-set contains driver for Huawei's 3rd generation HiNIC Ethernet device that will be available in the future.
This is an SRIOV device, designed for data centers. The driver supports both PFs and VFs.
More detail in device documentation:Documentation/networking/device_drivers/ethernet/huawei/hinic3.rst
--- .../device_drivers/ethernet/huawei/hinic3.rst | 126 ++ MAINTAINERS | 7 + drivers/net/ethernet/huawei/Kconfig | 1 + drivers/net/ethernet/huawei/Makefile | 1 + drivers/net/ethernet/huawei/hinic3/Kconfig | 16 + drivers/net/ethernet/huawei/hinic3/Makefile | 27 + .../net/ethernet/huawei/hinic3/hinic3_cmdq.c | 1196 +++++++++++++++ .../net/ethernet/huawei/hinic3/hinic3_cmdq.h | 184 +++ .../ethernet/huawei/hinic3/hinic3_common.c | 105 ++ .../ethernet/huawei/hinic3/hinic3_common.h | 57 + .../net/ethernet/huawei/hinic3/hinic3_csr.h | 85 ++ .../net/ethernet/huawei/hinic3/hinic3_eqs.c | 914 +++++++++++ .../net/ethernet/huawei/hinic3/hinic3_eqs.h | 152 ++ .../ethernet/huawei/hinic3/hinic3_ethtool.c | 1340 +++++++++++++++++ .../ethernet/huawei/hinic3/hinic3_filter.c | 405 +++++ .../ethernet/huawei/hinic3/hinic3_hw_cfg.c | 475 ++++++ .../ethernet/huawei/hinic3/hinic3_hw_cfg.h | 102 ++ .../ethernet/huawei/hinic3/hinic3_hw_comm.c | 632 ++++++++ .../ethernet/huawei/hinic3/hinic3_hw_comm.h | 50 + .../ethernet/huawei/hinic3/hinic3_hw_intf.h | 316 ++++ .../net/ethernet/huawei/hinic3/hinic3_hwdev.c | 736 +++++++++ .../net/ethernet/huawei/hinic3/hinic3_hwdev.h | 117 ++ .../net/ethernet/huawei/hinic3/hinic3_hwif.c | 576 +++++++ .../net/ethernet/huawei/hinic3/hinic3_hwif.h | 125 ++ .../net/ethernet/huawei/hinic3/hinic3_irq.c | 324 ++++ .../net/ethernet/huawei/hinic3/hinic3_lld.c | 503 +++++++ .../net/ethernet/huawei/hinic3/hinic3_lld.h | 19 + .../net/ethernet/huawei/hinic3/hinic3_main.c | 691 +++++++++ .../net/ethernet/huawei/hinic3/hinic3_mbox.c | 1054 +++++++++++++ .../net/ethernet/huawei/hinic3/hinic3_mbox.h | 158 ++ .../net/ethernet/huawei/hinic3/hinic3_mgmt.c | 358 +++++ .../net/ethernet/huawei/hinic3/hinic3_mgmt.h | 78 + .../huawei/hinic3/hinic3_mgmt_interface.h | 389 +++++ .../huawei/hinic3/hinic3_netdev_ops.c | 951 ++++++++++++ .../ethernet/huawei/hinic3/hinic3_nic_cfg.c | 808 ++++++++++ .../ethernet/huawei/hinic3/hinic3_nic_cfg.h | 471 ++++++ .../ethernet/huawei/hinic3/hinic3_nic_dev.h | 213 +++ .../ethernet/huawei/hinic3/hinic3_nic_io.c | 897 +++++++++++ .../ethernet/huawei/hinic3/hinic3_nic_io.h | 155 ++ .../huawei/hinic3/hinic3_pci_id_tbl.h | 11 + .../huawei/hinic3/hinic3_queue_common.c | 66 + .../huawei/hinic3/hinic3_queue_common.h | 51 + .../net/ethernet/huawei/hinic3/hinic3_rss.c | 873 +++++++++++ .../net/ethernet/huawei/hinic3/hinic3_rss.h | 33 + .../net/ethernet/huawei/hinic3/hinic3_rx.c | 735 +++++++++ .../net/ethernet/huawei/hinic3/hinic3_rx.h | 174 +++ .../net/ethernet/huawei/hinic3/hinic3_tx.c | 881 +++++++++++ .../net/ethernet/huawei/hinic3/hinic3_tx.h | 182 +++ .../net/ethernet/huawei/hinic3/hinic3_wq.c | 142 ++ .../net/ethernet/huawei/hinic3/hinic3_wq.h | 96 ++ 50 files changed, 18058 insertions(+)
Documentation/networking/device_drivers/ethernet/huawei/hinic3.rst new file +126 -0
@@ -0,0 +1,126 @@ +.. SPDX-License-Identifier: GPL-2.0 + +===================================================================== +Linux kernel driver for Huawei Ethernet Device Driver (hinic3) family +===================================================================== + +Overview +======== + +The hinic3 is a network interface card(NIC) for Data Center. It supports +a range of link-speed devices (10GE, 25GE, 100GE, etc.). The hinic3 +devices can have multiple physical forms (LOM NIC, PCIe standard NIC, +OCP NIC etc.). + +The hinic3 driver supports the following features: +- IPv4/IPv6 TCP/UDP checksum offload +- TSO (TCP Segmentation Offload), LRO (Large Receive Offload) +- RSS (Receive Side Scaling) +- MSI-X interrupt aggregation configuration and interrupt adaptation. +- SR-IOV (Single Root I/O Virtualization). + +Content +======= + +- Supported PCI vendor ID/device IDs +- Source Code Structure of Hinic3 Driver +- Management Interface + +Supported PCI vendor ID/device IDs +================================== + +19e5:0222 - hinic3 PF/PPF +19e5:375F - hinic3 VF + +Prime Physical Function (PPF) is responsible for the management of the +whole NIC card. For example, clock synchronization between the NIC and +the host. +Any PF may serve as a PPF. The PPF is selected dynamically. + +Source Code Structure of Hinic3 Driver +====================================== + +======================== ================================================ +hinic3_pci_id_tbl.h Supported device IDs. +hinic3_hw_intf.h Interface between HW and driver. +hinic3_queue_common.[ch] Common structures and methods for NIC queues. +hinic3_common.[ch] Encapsulation of memory operations in Linux. +hinic3_csr.h Register definitions in the BAR. +hinic3_hwif.[ch] Interface for BAR. +hinic3_eqs.[ch] Interface for AEQs and CEQs. +hinic3_mbox.[ch] Interface for mailbox. +hinic3_mgmt.[ch] Management interface based on mailbox and AEQ. +hinic3_wq.[ch] Work queue data structures and interface. +hinic3_cmdq.[ch] Command queue is used to post command to HW. +hinic3_hwdev.[ch] HW structures and methods abstractions. +hinic3_lld.[ch] Auxiliary driver adaptation layer. +hinic3_hw_comm.[ch] Interface for common HW operations. +hinic3_mgmt_interface.h Interface between firmware and driver. +hinic3_hw_cfg.[ch] Interface for HW configuration. +hinic3_irq.c Interrupt request +hinic3_netdev_ops.c Operations registered to Linux kernel stack. +hinic3_nic_dev.h NIC structures and methods abstractions. +hinic3_main.c Main Linux kernel driver. +hinic3_nic_cfg.[ch] NIC service configuration. +hinic3_nic_io.[ch] Management plane interface for TX and RX. +hinic3_rss.[ch] Interface for Receive Side Scaling (RSS). +hinic3_rx.[ch] Interface for transmit. +hinic3_tx.[ch] Interface for receive. +hinic3_ethtool.c Interface for ethtool operations (ops). +hinic3_filter.c Interface for mac address. +======================== ================================================ + +Management Interface +==================== + +Asynchronous Event Queue (AEQ) +------------------------------ + +AEQ receives high priority events from the HW over a descriptor queue. +Every descriptor is a fixed size of 64 bytes. AEQ can receive solicited or +unsolicited events. Every device, VF or PF, can have up to 4 AEQs. +Every AEQ is associated to a dedicated IRQ. AEQ can receive multiple types +of events, but in practice the hinic3 driver ignores all events except for +2 mailbox related events. + +MailBox +------- + +Mailbox is a communication mechanism between the hinic3 driver and the HW. +Each device has an independent mailbox. Driver can use the mailbox to send +requests to management. Driver receives mailbox messages, such as responses +to requests, over the AEQ (using event HINIC3_AEQ_FOR_MBOX). Due to the +limited size of mailbox data register, mailbox messages are sent +segment-by-segment. + +Every device can use its mailbox to post request to firmware. The mailbox +can also be used to post requests and responses between the PF and its VFs. + +Completion Event Queue (CEQ) +-------------------------- + +The implementation of CEQ is the same as AEQ. It receives completion events +form HW over a fixed size descriptor of 32 bits. Every device can have up +to 32 CEQs. Every CEQ has a dedicated IRQ. CEQ only receives solicited +events that are responses to requests from the driver. CEQ can receive +multiple types of events, but in practice the hinic3 driver ignores all +events except for HINIC3_CMDQ that represents completion of previously +posted commands on a cmdq. + +Command Queue (cmdq) +-------------------- + +Every cmdq has a dedicated work queue on which commands are posted. +Commands on the work queue are fixed size descriptor of size 64 bytes. +Completion of a command will be indicated using ctrl bits in the +descriptor that carried the command. Notification of command completions +will also be provided via event on CEQ. Every device has 4 command queues +that are initialized as a set (called cmdqs), each with its own type. +Hinic3 driver only uses type HINIC3_CMDQ_SYNC. + +Work Queues(WQ) +--------------- + +Work queues are logical arrays of fixed size WQEs. The array may be spread +over multiple non-contiguous pages using indirection table. +Work queues are used by I/O queues and command queues.
MAINTAINERS +7 -0
@@ -10486,6 +10486,13 @@ S: Maintained F: Documentation/networking/device_drivers/ethernet/huawei/hinic.rst F: drivers/net/ethernet/huawei/hinic/ +HUAWEI 3RD GEN ETHERNET DRIVER +M: gongfan <[email protected]> +L: [email protected] +S: Supported +F: Documentation/networking/device_drivers/ethernet/huawei/hinic3.rst +F: drivers/net/ethernet/huawei/hinic3/ + HUGETLB SUBSYSTEM M: Muchun Song <[email protected]> L: [email protected]
drivers/net/ethernet/huawei/Kconfig +1 -0
@@ -16,5 +16,6 @@ config NET_VENDOR_HUAWEI if NET_VENDOR_HUAWEI source "drivers/net/ethernet/huawei/hinic/Kconfig" +source "drivers/net/ethernet/huawei/hinic3/Kconfig" endif # NET_VENDOR_HUAWEI
drivers/net/ethernet/huawei/Makefile +1 -0
@@ -4,3 +4,4 @@ # obj-$(CONFIG_HINIC) += hinic/ +obj-$(CONFIG_HINIC3) += hinic3/
drivers/net/ethernet/huawei/hinic3/Kconfig new file +16 -0
@@ -0,0 +1,16 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Huawei driver configuration +# + +config HINIC3 + tristate "Huawei Intelligent Network Interface Card 3rd" + # Fields of HW and management structures are little endian and will not + # be explicitly converted + depends on !CPU_BIG_ENDIAN + depends on PCI_MSI && (X86 || ARM64) + help + This driver supports HiNIC PCIE Ethernet cards. + To compile this driver as part of the kernel, choose Y here. + If unsure, choose N. + The default is N.
drivers/net/ethernet/huawei/hinic3/Makefile new file +27 -0
@@ -0,0 +1,27 @@ +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) Huawei Technologies Co., Ltd. 2024. All rights reserved. + +obj-$(CONFIG_HINIC3) += hinic3.o + +hinic3-objs := hinic3_hwdev.o \ + hinic3_lld.o \ + hinic3_common.o \ + hinic3_hwif.o \ + hinic3_hw_cfg.o \ + hinic3_eqs.o \ + hinic3_queue_common.o \ + hinic3_mbox.o \ + hinic3_mgmt.o \ + hinic3_hw_comm.o \ + hinic3_wq.o \ + hinic3_cmdq.o \ + hinic3_nic_io.o \ + hinic3_nic_cfg.o \ + hinic3_tx.o \ + hinic3_rx.o \ + hinic3_netdev_ops.o \ + hinic3_irq.o \ + hinic3_rss.o \ + hinic3_filter.o \ + hinic3_ethtool.o \ + hinic3_main.o
drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c new file +1196 -0
1,196 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.h new file +184 -0
184 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_common.c new file +105 -0
105 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_common.h new file +57 -0
57 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_csr.h new file +85 -0
85 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_eqs.c new file +914 -0
914 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_eqs.h new file +152 -0
152 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_ethtool.c new file +1340 -0
114 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_filter.c new file +405 -0
405 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_hw_cfg.c new file +475 -0
475 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_hw_cfg.h new file +102 -0
102 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_hw_comm.c new file +632 -0
632 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_hw_comm.h new file +50 -0
50 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_hw_intf.h new file +316 -0
316 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_hwdev.c new file +736 -0
736 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_hwdev.h new file +117 -0
117 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_hwif.c new file +576 -0
576 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_hwif.h new file +125 -0
125 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_irq.c new file +324 -0
324 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_lld.c new file +503 -0
503 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_lld.h new file +19 -0
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/huawei/hinic3/hinic3_main.c new file +691 -0
691 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_mbox.c new file +1054 -0
1,054 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_mbox.h new file +158 -0
158 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_mgmt.c new file +358 -0
358 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_mgmt.h new file +78 -0
78 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_mgmt_interface.h new file +389 -0
389 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_netdev_ops.c new file +951 -0
951 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_nic_cfg.c new file +808 -0
808 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_nic_cfg.h new file +471 -0
471 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_nic_dev.h new file +213 -0
213 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.c new file +897 -0
897 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.h new file +155 -0
155 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_pci_id_tbl.h new file +11 -0
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/huawei/hinic3/hinic3_queue_common.c new file +66 -0
66 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_queue_common.h new file +51 -0
51 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_rss.c new file +873 -0
873 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_rss.h new file +33 -0
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/huawei/hinic3/hinic3_rx.c new file +735 -0
735 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_rx.h new file +174 -0
174 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_tx.c new file +881 -0
881 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_tx.h new file +182 -0
182 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_wq.c new file +142 -0
142 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic3/hinic3_wq.h new file +96 -0
96 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.45.2
Part of the diff is not shown here. View the raw message.
Jakub Kicinski
maintainerQuoted 1 line · On Wed, 30 Oct 2024 14:25:47 +0200 Gur Stavi wrote:
50 files changed, 18058 insertions(+)
4kLoC is the right ballpark to target for the initial submission. Please cut this down and submit a minimal driver, then add the features.
Quoted 6 lines · On Wed, 30 Oct 2024 14:25:47 +0200 Gur Stavi wrote:
Quoted 1 line
50 files changed, 18058 insertions(+)4kLoC is the right ballpark to target for the initial submission. Please cut this down and submit a minimal driver, then add the features.
Ack.
There is indeed code which is not critical to basic Ethernet functionality that can be postponed to later.
Our HW management infrastructure is rather large and contains 2 separate mechanisms (cmdq+mbox). While I hope we can trim the driver to a VF-only version with no ethtool support that will fit the 10KLoC ballpark, the 4KLoC goal is probably unrealistic for a functional driver.
Is it valid to submit a non-functional kernel module and make it functional with follow-up submissions? For example:
Submission 1: TX+RX logic
Submission 2: Device management infrastructure
Submission 3: PCI device registration and netdev creation
Some initial submission cases we studied before our submission:
Amazon/ena: 10858 insertions
https://lore.kernel.org/netdev/1470827002-23081-1-git-send-email-netanel@ann
apurnalabs.com/
Microsoft/mana: 6168 insertions
https://lore.kernel.org/netdev/[email protected]/
Huawei/hinic: 12728 insertions
https://lore.kernel.org/netdev/[email protected]
m/
Quoted 7 lines · Gur Stavi
Quoted 6 lines · On Wed, 30 Oct 2024 14:25:47 +0200 Gur Stavi wrote:
Quoted 1 line
50 files changed, 18058 insertions(+)4kLoC is the right ballpark to target for the initial submission. Please cut this down and submit a minimal driver, then add the features.
Quoted 8 lines
Ack.
There is indeed code which is not critical to basic Ethernet functionality that can be postponed to later.Our HW management infrastructure is rather large and contains 2 separate mechanisms (cmdq+mbox). While I hope we can trim the driver to a VF-only version with no ethtool support that will fit the 10KLoC ballpark, the 4KLoC goal is probably unrealistic for a functional driver.
It is really all about making you code attractive to reviewers. No reviewer is likely to have time to review a single 10KLoc patch. A reviewer is more likely to look at the code if it is broken up into 15 smaller patches, each one which can be reviewed in a coffee break etc. Also, reviewers have interests. I personally have no interest in mailbox APIs, actually moving frames around, etc. I want to easily find the ethtool code, have you got pause wrong like nearly everybody does, are the statistics correctly broken up into the standard groups, are you abusing debugfs? Having little patches with good subject lines will draw me towards the patches i want to review.
10KLoC is still on the large size. Can you throw VF out, it is just a plain borring single function device, like the good old e1000e?
Andrew
Quoted 15 lines · Gur Stavi
Quoted 9 lines
Quoted 6 lines · On Wed, 30 Oct 2024 14:25:47 +0200 Gur Stavi wrote:
Quoted 1 line
50 files changed, 18058 insertions(+)4kLoC is the right ballpark to target for the initial submission. Please cut this down and submit a minimal driver, then add the features.
Ack.
There is indeed code which is not critical to basic Ethernetfunctionality
Quoted 3 lines
that can be postponed to later.
Our HW management infrastructure is rather large and contains 2
separate
Quoted 8 lines
Quoted 1 line
mechanisms (cmdq+mbox). While I hope we can trim the driver to a VF-
only
Quoted 1 line
version with no ethtool support that will fit the 10KLoC ballpark, the
4KLoC
Quoted 1 line
goal is probably unrealistic for a functional driver.
It is really all about making you code attractive to reviewers. No reviewer is likely to have time to review a single 10KLoc patch. A
The minimal work for a functional Ethernet driver when responding to probe is:
1. Initialize device management
2. Create IO queues using device management
3. Register interrupts
4. Create netdev on top of the io queues
5. Handle TX+RX
At the moment, just our TX+RX code is ~4KLoC.
Quoted 2 lines
reviewer is more likely to look at the code if it is broken up into 15 smaller patches, each one which can be reviewed in a coffee break
We can obviously break a larger submission into multiple patches if requested.
But when researching we saw a comment from David that indicated that there is no advantage in that for initial submissions.
https://lore.kernel.org/netdev/20170817.220343.905568389038615738.davem@dave
mloft.net/
Quote:
"And this is a fine way to add a huge new driver (although not my personal preference)."
Breaking a 10KLoC submission into a few 4KLcC (or less) patches helps to review specific patches (and ignore other patches) but all lines still need to be approved at once so someone must review them.
Breaking 10KLoC into multiple submissions is easier to review and approve (in parts), but merged code will be non-functional until the last submission.
It will compile fine, do no harm, and nobody will pick it except for allyes builds.
Quoted 4 lines
etc. Also, reviewers have interests. I personally have no interest in mailbox APIs, actually moving frames around, etc. I want to easily find the ethtool code, have you got pause wrong like nearly everybody does, are the statistics correctly broken up into the standard groups,
To properly review (error prone) pause it would be better to remove it from initial submission and add it in a later dedicated submission.
Quoted 5 lines
are you abusing debugfs? Having little patches with good subject lines will draw me towards the patches i want to review.
10KLoC is still on the large size. Can you throw VF out, it is just a plain borring single function device, like the good old e1000e?
VF driver is just like good old e1000e NIC. It is a driver that registers A single PCI vid:did, "unaware" that its part of SRIOV, and performs the initialization sequence described above when probed.
Quoted 2 lines
Andrew
Quoted 2 lines
To properly review (error prone) pause it would be better to remove it from initial submission and add it in a later dedicated submission.
Not really. It should be in a patch titled ethtool, so it is easy to find. And since i've pointed out most drivers get it wrong, you will assume you also have it wrong, assign a developer to go read the discussion on the netdev list where i point out drivers which get it wrong and what is the correct implementation, your developer will then fixup your code if needed, and all i need to do is confirm you got it right. Or shake my head and say despite the warning, it is still wrong.
Andrew
Jakub Kicinski
maintainerQuoted 9 lines · On Sun, 3 Nov 2024 22:17:55 +0200 Gur Stavi wrote:
Breaking a 10KLoC submission into a few 4KLcC (or less) patches helps to review specific patches (and ignore other patches) but all lines still need to be approved at once so someone must review them.
Breaking 10KLoC into multiple submissions is easier to review and approve (in parts), but merged code will be non-functional until the last submission.
It will compile fine, do no harm, and nobody will pick it except for allyes builds.
The driver not being fully functional after the first submission is fine.
This is a better example, although some parts could have still be delayed to the second chunk:
kernel test robot
build botkernel test robot noticed the following build warnings:
Hi Gur,
[This is a private test report for your RFC patch.] kernel test robot noticed the following build warnings:
[auto build test WARNING on b8ee7a11c75436b85fa1641aa5f970de0f8a575c]
url: https://github.com/intel-lab-lkp/linux/commits/Gur-Stavi/net-hinic3-Add-a-driver-for-Huawei-3rd-gen-NIC/20241030-201518 base: b8ee7a11c75436b85fa1641aa5f970de0f8a575c patch link: https://lore.kernel.org/r/ebb0fefe47c29ffed5af21d6bd39d19c2bcddd9c.1730290527.git.gur.stavi%40huawei.com patch subject: [RFC net-next v01 1/1] net: hinic3: Add a driver for Huawei 3rd gen NIC config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20241102/[email protected]/config) compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241102/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
In file included from drivers/net/ethernet/huawei/hinic3/hinic3_rx.c:7:
In file included from include/linux/skbuff.h:17:
In file included from include/linux/bvec.h:10:
In file included from include/linux/highmem.h:8:
In file included from include/linux/cacheflush.h:5:
In file included from arch/x86/include/asm/cacheflush.h:5:
In file included from include/linux/mm.h:2213:
include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
504 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
505 | item];
| ~~~~
include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
511 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
512 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
518 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
524 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
525 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic3/hinic3_rx.c:146:6: warning: variable 'cqe_len' set but not used [-Wunused-but-set-variable]
146 | int cqe_len;
| ^
>> drivers/net/ethernet/huawei/hinic3/hinic3_rx.c:333:5: warning: variable 'frag_num' set but not used [-Wunused-but-set-variable]
333 | u8 frag_num = 0;
| ^
drivers/net/ethernet/huawei/hinic3/hinic3_rx.c:493:25: warning: variable 'nic_dev' set but not used [-Wunused-but-set-variable]
493 | struct hinic3_nic_dev *nic_dev;
| ^7 warnings generated.
vim +/frag_num +333 drivers/net/ethernet/huawei/hinic3/hinic3_rx.c
137
138 /* Associate fixed completion element to every wqe in the rq. Every rq wqe will
139 * always post completion to the same place.
140 */
141 static void rq_associate_cqes(struct hinic3_rxq *rxq)
142 {
143 struct hinic3_queue_pages *qpages;
144 struct hinic3_rq_wqe *rq_wqe;
145 dma_addr_t cqe_dma;
> 146 int cqe_len;
147 u32 i;
148
149 /* unit of cqe length is 16B */
150 cqe_len = sizeof(struct hinic3_rq_cqe) >> HINIC3_CQE_SIZE_SHIFT;
151 qpages = &rxq->rq->wq.qpages;
152
153 for (i = 0; i < rxq->q_depth; i++) {
154 rq_wqe = get_q_element(qpages, i, NULL);
155 cqe_dma = rxq->cqe_start_paddr + i * sizeof(struct hinic3_rq_cqe);
156 rq_wqe->cqe_hi_addr = upper_32_bits(cqe_dma);
157 rq_wqe->cqe_lo_addr = lower_32_bits(cqe_dma);
158 }
159 }
160
161 static void rq_wqe_buff_set(struct hinic3_io_queue *rq, uint32_t wqe_idx,
162 dma_addr_t dma_addr, u16 len)
163 {
164 struct hinic3_rq_wqe *rq_wqe;
165
166 rq_wqe = get_q_element(&rq->wq.qpages, wqe_idx, NULL);
167 rq_wqe->buf_hi_addr = upper_32_bits(dma_addr);
168 rq_wqe->buf_lo_addr = lower_32_bits(dma_addr);
169 }
170
171 static u32 hinic3_rx_fill_buffers(struct hinic3_rxq *rxq)
172 {
173 struct net_device *netdev = rxq->netdev;
174 u32 i, free_wqebbs = rxq->delta - 1;
175 struct hinic3_nic_dev *nic_dev;
176 struct hinic3_rx_info *rx_info;
177 dma_addr_t dma_addr;
178 int err;
179
180 nic_dev = netdev_priv(netdev);
181 for (i = 0; i < free_wqebbs; i++) {
182 rx_info = &rxq->rx_info[rxq->next_to_update];
183
184 err = rx_alloc_mapped_page(netdev, rx_info);
185 if (unlikely(err)) {
186 RXQ_STATS_INC(rxq, alloc_rx_buf_err);
187 break;
188 }
189
190 dma_addr = rx_info->buf_dma_addr + rx_info->page_offset;
191 rq_wqe_buff_set(rxq->rq, rxq->next_to_update, dma_addr,
192 nic_dev->rx_buff_len);
193 rxq->next_to_update = (u16)((rxq->next_to_update + 1) & rxq->q_mask);
194 }
195
196 if (likely(i)) {
197 hinic3_write_db(rxq->rq, rxq->q_id & 3, RQ_CFLAG_DP,
198 rxq->next_to_update << HINIC3_NORMAL_RQ_WQE);
199 rxq->delta -= i;
200 rxq->next_to_alloc = rxq->next_to_update;
201 } else if (free_wqebbs == rxq->q_depth - 1) {
202 RXQ_STATS_INC(rxq, rx_buf_empty);
203 }
204
205 return i;
206 }
207
208 static u32 hinic3_rx_alloc_buffers(struct net_device *netdev, u32 rq_depth,
209 struct hinic3_rx_info *rx_info_arr)
210 {
211 u32 free_wqebbs = rq_depth - 1;
212 u32 idx;
213 int err;
214
215 for (idx = 0; idx < free_wqebbs; idx++) {
216 err = rx_alloc_mapped_page(netdev, &rx_info_arr[idx]);
217 if (err)
218 break;
219 }
220
221 return idx;
222 }
223
224 static void hinic3_rx_free_buffers(struct net_device *netdev, u32 q_depth,
225 struct hinic3_rx_info *rx_info_arr)
226 {
227 struct hinic3_nic_dev *nic_dev = netdev_priv(netdev);
228 struct hinic3_rx_info *rx_info;
229 u32 i;
230
231 /* Free all the Rx ring sk_buffs */
232 for (i = 0; i < q_depth; i++) {
233 rx_info = &rx_info_arr[i];
234
235 if (rx_info->buf_dma_addr) {
236 dma_unmap_page(&nic_dev->pdev->dev,
237 rx_info->buf_dma_addr,
238 nic_dev->dma_rx_buff_size,
239 DMA_FROM_DEVICE);
240 rx_info->buf_dma_addr = 0;
241 }
242
243 if (rx_info->page) {
244 __free_pages(rx_info->page, nic_dev->page_order);
245 rx_info->page = NULL;
246 }
247 }
248 }
249
250 static void hinic3_reuse_rx_page(struct hinic3_rxq *rxq,
251 struct hinic3_rx_info *old_rx_info)
252 {
253 struct hinic3_rx_info *new_rx_info;
254 u16 nta = rxq->next_to_alloc;
255
256 new_rx_info = &rxq->rx_info[nta];
257
258 /* update, and store next to alloc */
259 nta++;
260 rxq->next_to_alloc = (nta < rxq->q_depth) ? nta : 0;
261
262 new_rx_info->page = old_rx_info->page;
263 new_rx_info->page_offset = old_rx_info->page_offset;
264 new_rx_info->buf_dma_addr = old_rx_info->buf_dma_addr;
265
266 /* sync the buffer for use by the device */
267 dma_sync_single_range_for_device(rxq->dev, new_rx_info->buf_dma_addr,
268 new_rx_info->page_offset,
269 rxq->buf_len,
270 DMA_FROM_DEVICE);
271 }
272
273 static void hinic3_add_rx_frag(struct hinic3_rxq *rxq,
274 struct hinic3_rx_info *rx_info,
275 struct sk_buff *skb, u32 size)
276 {
277 struct page *page;
278 u8 *va;
279
280 page = rx_info->page;
281 va = (u8 *)page_address(page) + rx_info->page_offset;
282 prefetch(va);
283
284 dma_sync_single_range_for_cpu(rxq->dev,
285 rx_info->buf_dma_addr,
286 rx_info->page_offset,
287 rxq->buf_len,
288 DMA_FROM_DEVICE);
289
290 if (size <= HINIC3_RX_HDR_SIZE && !skb_is_nonlinear(skb)) {
291 memcpy(__skb_put(skb, size), va,
292 ALIGN(size, sizeof(long)));
293
294 /* page is not reserved, we can reuse buffer as-is */
295 if (likely(page_to_nid(page) == numa_node_id()))
296 goto reuse_rx_page;
297
298 /* this page cannot be reused so discard it */
299 put_page(page);
300 goto err_reuse_buffer;
301 }
302
303 skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
304 rx_info->page_offset, size, rxq->buf_len);
305
306 /* avoid re-using remote pages */
307 if (unlikely(page_to_nid(page) != numa_node_id()))
308 goto err_reuse_buffer;
309
310 /* if we are the only owner of the page we can reuse it */
311 if (unlikely(page_count(page) != 1))
312 goto err_reuse_buffer;
313
314 /* flip page offset to other buffer */
315 rx_info->page_offset ^= rxq->buf_len;
316 get_page(page);
317
318 reuse_rx_page:
319 hinic3_reuse_rx_page(rxq, rx_info);
320 return;
321
322 err_reuse_buffer:
323 /* we are not reusing the buffer so unmap it */
324 dma_unmap_page(rxq->dev, rx_info->buf_dma_addr, rxq->dma_rx_buff_size, DMA_FROM_DEVICE);
325 }
326
327 static void packaging_skb(struct hinic3_rxq *rxq, struct sk_buff *skb,
328 u32 sge_num, u32 pkt_len)
329 {
330 struct hinic3_rx_info *rx_info;
331 u32 temp_pkt_len = pkt_len;
332 u32 temp_sge_num = sge_num;
> 333 u8 frag_num = 0; 334 u32 sw_ci;
335 u32 size;
336
337 sw_ci = rxq->cons_idx & rxq->q_mask;
338 while (temp_sge_num) {
339 rx_info = &rxq->rx_info[sw_ci];
340 sw_ci = (sw_ci + 1) & rxq->q_mask;
341 if (unlikely(temp_pkt_len > rxq->buf_len)) {
342 size = rxq->buf_len;
343 temp_pkt_len -= rxq->buf_len;
344 } else {
345 size = temp_pkt_len;
346 }
347
348 hinic3_add_rx_frag(rxq, rx_info, skb, size);
349
350 /* clear contents of buffer_info */
351 rx_info->buf_dma_addr = 0;
352 rx_info->page = NULL;
353 temp_sge_num--;
354 frag_num++;
355 }
356 }
357
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botkernel test robot noticed the following build errors:
Hi Gur,
[This is a private test report for your RFC patch.] kernel test robot noticed the following build errors:
[auto build test ERROR on b8ee7a11c75436b85fa1641aa5f970de0f8a575c]
url: https://github.com/intel-lab-lkp/linux/commits/Gur-Stavi/net-hinic3-Add-a-driver-for-Huawei-3rd-gen-NIC/20241030-201518 base: b8ee7a11c75436b85fa1641aa5f970de0f8a575c patch link: https://lore.kernel.org/r/ebb0fefe47c29ffed5af21d6bd39d19c2bcddd9c.1730290527.git.gur.stavi%40huawei.com patch subject: [RFC net-next v01 1/1] net: hinic3: Add a driver for Huawei 3rd gen NIC config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20241102/[email protected]/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241102/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All error/warnings (new ones prefixed by >>):
In file included from include/linux/device.h:15,
from include/linux/pci.h:37,
from drivers/net/ethernet/huawei/hinic3/hinic3_wq.c:5:
drivers/net/ethernet/huawei/hinic3/hinic3_wq.c: In function 'wq_init_wq_block':
>> drivers/net/ethernet/huawei/hinic3/hinic3_wq.c:34:37: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'unsigned int' [-Wformat=]
34 | dev_err(hwdev->dev, "wq num_pages exceed limit: %lu\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap'
110 | _p_func(dev, fmt, ##__VA_ARGS__); \
| ^~~
include/linux/dev_printk.h:154:56: note: in expansion of macro 'dev_fmt'
154 | dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
drivers/net/ethernet/huawei/hinic3/hinic3_wq.c:34:17: note: in expansion of macro 'dev_err'
34 | dev_err(hwdev->dev, "wq num_pages exceed limit: %lu\n",
| ^~~~~~~
drivers/net/ethernet/huawei/hinic3/hinic3_wq.c:34:67: note: format string is defined here
34 | dev_err(hwdev->dev, "wq num_pages exceed limit: %lu\n",
| ~~^
| |
| long unsigned int
| %u
--
drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c: In function 'cmdq_set_db':
>> drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c:438:9: error: implicit declaration of function 'writeq'; did you mean 'writel'? [-Werror=implicit-function-declaration]
438 | writeq(*((u64 *)&db), CMDQ_DB_ADDR(db_base, prod_idx));
| ^~~~~~
| writel
In file included from include/linux/device.h:15,
from drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c:6:
drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c: In function 'create_cmdq_wq':
>> drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c:965:45: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'unsigned int' [-Wformat=]
965 | dev_err(hwdev->dev, "Cmdq number of wq pages exceeds limit: %lu\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap'
110 | _p_func(dev, fmt, ##__VA_ARGS__); \
| ^~~
include/linux/dev_printk.h:154:56: note: in expansion of macro 'dev_fmt'
154 | dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c:965:25: note: in expansion of macro 'dev_err'
965 | dev_err(hwdev->dev, "Cmdq number of wq pages exceeds limit: %lu\n",
| ^~~~~~~
drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c:965:87: note: format string is defined here
965 | dev_err(hwdev->dev, "Cmdq number of wq pages exceeds limit: %lu\n",
| ~~^
| |
| long unsigned int
| %u cc1: some warnings being treated as errors
--
In file included from drivers/net/ethernet/huawei/hinic3/hinic3_nic_dev.h:17,
from drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.c:14:
drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.h: In function 'hinic3_write_db':
>> drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.h:102:9: error: implicit declaration of function 'writeq'; did you mean 'writel'? [-Werror=implicit-function-declaration]
102 | writeq(*((u64 *)&db), DB_ADDR(queue, pi));
| ^~~~~~
| writel cc1: some warnings being treated as errors
--
In file included from drivers/net/ethernet/huawei/hinic3/hinic3_nic_dev.h:17,
from drivers/net/ethernet/huawei/hinic3/hinic3_rx.c:16:
drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.h: In function 'hinic3_write_db':
>> drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.h:102:9: error: implicit declaration of function 'writeq'; did you mean 'writel'? [-Werror=implicit-function-declaration]
102 | writeq(*((u64 *)&db), DB_ADDR(queue, pi));
| ^~~~~~
| writel
drivers/net/ethernet/huawei/hinic3/hinic3_rx.c: In function 'rq_associate_cqes':
>> drivers/net/ethernet/huawei/hinic3/hinic3_rx.c:146:13: warning: variable 'cqe_len' set but not used [-Wunused-but-set-variable]
146 | int cqe_len;
| ^~~~~~~
drivers/net/ethernet/huawei/hinic3/hinic3_rx.c: In function 'recv_one_pkt':
>> drivers/net/ethernet/huawei/hinic3/hinic3_rx.c:493:32: warning: variable 'nic_dev' set but not used [-Wunused-but-set-variable]
493 | struct hinic3_nic_dev *nic_dev;
| ^~~~~~~cc1: some warnings being treated as errors
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for GET_FREE_REGION Depends on [n]: SPARSEMEM [=n]
Selected by [m]:
- RESOURCE_KUNIT_TEST [=m] && RUNTIME_TESTING_MENU [=y] && KUNIT [=m]
vim +438 drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c
429
430 static void cmdq_set_db(struct hinic3_cmdq *cmdq,
431 enum hinic3_cmdq_type cmdq_type, u16 prod_idx)
432 {
433 u8 __iomem *db_base = cmdq->hwdev->cmdqs->cmdqs_db_base;
434 struct hinic3_cmdq_db db;
435
436 cmdq_fill_db(&db, cmdq_type, prod_idx);
437
> 438 writeq(*((u64 *)&db), CMDQ_DB_ADDR(db_base, prod_idx));
439 }
440
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki