From patchwork Thu Jan 16 07:51:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gur Stavi X-Patchwork-Id: 13941379 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 38F3824A7E8; Thu, 16 Jan 2025 07:39:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737013177; cv=none; b=U82ItXN50Hvm1/t37bLO/ma7zN5dcdpAI7BRKGS5+/qNy2I91sDCjNVNEWJa/YHGuKSDP5+iqUo3wFnqNNcD5DpFjLJRX6vzNCYvnYdQww3SNkh1iAWnfHPm50x2M0GGojZzrXChjCpMN4H2CuktxctpfF+Nl76Deow+AM5KMd4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737013177; c=relaxed/simple; bh=Z/OOTf+1b0P9nB8BLDooESyJfX0i5l/Wovo7mTa64UQ=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=MSeQageDz6LY/ykLNa1bZDzqt7Eid0ZXcSZkvkURld+4ll0RyIISdiVdhiJ+AaOIWKexsMAUkE00dJO24/xEEVhVRv4/wv/XBvGIuhx2/1KeEH7w+5eB3YH9z4YUV8T0zyxoNtTds3ujAKBJ6XCJItNEy4pkAylF9NixG6+YrhM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4YYZPj1YS6z6K9XN; Thu, 16 Jan 2025 15:34:33 +0800 (CST) Received: from frapeml500005.china.huawei.com (unknown [7.182.85.13]) by mail.maildlp.com (Postfix) with ESMTPS id 96932140B67; Thu, 16 Jan 2025 15:39:30 +0800 (CST) Received: from china (10.200.201.82) by frapeml500005.china.huawei.com (7.182.85.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 16 Jan 2025 08:39:18 +0100 From: Gur Stavi To: Gur Stavi , gongfan CC: , , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Andrew Lunn , , Jonathan Corbet , Bjorn Helgaas , Cai Huoqing , luosifu , Xin Guo , Shen Chenyang , Zhou Shuai , Wu Like , Shi Jing , Meny Yossefi , Suman Ghosh Subject: [PATCH net-next v04 0/1] net: hinic3: Add a driver for Huawei 3rd gen NIC Date: Thu, 16 Jan 2025 09:51:52 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To frapeml500005.china.huawei.com (7.182.85.13) X-Patchwork-Delegate: kuba@kernel.org This is the 1/3 patch of the patch-set described below. 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. Initially, the driver only supports VFs. Following the discussion over RFC01, the code will be submitted in separate smaller patches where until the last patch the driver is non-functional. The RFC02 submission contains overall view of the entire driver but every patch will be posted as a standalone submission. Changes: RFC V01: https://lore.kernel.org/netdev/cover.1730290527.git.gur.stavi@huawei.com RFC V02: https://lore.kernel.org/netdev/cover.1733990727.git.gur.stavi@huawei.com * Reduce overall line of code by removing optional functionality. * Break down into smaller patches. PATCH 01 V01: https://lore.kernel.org/netdev/cover.1734599672.git.gur.stavi@huawei.com * Documentation style and consistency fixes (from Bjorn Helgaas) * Use ipoll instead of custom code (from Andrew Lunn) * Move dev_set_drvdata up in initialization order (from Andrew Lunn) * Use netdev's max_mtu, min_mtu (from Andrew Lunn) * Fix variable 'xxx' set but not used warnings (from Linux patchwork) PATCH 01 V02: https://lore.kernel.org/netdev/cover.1735206602.git.gur.stavi@huawei.com * Add comment regarding usage of random MAC. (Andrew Lunn) * Add COMPILE_TEST to Kconfig (Jakub Kicinski) PATCH 01 V03: https://lore.kernel.org/netdev/cover.1735735608.git.gur.stavi@huawei.com * Rephrase Kconfig comment (Jakub Kicinski) * Kconfig: add 'select AUXILIARY_BUS' (Kernel test robot) * ARCH=um: missing include 'net/ip6_checksum.h' (Kernel test robot) PATCH 01 V04: * Improve naming consistency, missing hinic3 prefixes (Suman Ghosh) * Change hinic3_remove_func to void (Suman Ghosh) * Add adev_event_unregister (Suman Ghosh) * Add comment for service types enum (Suman Ghosh) gongfan (1): hinic3: module initialization and tx/rx logic .../device_drivers/ethernet/huawei/hinic3.rst | 137 ++++ MAINTAINERS | 7 + drivers/net/ethernet/huawei/Kconfig | 1 + drivers/net/ethernet/huawei/Makefile | 1 + drivers/net/ethernet/huawei/hinic3/Kconfig | 18 + drivers/net/ethernet/huawei/hinic3/Makefile | 21 + .../ethernet/huawei/hinic3/hinic3_common.c | 53 ++ .../ethernet/huawei/hinic3/hinic3_common.h | 27 + .../ethernet/huawei/hinic3/hinic3_hw_cfg.c | 30 + .../ethernet/huawei/hinic3/hinic3_hw_cfg.h | 58 ++ .../ethernet/huawei/hinic3/hinic3_hw_comm.c | 37 + .../ethernet/huawei/hinic3/hinic3_hw_comm.h | 13 + .../ethernet/huawei/hinic3/hinic3_hw_intf.h | 88 +++ .../net/ethernet/huawei/hinic3/hinic3_hwdev.c | 24 + .../net/ethernet/huawei/hinic3/hinic3_hwdev.h | 82 +++ .../net/ethernet/huawei/hinic3/hinic3_hwif.c | 15 + .../net/ethernet/huawei/hinic3/hinic3_hwif.h | 50 ++ .../net/ethernet/huawei/hinic3/hinic3_lld.c | 416 +++++++++++ .../net/ethernet/huawei/hinic3/hinic3_lld.h | 21 + .../net/ethernet/huawei/hinic3/hinic3_main.c | 418 +++++++++++ .../net/ethernet/huawei/hinic3/hinic3_mbox.c | 17 + .../net/ethernet/huawei/hinic3/hinic3_mbox.h | 16 + .../net/ethernet/huawei/hinic3/hinic3_mgmt.h | 13 + .../huawei/hinic3/hinic3_mgmt_interface.h | 111 +++ .../huawei/hinic3/hinic3_netdev_ops.c | 77 ++ .../ethernet/huawei/hinic3/hinic3_nic_cfg.c | 254 +++++++ .../ethernet/huawei/hinic3/hinic3_nic_cfg.h | 45 ++ .../ethernet/huawei/hinic3/hinic3_nic_dev.h | 100 +++ .../ethernet/huawei/hinic3/hinic3_nic_io.c | 21 + .../ethernet/huawei/hinic3/hinic3_nic_io.h | 117 +++ .../huawei/hinic3/hinic3_queue_common.c | 65 ++ .../huawei/hinic3/hinic3_queue_common.h | 51 ++ .../net/ethernet/huawei/hinic3/hinic3_rss.c | 24 + .../net/ethernet/huawei/hinic3/hinic3_rss.h | 12 + .../net/ethernet/huawei/hinic3/hinic3_rx.c | 401 ++++++++++ .../net/ethernet/huawei/hinic3/hinic3_rx.h | 91 +++ .../net/ethernet/huawei/hinic3/hinic3_tx.c | 692 ++++++++++++++++++ .../net/ethernet/huawei/hinic3/hinic3_tx.h | 129 ++++ .../net/ethernet/huawei/hinic3/hinic3_wq.c | 29 + .../net/ethernet/huawei/hinic3/hinic3_wq.h | 75 ++ 40 files changed, 3857 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_common.c create mode 100644 drivers/net/ethernet/huawei/hinic3/hinic3_common.h 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_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.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_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: 7a1723d3b230765dc025401db8308937e4c4fb13