Introduce iXD driver
Subsystems (10)
Tony Nguyen
maintainerPATCH v3 11/14 ixd: add basic driver framework for Intel(R) Control Plane Function
In reply to Tony NguyenFrom: Larysa Zaremba <[email protected]>
Add module register and probe functionality. Add the required support to register IXD PCI driver, as well as probe and remove call backs. Enable the PCI device and request the kernel to reserve the memory resources that will be used by the driver. Finally map the BAR0 address space.
For now, use devm_alloc() to allocate adapter, as it requires the least amount of code. In a later commit, it will be replaced with a devlink alternative.
--- .../device_drivers/ethernet/index.rst | 1 + .../device_drivers/ethernet/intel/ixd.rst | 39 ++++++ drivers/net/ethernet/intel/Kconfig | 2 + drivers/net/ethernet/intel/Makefile | 1 + drivers/net/ethernet/intel/ixd/Kconfig | 13 ++ drivers/net/ethernet/intel/ixd/Makefile | 8 ++ drivers/net/ethernet/intel/ixd/ixd.h | 28 +++++ drivers/net/ethernet/intel/ixd/ixd_lan_regs.h | 28 +++++ drivers/net/ethernet/intel/ixd/ixd_main.c | 112 ++++++++++++++++++ 9 files changed, 232 insertions(+) create mode 100644 Documentation/networking/device_drivers/ethernet/intel/ixd.rst create mode 100644 drivers/net/ethernet/intel/ixd/Kconfig create mode 100644 drivers/net/ethernet/intel/ixd/Makefile create mode 100644 drivers/net/ethernet/intel/ixd/ixd.h create mode 100644 drivers/net/ethernet/intel/ixd/ixd_lan_regs.h create mode 100644 drivers/net/ethernet/intel/ixd/ixd_main.c
Documentation/networking/device_drivers/ethernet/index.rst +1 -0
@@ -36,6 +36,7 @@ Contents: intel/igbvf intel/ixgbe intel/ixgbevf + intel/ixd intel/i40e intel/iavf intel/ice
Documentation/networking/device_drivers/ethernet/intel/ixd.rst new file +39 -0
@@ -0,0 +1,39 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +========================================================================== +iXD Linux* Base Driver for the Intel(R) Control Plane Function +========================================================================== + +Intel iXD Linux driver. +Copyright(C) 2025 Intel Corporation. + +.. contents:: + +For questions related to hardware requirements, refer to the documentation +supplied with your Intel adapter. All hardware requirements listed apply to use +with Linux. + + +Identifying Your Adapter +======================== +For information on how to identify your adapter, and for the latest Intel +network drivers, refer to the Intel Support website: +http://www.intel.com/support + + +Support +======= +For general information, go to the Intel support website at: +http://www.intel.com/support/ + +If an issue is identified with the released source code on a supported kernel +with a supported adapter, email the specific information related to the issue +to [email protected]. + + +Trademarks +========== +Intel is a trademark or registered trademark of Intel Corporation or its +subsidiaries in the United States and/or other countries. + +* Other names and brands may be claimed as the property of others.
drivers/net/ethernet/intel/Kconfig +2 -0
@@ -398,4 +398,6 @@ config IGC_LEDS source "drivers/net/ethernet/intel/idpf/Kconfig" +source "drivers/net/ethernet/intel/ixd/Kconfig" + endif # NET_VENDOR_INTEL
drivers/net/ethernet/intel/Makefile +1 -0
@@ -19,3 +19,4 @@ obj-$(CONFIG_IAVF) += iavf/ obj-$(CONFIG_FM10K) += fm10k/ obj-$(CONFIG_ICE) += ice/ obj-$(CONFIG_IDPF) += idpf/ +obj-$(CONFIG_IXD) += ixd/
drivers/net/ethernet/intel/ixd/Kconfig new file +13 -0
@@ -0,0 +1,13 @@ +# SPDX-License-Identifier: GPL-2.0-only +# Copyright (C) 2025 Intel Corporation + +config IXD + tristate "Intel(R) Control Plane Function Support" + depends on PCI_MSI + select LIBETH + select LIBIE_PCI + help + This driver supports Intel(R) Control Plane PCI Function + of Intel E2100 and later IPUs and FNICs. + It facilitates a centralized control over multiple IDPF PFs/VFs/SFs + exposed by the same card.
drivers/net/ethernet/intel/ixd/Makefile new file +8 -0
@@ -0,0 +1,8 @@ +# SPDX-License-Identifier: GPL-2.0-only +# Copyright (C) 2025 Intel Corporation + +# Intel(R) Control Plane Function Linux Driver + +obj-$(CONFIG_IXD) += ixd.o + +ixd-y := ixd_main.o
drivers/net/ethernet/intel/ixd/ixd.h new file +28 -0
@@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* Copyright (C) 2025 Intel Corporation */ + +#ifndef _IXD_H_ +#define _IXD_H_ + +#include <linux/intel/libie/pci.h> + +/** +* struct ixd_adapter - Data structure representing a CPF +* @hw: Device access data +*/ +struct ixd_adapter { +struct libie_mmio_info hw; +}; + +/** +* ixd_to_dev - Get the corresponding device struct from an adapter +* @adapter: PCI device driver-specific private data +* +* Return: struct device corresponding to the given adapter +*/ +static inline struct device *ixd_to_dev (struct ixd_adapter *adapter) +{ +return &adapter->hw.pdev->dev; +} + +#endif /* _IXD_H_ */
drivers/net/ethernet/intel/ixd/ixd_lan_regs.h new file +28 -0
@@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* Copyright (C) 2025 Intel Corporation */ + +#ifndef _IXD_LAN_REGS_H_ +#define _IXD_LAN_REGS_H_ + +/* Control Plane Function PCI ID */ +#define IXD_DEV_ID_CPF 0x1efe + +/* Control Queue (Mailbox) */ +#define PF_FW_MBX_REG_LEN 4096 +#define PF_FW_MBX 0x08400000 + +/* Reset registers */ +#define PFGEN_RTRIG_REG_LEN 2048 +#define PFGEN_RTRIG 0x08407000/* Device resets */ + +/** +* struct ixd_bar_region - BAR region description +* @offset: BAR region offset +* @size: BAR region size +*/ +struct ixd_bar_region { +resource_size_t offset; +resource_size_t size; +}; + +#endif /* _IXD_LAN_REGS_H_ */
drivers/net/ethernet/intel/ixd/ixd_main.c new file +112 -0
112 lines not on this page · raw message
Signature · 1 line
2.47.1
Re: [PATCH net-next v3 11/14] ixd: add basic driver framework for Intel(R) Control Plane Function
Quoted 10 lines · Tony Nguyen
From: Larysa Zaremba <[email protected]>
Add module register and probe functionality. Add the required support to register IXD PCI driver, as well as probe and remove call backs. Enable the PCI device and request the kernel to reserve the memory resources that will be used by the driver. Finally map the BAR0 address space.
For now, use
devm_alloc()to allocate adapter, as it requires the least amount of code. In a later commit, it will be replaced with a devlink alternative.
I had reviewed the Sashiko feedback [0]. Here are a few notes:
1. "Should this file explicitly include linux/module.h and linux/reboot.h?" we do not normally, do that, but if you want to, there is a diff below.
2. "Could leaving PCI bus mastering enabled during shutdown cause memory corruption or IOMMU faults during a kexec or warm reboot?" - Could it? Current flow is the same as ice.
[0] https://sashiko.dev/#/patchset/20260515224443.2772147-1-anthony.l.nguyen%40intel.com
drivers/net/ethernet/intel/ixd/ixd_main.c +3 -0
@@ -1,6 +1,9 @@// SPDX-License-Identifier: GPL-2.0-only /* Copyright (C) 2025 Intel Corporation */ +#include <linux/module.h> +#include <linux/reboot.h> +#include "ixd.h" #include "ixd_lan_regs.h"
Quoted 325 lines
Co-developed-by Amritha Nambiar <[email protected]>Signed-off-by Amritha Nambiar <[email protected]>Reviewed-by Maciej Fijalkowski <[email protected]>Signed-off-by Larysa Zaremba <[email protected]>Tested-by Bharath R <[email protected]>Reviewed-by Aleksandr Loktionov <[email protected]>Signed-off-by Tony Nguyen <[email protected]>--- .../device_drivers/ethernet/index.rst | 1 + .../device_drivers/ethernet/intel/ixd.rst | 39 ++++++ drivers/net/ethernet/intel/Kconfig | 2 + drivers/net/ethernet/intel/Makefile | 1 + drivers/net/ethernet/intel/ixd/Kconfig | 13 ++ drivers/net/ethernet/intel/ixd/Makefile | 8 ++ drivers/net/ethernet/intel/ixd/ixd.h | 28 +++++ drivers/net/ethernet/intel/ixd/ixd_lan_regs.h | 28 +++++ drivers/net/ethernet/intel/ixd/ixd_main.c | 112 ++++++++++++++++++ 9 files changed, 232 insertions(+) create mode 100644 Documentation/networking/device_drivers/ethernet/intel/ixd.rst create mode 100644 drivers/net/ethernet/intel/ixd/Kconfig create mode 100644 drivers/net/ethernet/intel/ixd/Makefile create mode 100644 drivers/net/ethernet/intel/ixd/ixd.h create mode 100644 drivers/net/ethernet/intel/ixd/ixd_lan_regs.h create mode 100644 drivers/net/ethernet/intel/ixd/ixd_main.cDocumentation/networking/device_drivers/ethernet/index.rst +1
-0@@ -36,6 +36,7 @@ Contents: intel/igbvf intel/ixgbe intel/ixgbevf + intel/ixd intel/i40e intel/iavf intel/iceDocumentation/networking/device_drivers/ethernet/intel/ixd.rst new file +39
-0@@ -0,0 +1,39 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +========================================================================== +iXD Linux* Base Driver for the Intel(R) Control Plane Function +========================================================================== + +Intel iXD Linux driver. +Copyright(C) 2025 Intel Corporation. + +.. contents:: + +For questions related to hardware requirements, refer to the documentation +supplied with your Intel adapter. All hardware requirements listed apply to use +with Linux. + + +Identifying Your Adapter +======================== +For information on how to identify your adapter, and for the latest Intel +network drivers, refer to the Intel Support website: +http://www.intel.com/support + + +Support +======= +For general information, go to the Intel support website at: +http://www.intel.com/support/ + +If an issue is identified with the released source code on a supported kernel +with a supported adapter, email the specific information related to the issue +to [email protected]. + + +Trademarks +========== +Intel is a trademark or registered trademark of Intel Corporation or its +subsidiaries in the United States and/or other countries. + +* Other names and brands may be claimed as the property of others.drivers/net/ethernet/intel/Kconfig +2
-0@@ -398,4 +398,6 @@ config IGC_LEDS source "drivers/net/ethernet/intel/idpf/Kconfig" +source "drivers/net/ethernet/intel/ixd/Kconfig" + endif # NET_VENDOR_INTELdrivers/net/ethernet/intel/Makefile +1
-0@@ -19,3 +19,4 @@ obj-$(CONFIG_IAVF) += iavf/ obj-$(CONFIG_FM10K) += fm10k/ obj-$(CONFIG_ICE) += ice/ obj-$(CONFIG_IDPF) += idpf/ +obj-$(CONFIG_IXD) += ixd/drivers/net/ethernet/intel/ixd/Kconfig new file +13
-0@@ -0,0 +1,13 @@ +# SPDX-License-Identifier: GPL-2.0-only +# Copyright (C) 2025 Intel Corporation + +config IXD + tristate "Intel(R) Control Plane Function Support" + depends on PCI_MSI + select LIBETH + select LIBIE_PCI + help + This driver supports Intel(R) Control Plane PCI Function + of Intel E2100 and later IPUs and FNICs. + It facilitates a centralized control over multiple IDPF PFs/VFs/SFs + exposed by the same card.drivers/net/ethernet/intel/ixd/Makefile new file +8
-0@@ -0,0 +1,8 @@ +# SPDX-License-Identifier: GPL-2.0-only +# Copyright (C) 2025 Intel Corporation + +# Intel(R) Control Plane Function Linux Driver + +obj-$(CONFIG_IXD) += ixd.o + +ixd-y := ixd_main.odrivers/net/ethernet/intel/ixd/ixd.h new file +28
-0@@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* Copyright (C) 2025 Intel Corporation */ + +#ifndef _IXD_H_ +#define _IXD_H_ + +#include <linux/intel/libie/pci.h> + +/** +* struct ixd_adapter - Data structure representing a CPF +* @hw: Device access data +*/ +struct ixd_adapter { +struct libie_mmio_info hw; +}; + +/** +* ixd_to_dev - Get the corresponding device struct from an adapter +* @adapter: PCI device driver-specific private data +* +* Return: struct device corresponding to the given adapter +*/ +static inline struct device *ixd_to_dev (struct ixd_adapter *adapter) +{ +return &adapter->hw.pdev->dev; +} + +#endif /* _IXD_H_ */ drivers/net/ethernet/intel/ixd/ixd_lan_regs.h new file +28
-0@@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* Copyright (C) 2025 Intel Corporation */ + +#ifndef _IXD_LAN_REGS_H_ +#define _IXD_LAN_REGS_H_ + +/* Control Plane Function PCI ID */ +#define IXD_DEV_ID_CPF 0x1efe + +/* Control Queue (Mailbox) */ +#define PF_FW_MBX_REG_LEN 4096 +#define PF_FW_MBX 0x08400000 + +/* Reset registers */ +#define PFGEN_RTRIG_REG_LEN 2048 +#define PFGEN_RTRIG 0x08407000/* Device resets */ + +/** +* struct ixd_bar_region - BAR region description +* @offset: BAR region offset +* @size: BAR region size +*/ +struct ixd_bar_region { +resource_size_t offset; +resource_size_t size; +}; + +#endif /* _IXD_LAN_REGS_H_ */ drivers/net/ethernet/intel/ixd/ixd_main.c new file +112
-0@@ -0,0 +1,112 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* Copyright (C) 2025 Intel Corporation */ + +#include "ixd.h" +#include "ixd_lan_regs.h" + +MODULE_DESCRIPTION ("Intel(R) Control Plane Function Device Driver" ); +MODULE_IMPORT_NS ("LIBIE_PCI" ); +MODULE_LICENSE ("GPL" ); + +/** +* ixd_remove - remove a CPF PCI device +* @pdev: PCI device being removed +*/ +static void ixd_remove (struct pci_dev *pdev) +{ +struct ixd_adapter *adapter =pci_get_drvdata (pdev); + +libie_pci_unmap_all_mmio_regions (&adapter->hw); +} + +/** +* ixd_shutdown - shut down a CPF PCI device +* @pdev: PCI device being shut down +*/ +static void ixd_shutdown (struct pci_dev *pdev) +{ +ixd_remove (pdev); + +if (system_state ==SYSTEM_POWER_OFF ) +pci_set_power_state (pdev, PCI_D3hot); +} + +/** +* ixd_iomap_regions - iomap PCI BARs +* @adapter: adapter to map memory regions for +* +* Returns: %0 on success, negative on failure +*/ +static int ixd_iomap_regions (struct ixd_adapter *adapter) +{ +const struct ixd_bar_region regions[] = { + { + .offset =PFGEN_RTRIG , + .size =PFGEN_RTRIG_REG_LEN , + }, + { + .offset =PF_FW_MBX , + .size =PF_FW_MBX_REG_LEN , + }, + }; + +for (int i =0 ; i <ARRAY_SIZE (regions); i++) { +struct libie_mmio_info *mmio_info = &adapter->hw; +bool map_ok; + + map_ok =libie_pci_map_mmio_region (mmio_info, + regions[i].offset, + regions[i].size); +if (!map_ok) { +dev_err (ixd_to_dev (adapter), +"Failed to map PCI device MMIO region\n" ); + +libie_pci_unmap_all_mmio_regions (mmio_info); +return -EIO ; + } + } + +return 0 ; +} + +/** +* ixd_probe - probe a CPF PCI device +* @pdev: corresponding PCI device +* @ent: entry in ixd_pci_tbl +* +* Returns: %0 on success, negative errno code on failure +*/ +static int ixd_probe (struct pci_dev *pdev,const struct pci_device_id *ent) +{ +struct ixd_adapter *adapter; +int err; + + adapter =devm_kzalloc (&pdev->dev,sizeof (*adapter),GFP_KERNEL ); +if (!adapter) +return -ENOMEM ; + adapter->hw.pdev = pdev; +INIT_LIST_HEAD (&adapter->hw.mmio_list); + + err =libie_pci_init_dev (pdev); +if (err) +return err; + +pci_set_drvdata (pdev, adapter); + +return ixd_iomap_regions (adapter); +} + +static const struct pci_device_id ixd_pci_tbl[] = { + {PCI_VDEVICE (INTEL ,IXD_DEV_ID_CPF ) }, + { } +}; +MODULE_DEVICE_TABLE (pci, ixd_pci_tbl); + +static struct pci_driver ixd_driver = { + .name =KBUILD_MODNAME , + .id_table = ixd_pci_tbl, + .probe = ixd_probe, + .remove = ixd_remove, + .shutdown = ixd_shutdown, +}; +module_pci_driver (ixd_driver);Signature · 1 line
2.47.1
Tony Nguyen
maintainerPATCH v3 12/14 ixd: add reset checks and initialize the mailbox
In reply to Tony NguyenFrom: Larysa Zaremba <[email protected]>
At the end of the probe, trigger hard reset, initialize and schedule the after-reset task. If the reset is complete in a pre-determined time, initialize the default mailbox, through which other resources will be negotiated.
--- drivers/net/ethernet/intel/ixd/Kconfig | 1 + drivers/net/ethernet/intel/ixd/Makefile | 2 + drivers/net/ethernet/intel/ixd/ixd.h | 28 +++- drivers/net/ethernet/intel/ixd/ixd_dev.c | 89 +++++++++++ drivers/net/ethernet/intel/ixd/ixd_lan_regs.h | 40 +++++ drivers/net/ethernet/intel/ixd/ixd_lib.c | 143 ++++++++++++++++++ drivers/net/ethernet/intel/ixd/ixd_main.c | 32 +++- 7 files changed, 326 insertions(+), 9 deletions(-) create mode 100644 drivers/net/ethernet/intel/ixd/ixd_dev.c create mode 100644 drivers/net/ethernet/intel/ixd/ixd_lib.c
drivers/net/ethernet/intel/ixd/Kconfig +1 -0
@@ -5,6 +5,7 @@ config IXD tristate "Intel(R) Control Plane Function Support" depends on PCI_MSI select LIBETH + select LIBIE_CP select LIBIE_PCI help This driver supports Intel(R) Control Plane PCI Function
drivers/net/ethernet/intel/ixd/Makefile +2 -0
@@ -6,3 +6,5 @@ obj-$(CONFIG_IXD) += ixd.o ixd-y := ixd_main.o +ixd-y += ixd_dev.o +ixd-y += ixd_lib.o
drivers/net/ethernet/intel/ixd/ixd.h +24 -4
@@ -4,14 +4,25 @@#ifndef _IXD_H_#define _IXD_H_ -#include <linux/intel/libie/pci.h> +#include <linux/intel/libie/controlq.h> /** * struct ixd_adapter - Data structure representing a CPF -* @hw: Device access data +* @cp_ctx: Control plane communication context +* @init_task: Delayed initialization after reset +* @xnm: virtchnl transaction manager +* @asq: Send control queue info +* @arq: Receive control queue info */ struct ixd_adapter { -struct libie_mmio_info hw; +struct libie_ctlq_ctx cp_ctx; +struct { +struct delayed_work init_work; +u8 reset_retries; + } init_task; +struct libie_ctlq_xn_manager *xnm; +struct libie_ctlq_info *asq; +struct libie_ctlq_info *arq; };/**
@@ -22,7 +33,16 @@ struct ixd_adapter {*/ static inline struct device *ixd_to_dev (struct ixd_adapter *adapter) { -return &adapter->hw.pdev->dev; +return &adapter->cp_ctx.mmio_info.pdev->dev; } +void ixd_ctlq_reg_init (struct ixd_adapter *adapter, +struct libie_ctlq_reg *ctlq_reg_tx, +struct libie_ctlq_reg *ctlq_reg_rx); +void ixd_trigger_reset (struct ixd_adapter *adapter); +bool ixd_check_reset_complete (struct ixd_adapter *adapter); +void ixd_init_task (struct work_struct *work); +int ixd_init_dflt_mbx (struct ixd_adapter *adapter); +void ixd_deinit_dflt_mbx (struct ixd_adapter *adapter); +#endif /* _IXD_H_ */
drivers/net/ethernet/intel/ixd/ixd_dev.c new file +89 -0
89 lines not on this page · raw message
drivers/net/ethernet/intel/ixd/ixd_lan_regs.h +40 -0
@@ -11,9 +11,33 @@#define PF_FW_MBX_REG_LEN 4096#define PF_FW_MBX 0x08400000 +#define PF_FW_ARQBAL (PF_FW_MBX) +#define PF_FW_ARQBAH (PF_FW_MBX + 0x4) +#define PF_FW_ARQLEN (PF_FW_MBX + 0x8) +#define PF_FW_ARQLEN_ARQLEN_M GENMASK(12, 0) +#define PF_FW_ARQLEN_ARQENABLE_S 31 +#define PF_FW_ARQLEN_ARQENABLE_M BIT(PF_FW_ARQLEN_ARQENABLE_S) +#define PF_FW_ARQH_ARQH_M GENMASK(12, 0) +#define PF_FW_ARQH (PF_FW_MBX + 0xC) +#define PF_FW_ARQT (PF_FW_MBX + 0x10) + +#define PF_FW_ATQBAL (PF_FW_MBX + 0x14) +#define PF_FW_ATQBAH (PF_FW_MBX + 0x18) +#define PF_FW_ATQLEN (PF_FW_MBX + 0x1C) +#define PF_FW_ATQLEN_ATQLEN_M GENMASK(9, 0) +#define PF_FW_ATQLEN_ATQENABLE_S 31 +#define PF_FW_ATQLEN_ATQENABLE_M BIT(PF_FW_ATQLEN_ATQENABLE_S) +#define PF_FW_ATQH_ATQH_M GENMASK(9, 0) +#define PF_FW_ATQH (PF_FW_MBX + 0x20) +#define PF_FW_ATQT (PF_FW_MBX + 0x24) +/* Reset registers */ #define PFGEN_RTRIG_REG_LEN 2048#define PFGEN_RTRIG 0x08407000/* Device resets */ +#define PFGEN_RSTAT 0x08407008/* PFR status */ +#define PFGEN_RSTAT_PFR_STATE_M GENMASK(1, 0) +#define PFGEN_CTRL 0x0840700C/* PFR trigger */ +#define PFGEN_CTRL_PFSWR BIT(0)/** * struct ixd_bar_region - BAR region description
@@ -25,4 +49,20 @@ struct ixd_bar_region { resource_size_t size; }; +/** +* struct ixd_reset_reg - structure for reset registers +* @rstat: offset of status in register +* @rstat_m: status mask +* @rstat_ok_v: value that indicates PFR completed status +* @rtrigger: offset of reset trigger in register +* @rtrigger_m: reset trigger mask +*/ +struct ixd_reset_reg { +u32 rstat; +u32 rstat_m; +u32 rstat_ok_v; +u32 rtrigger; +u32 rtrigger_m; +}; +#endif /* _IXD_LAN_REGS_H_ */
drivers/net/ethernet/intel/ixd/ixd_lib.c new file +143 -0
143 lines not on this page · raw message
drivers/net/ethernet/intel/ixd/ixd_main.c +27 -5
@@ -5,6 +5,7 @@#include "ixd_lan_regs.h" MODULE_DESCRIPTION ("Intel(R) Control Plane Function Device Driver" ); +MODULE_IMPORT_NS ("LIBIE_CP" );MODULE_IMPORT_NS ("LIBIE_PCI" );MODULE_LICENSE ("GPL" );
@@ -16,7 +17,13 @@ static void ixd_remove(struct pci_dev *pdev) {struct ixd_adapter *adapter =pci_get_drvdata (pdev); -libie_pci_unmap_all_mmio_regions (&adapter->hw); +/* Do not mix removal with (re)initialization */ +cancel_delayed_work_sync (&adapter->init_task.init_work); +/* Leave the device clean on exit */ +ixd_trigger_reset (adapter); +ixd_deinit_dflt_mbx (adapter); + +libie_pci_unmap_all_mmio_regions (&adapter->cp_ctx.mmio_info); }/**
@@ -51,7 +58,7 @@ static int ixd_iomap_regions(struct ixd_adapter *adapter) };for (int i =0 ; i <ARRAY_SIZE (regions); i++) { -struct libie_mmio_info *mmio_info = &adapter->hw; +struct libie_mmio_info *mmio_info = &adapter->cp_ctx.mmio_info;bool map_ok; map_ok = libie_pci_map_mmio_region(mmio_info,
@@ -81,11 +88,15 @@ static int ixd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)struct ixd_adapter *adapter;int err; +if (WARN_ON (ent->device !=IXD_DEV_ID_CPF )) +return -EINVAL ; + adapter =devm_kzalloc (&pdev->dev,sizeof (*adapter),GFP_KERNEL );if (!adapter)return -ENOMEM ; - adapter->hw.pdev = pdev; -INIT_LIST_HEAD (&adapter->hw.mmio_list); + + adapter->cp_ctx.mmio_info.pdev = pdev; +INIT_LIST_HEAD (&adapter->cp_ctx.mmio_info.mmio_list); err =libie_pci_init_dev (pdev);if (err)
@@ -93,7 +104,18 @@ static int ixd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)pci_set_drvdata (pdev, adapter); -return ixd_iomap_regions (adapter); + err =ixd_iomap_regions (adapter); +if (err) +return err; + +INIT_DELAYED_WORK (&adapter->init_task.init_work, + ixd_init_task); + +ixd_trigger_reset (adapter); +queue_delayed_work (system_unbound_wq, &adapter->init_task.init_work, +msecs_to_jiffies (500 )); + +return 0 ; }static const struct pci_device_id ixd_pci_tbl[] = {
Signature · 1 line
2.47.1
Re: [PATCH net-next v3 12/14] ixd: add reset checks and initialize the mailbox
Quoted 6 lines · Tony Nguyen
From: Larysa Zaremba <[email protected]>
At the end of the probe, trigger hard reset, initialize and schedule the after-reset task. If the reset is complete in a pre-determined time, initialize the default mailbox, through which other resources will be negotiated.
Sashiko says [0]:
"
Does this teardown sequence properly ensure the hardware is quiescent before freeing its DMA memory?
Looking at ixd_trigger_reset(), it performs a writel(), which is a posted write over PCIe.
The code here does not flush this write with a dummy read, nor does it wait for the reset to complete by polling ixd_check_reset_complete(). Since ixd_deinit_dflt_mbx() immediately proceeds to free the DMA memory via libie_ctlq_xn_deinit(), could the hardware continue executing DMA operations into the freed memory, potentially causing IOMMU faults or memory corruption?
"
Reset flow is consistent with what pre-refactor idpf does, and is the intended way to perform removal.
[0] https://sashiko.dev/#/patchset/20260515224443.2772147-1-anthony.l.nguyen%40intel.com
Quoted 473 lines
Co-developed-by Amritha Nambiar <[email protected]>Signed-off-by Amritha Nambiar <[email protected]>Reviewed-by Maciej Fijalkowski <[email protected]>Signed-off-by Larysa Zaremba <[email protected]>Reviewed-by Aleksandr Loktionov <[email protected]>Tested-by Bharath R <[email protected]>Signed-off-by Tony Nguyen <[email protected]>--- drivers/net/ethernet/intel/ixd/Kconfig | 1 + drivers/net/ethernet/intel/ixd/Makefile | 2 + drivers/net/ethernet/intel/ixd/ixd.h | 28 +++- drivers/net/ethernet/intel/ixd/ixd_dev.c | 89 +++++++++++ drivers/net/ethernet/intel/ixd/ixd_lan_regs.h | 40 +++++ drivers/net/ethernet/intel/ixd/ixd_lib.c | 143 ++++++++++++++++++ drivers/net/ethernet/intel/ixd/ixd_main.c | 32 +++- 7 files changed, 326 insertions(+), 9 deletions(-) create mode 100644 drivers/net/ethernet/intel/ixd/ixd_dev.c create mode 100644 drivers/net/ethernet/intel/ixd/ixd_lib.cdrivers/net/ethernet/intel/ixd/Kconfig +1
-0@@ -5,6 +5,7 @@ config IXD tristate "Intel(R) Control Plane Function Support" depends on PCI_MSI select LIBETH + select LIBIE_CP select LIBIE_PCI help This driver supports Intel(R) Control Plane PCI Functiondrivers/net/ethernet/intel/ixd/Makefile +2
-0@@ -6,3 +6,5 @@ obj-$(CONFIG_IXD) += ixd.o ixd-y := ixd_main.o +ixd-y += ixd_dev.o +ixd-y += ixd_lib.odrivers/net/ethernet/intel/ixd/ixd.h +24
-4@@ -4,14 +4,25 @@#ifndef _IXD_H_#define _IXD_H_ -#include <linux/intel/libie/pci.h> +#include <linux/intel/libie/controlq.h> /** * struct ixd_adapter - Data structure representing a CPF -* @hw: Device access data +* @cp_ctx: Control plane communication context +* @init_task: Delayed initialization after reset +* @xnm: virtchnl transaction manager +* @asq: Send control queue info +* @arq: Receive control queue info */ struct ixd_adapter { -struct libie_mmio_info hw; +struct libie_ctlq_ctx cp_ctx; +struct { +struct delayed_work init_work; +u8 reset_retries; + } init_task; +struct libie_ctlq_xn_manager *xnm; +struct libie_ctlq_info *asq; +struct libie_ctlq_info *arq; };/** @@ -22,7 +33,16 @@ struct ixd_adapter {*/ static inline struct device *ixd_to_dev (struct ixd_adapter *adapter) { -return &adapter->hw.pdev->dev; +return &adapter->cp_ctx.mmio_info.pdev->dev; } +void ixd_ctlq_reg_init (struct ixd_adapter *adapter, +struct libie_ctlq_reg *ctlq_reg_tx, +struct libie_ctlq_reg *ctlq_reg_rx); +void ixd_trigger_reset (struct ixd_adapter *adapter); +bool ixd_check_reset_complete (struct ixd_adapter *adapter); +void ixd_init_task (struct work_struct *work); +int ixd_init_dflt_mbx (struct ixd_adapter *adapter); +void ixd_deinit_dflt_mbx (struct ixd_adapter *adapter); +#endif /* _IXD_H_ */ drivers/net/ethernet/intel/ixd/ixd_dev.c new file +89
-0@@ -0,0 +1,89 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* Copyright (C) 2025 Intel Corporation */ + +#include "ixd.h" +#include "ixd_lan_regs.h" + +/** +* ixd_ctlq_reg_init - Initialize default mailbox registers +* @adapter: PCI device driver-specific private data +* @ctlq_reg_tx: Transmit queue registers info to be filled +* @ctlq_reg_rx: Receive queue registers info to be filled +*/ +void ixd_ctlq_reg_init (struct ixd_adapter *adapter, +struct libie_ctlq_reg *ctlq_reg_tx, +struct libie_ctlq_reg *ctlq_reg_rx) +{ +struct libie_mmio_info *mmio_info = &adapter->cp_ctx.mmio_info; + *ctlq_reg_tx = (struct libie_ctlq_reg ) { + .head =libie_pci_get_mmio_addr (mmio_info,PF_FW_ATQH ), + .tail =libie_pci_get_mmio_addr (mmio_info,PF_FW_ATQT ), + .len =libie_pci_get_mmio_addr (mmio_info,PF_FW_ATQLEN ), + .addr_high =libie_pci_get_mmio_addr (mmio_info,PF_FW_ATQBAH ), + .addr_low =libie_pci_get_mmio_addr (mmio_info,PF_FW_ATQBAL ), + .len_mask =PF_FW_ATQLEN_ATQLEN_M , + .len_ena_mask =PF_FW_ATQLEN_ATQENABLE_M , + .head_mask =PF_FW_ATQH_ATQH_M , + }; + + *ctlq_reg_rx = (struct libie_ctlq_reg ) { + .head =libie_pci_get_mmio_addr (mmio_info,PF_FW_ARQH ), + .tail =libie_pci_get_mmio_addr (mmio_info,PF_FW_ARQT ), + .len =libie_pci_get_mmio_addr (mmio_info,PF_FW_ARQLEN ), + .addr_high =libie_pci_get_mmio_addr (mmio_info,PF_FW_ARQBAH ), + .addr_low =libie_pci_get_mmio_addr (mmio_info,PF_FW_ARQBAL ), + .len_mask =PF_FW_ARQLEN_ARQLEN_M , + .len_ena_mask =PF_FW_ARQLEN_ARQENABLE_M , + .head_mask =PF_FW_ARQH_ARQH_M , + }; +} + +static const struct ixd_reset_reg ixd_reset_reg = { + .rstat =PFGEN_RSTAT , + .rstat_m =PFGEN_RSTAT_PFR_STATE_M , + .rstat_ok_v =0b01 , + .rtrigger =PFGEN_CTRL , + .rtrigger_m =PFGEN_CTRL_PFSWR , +}; + +/** +* ixd_trigger_reset - Trigger PFR reset +* @adapter: the device with mapped reset register +*/ +void ixd_trigger_reset (struct ixd_adapter *adapter) +{ +void __iomem *addr; +u32 reg_val; + + addr =libie_pci_get_mmio_addr (&adapter->cp_ctx.mmio_info, + ixd_reset_reg.rtrigger); + reg_val =readl (addr); +writel (reg_val | ixd_reset_reg.rtrigger_m, addr); +} + +/** +* ixd_check_reset_complete - Check if the PFR reset is completed +* @adapter: CPF being reset +* +* Return: %true if the register read indicates reset has been finished, +* %false otherwise +*/ +bool ixd_check_reset_complete (struct ixd_adapter *adapter) +{ +u32 reg_val, reset_status; +void __iomem *addr; + + addr =libie_pci_get_mmio_addr (&adapter->cp_ctx.mmio_info, + ixd_reset_reg.rstat); + reg_val =readl (addr); + reset_status = reg_val & ixd_reset_reg.rstat_m; + +/* 0xFFFFFFFF might be read if the other side hasn't cleared +* the register for us yet. +*/ +if (reg_val !=GENMASK (31 ,0 ) && + reset_status == ixd_reset_reg.rstat_ok_v) +return true; + +return false; +}drivers/net/ethernet/intel/ixd/ixd_lan_regs.h +40
-0@@ -11,9 +11,33 @@#define PF_FW_MBX_REG_LEN 4096#define PF_FW_MBX 0x08400000 +#define PF_FW_ARQBAL (PF_FW_MBX) +#define PF_FW_ARQBAH (PF_FW_MBX + 0x4) +#define PF_FW_ARQLEN (PF_FW_MBX + 0x8) +#define PF_FW_ARQLEN_ARQLEN_M GENMASK(12, 0) +#define PF_FW_ARQLEN_ARQENABLE_S 31 +#define PF_FW_ARQLEN_ARQENABLE_M BIT(PF_FW_ARQLEN_ARQENABLE_S) +#define PF_FW_ARQH_ARQH_M GENMASK(12, 0) +#define PF_FW_ARQH (PF_FW_MBX + 0xC) +#define PF_FW_ARQT (PF_FW_MBX + 0x10) + +#define PF_FW_ATQBAL (PF_FW_MBX + 0x14) +#define PF_FW_ATQBAH (PF_FW_MBX + 0x18) +#define PF_FW_ATQLEN (PF_FW_MBX + 0x1C) +#define PF_FW_ATQLEN_ATQLEN_M GENMASK(9, 0) +#define PF_FW_ATQLEN_ATQENABLE_S 31 +#define PF_FW_ATQLEN_ATQENABLE_M BIT(PF_FW_ATQLEN_ATQENABLE_S) +#define PF_FW_ATQH_ATQH_M GENMASK(9, 0) +#define PF_FW_ATQH (PF_FW_MBX + 0x20) +#define PF_FW_ATQT (PF_FW_MBX + 0x24) +/* Reset registers */ #define PFGEN_RTRIG_REG_LEN 2048#define PFGEN_RTRIG 0x08407000/* Device resets */ +#define PFGEN_RSTAT 0x08407008/* PFR status */ +#define PFGEN_RSTAT_PFR_STATE_M GENMASK(1, 0) +#define PFGEN_CTRL 0x0840700C/* PFR trigger */ +#define PFGEN_CTRL_PFSWR BIT(0)/** * struct ixd_bar_region - BAR region description @@ -25,4 +49,20 @@ struct ixd_bar_region { resource_size_t size; }; +/** +* struct ixd_reset_reg - structure for reset registers +* @rstat: offset of status in register +* @rstat_m: status mask +* @rstat_ok_v: value that indicates PFR completed status +* @rtrigger: offset of reset trigger in register +* @rtrigger_m: reset trigger mask +*/ +struct ixd_reset_reg { +u32 rstat; +u32 rstat_m; +u32 rstat_ok_v; +u32 rtrigger; +u32 rtrigger_m; +}; +#endif /* _IXD_LAN_REGS_H_ */ drivers/net/ethernet/intel/ixd/ixd_lib.c new file +143
-0@@ -0,0 +1,143 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* Copyright (C) 2025 Intel Corporation */ + +#include "ixd.h" + +#define IXD_DFLT_MBX_Q_LEN 64 + +/** +* ixd_init_ctlq_create_info - Initialize control queue info for creation +* @info: destination +* @type: type of the queue to create +* @ctlq_reg: register assigned to the control queue +*/ +static void ixd_init_ctlq_create_info (struct libie_ctlq_create_info *info, +enum virtchnl2_queue_type type, +const struct libie_ctlq_reg *ctlq_reg) +{ + *info = (struct libie_ctlq_create_info ) { + .type = type, + .id =-1 , + .reg = *ctlq_reg, + .len =IXD_DFLT_MBX_Q_LEN , + }; +} + +/** +* ixd_init_libie_xn_params - Initialize xn transaction manager creation info +* @params: destination +* @adapter: adapter info struct +* @ctlqs: list of the managed queues to create +* @num_queues: length of the queue list +*/ +static void ixd_init_libie_xn_params (struct libie_ctlq_xn_init_params *params, +struct ixd_adapter *adapter, +struct libie_ctlq_create_info *ctlqs, +uint num_queues) +{ + *params = (struct libie_ctlq_xn_init_params ){ + .cctlq_info = ctlqs, + .ctx = &adapter->cp_ctx, + .num_qs = num_queues, + }; +} + +/** +* ixd_adapter_fill_dflt_ctlqs - Find default control queues and store them +* @adapter: adapter info struct +*/ +static void ixd_adapter_fill_dflt_ctlqs (struct ixd_adapter *adapter) +{ +guard (spinlock)(&adapter->cp_ctx.ctlqs_lock); +struct libie_ctlq_info *cq; + +list_for_each_entry (cq, &adapter->cp_ctx.ctlqs, list) { +if (cq->qid !=-1 ) +continue ; +if (cq->type ==LIBIE_CTLQ_TYPE_RX ) + adapter->arq = cq; +else if (cq->type ==LIBIE_CTLQ_TYPE_TX ) + adapter->asq = cq; + } +} + +/** +* ixd_deinit_dflt_mbx - Deinitialize default mailbox +* @adapter: adapter info struct +*/ +void ixd_deinit_dflt_mbx (struct ixd_adapter *adapter) +{ +if (adapter->xnm) +libie_ctlq_xn_deinit (adapter->xnm, &adapter->cp_ctx); + + adapter->arq =NULL ; + adapter->asq =NULL ; + adapter->xnm =NULL ; +} + +/** +* ixd_init_dflt_mbx - Setup default mailbox parameters and make request +* @adapter: adapter info struct +* +* Return: %0 on success, negative errno code on failure +*/ +int ixd_init_dflt_mbx (struct ixd_adapter *adapter) +{ +struct libie_ctlq_create_info ctlqs_info[2 ]; +struct libie_ctlq_xn_init_params xn_params; +struct libie_ctlq_reg ctlq_reg_tx; +struct libie_ctlq_reg ctlq_reg_rx; +int err; + +ixd_ctlq_reg_init (adapter, &ctlq_reg_tx, &ctlq_reg_rx); +ixd_init_ctlq_create_info (&ctlqs_info[0 ],LIBIE_CTLQ_TYPE_TX , + &ctlq_reg_tx); +ixd_init_ctlq_create_info (&ctlqs_info[1 ],LIBIE_CTLQ_TYPE_RX , + &ctlq_reg_rx); +ixd_init_libie_xn_params (&xn_params, adapter, ctlqs_info, +ARRAY_SIZE (ctlqs_info)); + err =libie_ctlq_xn_init (&xn_params); +if (err) +return err; + adapter->xnm = xn_params.xnm; + +ixd_adapter_fill_dflt_ctlqs (adapter); + +if (!adapter->asq || !adapter->arq) { +ixd_deinit_dflt_mbx (adapter); +return -ENOENT ; + } + +return 0 ; +} + +/** +* ixd_init_task - Initialize after reset +* @work: init work struct +*/ +void ixd_init_task (struct work_struct *work) +{ +struct ixd_adapter *adapter; +int err; + + adapter = container_of(work, struct ixd_adapter, + init_task.init_work.work); + +if (!ixd_check_reset_complete (adapter)) { +if (++adapter->init_task.reset_retries <10 ) +queue_delayed_work (system_unbound_wq, + &adapter->init_task.init_work, +msecs_to_jiffies (500 )); +else +dev_err (ixd_to_dev (adapter), +"Device reset failed. The driver was unable to contact the device's firmware. Check that the FW is running.\n" ); +return ; + } + + adapter->init_task.reset_retries =0 ; + err =ixd_init_dflt_mbx (adapter); +if (err) +dev_err (ixd_to_dev (adapter), +"Failed to initialize the default mailbox: %pe\n" , +ERR_PTR (err)); +}drivers/net/ethernet/intel/ixd/ixd_main.c +27
-5@@ -5,6 +5,7 @@#include "ixd_lan_regs.h" MODULE_DESCRIPTION ("Intel(R) Control Plane Function Device Driver" ); +MODULE_IMPORT_NS ("LIBIE_CP" );MODULE_IMPORT_NS ("LIBIE_PCI" );MODULE_LICENSE ("GPL" );@@ -16,7 +17,13 @@ static void ixd_remove(struct pci_dev *pdev) {struct ixd_adapter *adapter =pci_get_drvdata (pdev); -libie_pci_unmap_all_mmio_regions (&adapter->hw); +/* Do not mix removal with (re)initialization */ +cancel_delayed_work_sync (&adapter->init_task.init_work); +/* Leave the device clean on exit */ +ixd_trigger_reset (adapter); +ixd_deinit_dflt_mbx (adapter); + +libie_pci_unmap_all_mmio_regions (&adapter->cp_ctx.mmio_info); }/** @@ -51,7 +58,7 @@ static int ixd_iomap_regions(struct ixd_adapter *adapter) };for (int i =0 ; i <ARRAY_SIZE (regions); i++) { -struct libie_mmio_info *mmio_info = &adapter->hw; +struct libie_mmio_info *mmio_info = &adapter->cp_ctx.mmio_info;bool map_ok; map_ok = libie_pci_map_mmio_region(mmio_info,@@ -81,11 +88,15 @@ static int ixd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)struct ixd_adapter *adapter;int err; +if (WARN_ON (ent->device !=IXD_DEV_ID_CPF )) +return -EINVAL ; + adapter =devm_kzalloc (&pdev->dev,sizeof (*adapter),GFP_KERNEL );if (!adapter)return -ENOMEM ; - adapter->hw.pdev = pdev; -INIT_LIST_HEAD (&adapter->hw.mmio_list); + + adapter->cp_ctx.mmio_info.pdev = pdev; +INIT_LIST_HEAD (&adapter->cp_ctx.mmio_info.mmio_list); err =libie_pci_init_dev (pdev);if (err)@@ -93,7 +104,18 @@ static int ixd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)pci_set_drvdata (pdev, adapter); -return ixd_iomap_regions (adapter); + err =ixd_iomap_regions (adapter); +if (err) +return err; + +INIT_DELAYED_WORK (&adapter->init_task.init_work, + ixd_init_task); + +ixd_trigger_reset (adapter); +queue_delayed_work (system_unbound_wq, &adapter->init_task.init_work, +msecs_to_jiffies (500 )); + +return 0 ; }static const struct pci_device_id ixd_pci_tbl[] = {Signature · 1 line
2.47.1
Tony Nguyen
maintainerPATCH v3 13/14 ixd: add the core initialization
In reply to Tony NguyenFrom: Larysa Zaremba <[email protected]>
As the mailbox is setup, initialize the core. This makes use of the send and receive mailbox message framework for virtchnl communication between the driver and device Control Plane (CP).
To start with, driver confirms the virtchnl version with the CP. Once that is done, it requests and gets the required capabilities and resources needed such as max vectors, queues, vports etc.
Use a unified way of handling the virtchnl messages, where a single function handles all related memory management and the caller only provides the callbacks to fill the send buffer and to handle the response.
Place generic control queue message handling separately to facilitate the addition of protocols other than virtchannel in the future.
--- drivers/net/ethernet/intel/ixd/Makefile | 2 + drivers/net/ethernet/intel/ixd/ixd.h | 10 + drivers/net/ethernet/intel/ixd/ixd_ctlq.c | 149 +++++++++++++++ drivers/net/ethernet/intel/ixd/ixd_ctlq.h | 33 ++++ drivers/net/ethernet/intel/ixd/ixd_lib.c | 25 ++- drivers/net/ethernet/intel/ixd/ixd_main.c | 3 + drivers/net/ethernet/intel/ixd/ixd_virtchnl.c | 178 ++++++++++++++++++ drivers/net/ethernet/intel/ixd/ixd_virtchnl.h | 12 ++ 8 files changed, 411 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ethernet/intel/ixd/ixd_ctlq.c create mode 100644 drivers/net/ethernet/intel/ixd/ixd_ctlq.h create mode 100644 drivers/net/ethernet/intel/ixd/ixd_virtchnl.c create mode 100644 drivers/net/ethernet/intel/ixd/ixd_virtchnl.h
drivers/net/ethernet/intel/ixd/Makefile +2 -0
@@ -6,5 +6,7 @@ obj-$(CONFIG_IXD) += ixd.o ixd-y := ixd_main.o +ixd-y += ixd_ctlq.o ixd-y += ixd_dev.o ixd-y += ixd_lib.o +ixd-y += ixd_virtchnl.o
drivers/net/ethernet/intel/ixd/ixd.h +10 -0
@@ -10,19 +10,29 @@* struct ixd_adapter - Data structure representing a CPF * @cp_ctx: Control plane communication context * @init_task: Delayed initialization after reset +* @mbx_task: Control queue Rx handling * @xnm: virtchnl transaction manager * @asq: Send control queue info * @arq: Receive control queue info +* @vc_ver: Negotiated virtchnl version +* @caps: Negotiated virtchnl capabilities */ struct ixd_adapter {struct libie_ctlq_ctx cp_ctx;struct {struct delayed_work init_work;u8 reset_retries; +u8 vc_retries; } init_task; +struct delayed_work mbx_task;struct libie_ctlq_xn_manager *xnm;struct libie_ctlq_info *asq;struct libie_ctlq_info *arq; +struct { +u32 major; +u32 minor; + } vc_ver; +struct virtchnl2_get_capabilities caps; };/**
drivers/net/ethernet/intel/ixd/ixd_ctlq.c new file +149 -0
149 lines not on this page · raw message
drivers/net/ethernet/intel/ixd/ixd_ctlq.h new file +33 -0
@@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* Copyright (C) 2025 Intel Corporation */ + +#ifndef _IXD_CTLQ_H_ +#define _IXD_CTLQ_H_ + +#include <linux/intel/virtchnl2.h> + +#define IXD_CTLQ_TIMEOUT 2000 + +/** +* struct ixd_ctlq_req - Standard virtchnl request description +* @opcode: protocol opcode, only virtchnl2 is needed for now +* @send_size: required length of the send buffer +* @send_buff_init: function to initialize the allocated send buffer +* @recv_process: function to handle the CP response +* @ctx: additional context for callbacks +*/ +struct ixd_ctlq_req { +enum virtchnl2_op opcode; +size_t send_size; +void (*send_buff_init)(struct ixd_adapter *adapter,void *send_buff, +void *ctx); +int (*recv_process)(struct ixd_adapter *adapter,void *recv_buff, +size_t recv_size,void *ctx); +void *ctx; +}; + +int ixd_ctlq_do_req (struct ixd_adapter *adapter, +const struct ixd_ctlq_req *req); +void ixd_ctlq_rx_task (struct work_struct *work); + +#endif /* _IXD_CTLQ_H_ */
drivers/net/ethernet/intel/ixd/ixd_lib.c +24 -1
@@ -2,6 +2,7 @@/* Copyright (C) 2025 Intel Corporation */ #include "ixd.h" +#include "ixd_virtchnl.h" #define IXD_DFLT_MBX_Q_LEN 64
@@ -67,6 +68,8 @@ static void ixd_adapter_fill_dflt_ctlqs(struct ixd_adapter *adapter)*/ void ixd_deinit_dflt_mbx (struct ixd_adapter *adapter) { +cancel_delayed_work_sync (&adapter->mbx_task); +if (adapter->xnm)libie_ctlq_xn_deinit (adapter->xnm, &adapter->cp_ctx);
@@ -108,6 +111,8 @@ int ixd_init_dflt_mbx(struct ixd_adapter *adapter)return -ENOENT ; } +queue_delayed_work (system_unbound_wq, &adapter->mbx_task,0 ); +return 0 ; }
@@ -136,8 +141,26 @@ void ixd_init_task(struct work_struct *work) adapter->init_task.reset_retries =0 ; err =ixd_init_dflt_mbx (adapter); -if (err) +if (err) {dev_err (ixd_to_dev (adapter),"Failed to initialize the default mailbox: %pe\n" ,ERR_PTR (err)); +return ; + } + +if (!ixd_vc_dev_init (adapter)) { + adapter->init_task.vc_retries =0 ; +return ; + } + +ixd_deinit_dflt_mbx (adapter); +if (++adapter->init_task.vc_retries >5 ) { +dev_err (ixd_to_dev (adapter), +"Failed to establish mailbox communications with the hardware\n" ); +return ; + } + +ixd_trigger_reset (adapter); +queue_delayed_work (system_unbound_wq, &adapter->init_task.init_work, +msecs_to_jiffies (500 )); }
drivers/net/ethernet/intel/ixd/ixd_main.c +3 -0
@@ -2,6 +2,7 @@/* Copyright (C) 2025 Intel Corporation */ #include "ixd.h" +#include "ixd_ctlq.h" #include "ixd_lan_regs.h" MODULE_DESCRIPTION ("Intel(R) Control Plane Function Device Driver" );
@@ -19,6 +20,7 @@ static void ixd_remove(struct pci_dev *pdev)/* Do not mix removal with (re)initialization */ cancel_delayed_work_sync (&adapter->init_task.init_work); +/* Leave the device clean on exit */ ixd_trigger_reset (adapter);ixd_deinit_dflt_mbx (adapter);
@@ -110,6 +112,7 @@ static int ixd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)INIT_DELAYED_WORK (&adapter->init_task.init_work, ixd_init_task); +INIT_DELAYED_WORK (&adapter->mbx_task, ixd_ctlq_rx_task);ixd_trigger_reset (adapter); queue_delayed_work(system_unbound_wq, &adapter->init_task.init_work,
drivers/net/ethernet/intel/ixd/ixd_virtchnl.c new file +178 -0
178 lines not on this page · raw message
drivers/net/ethernet/intel/ixd/ixd_virtchnl.h new file +12 -0
@@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* Copyright (C) 2025 Intel Corporation */ + +#ifndef _IXD_VIRTCHNL_H_ +#define _IXD_VIRTCHNL_H_ + +int ixd_vc_dev_init (struct ixd_adapter *adapter); +bool ixd_vc_can_handle_msg (struct libie_ctlq_msg *ctlq_msg); +void ixd_vc_recv_event_msg (struct ixd_adapter *adapter, +struct libie_ctlq_msg *ctlq_msg); + +#endif /* _IXD_VIRTCHNL_H_ */
Signature · 1 line
2.47.1
Re: [PATCH net-next v3 13/14] ixd: add the core initialization
Quoted 10 lines · Tony Nguyen
From: Larysa Zaremba <[email protected]>
As the mailbox is setup, initialize the core. This makes use of the send and receive mailbox message framework for virtchnl communication between the driver and device Control Plane (CP).
To start with, driver confirms the virtchnl version with the CP. Once that is done, it requests and gets the required capabilities and resources needed such as max vectors, queues, vports etc.
Quoted 7 lines
Use a unified way of handling the virtchnl messages, where a single function handles all related memory management and the caller only provides the callbacks to fill the send buffer and to handle the response.
Place generic control queue message handling separately to facilitate the addition of protocols other than virtchannel in the future.
Regarding Sashiko feedback [0]:
1. Major version handling is OK.
2. Regarding other concerns, I think code is good enough for an introductory boilerplate patch. Below is a diff addressing those issues, it still does not handle HW Tx queue stalls, but I think this is fine at this development stage.
drivers/net/ethernet/intel/ixd/ixd_ctlq.c +2 -2
@@ -62,8 +62,8 @@ static void ixd_ctlq_init_sparams(struct ixd_adapter *adapter,*/ int ixd_ctlq_do_req (struct ixd_adapter *adapter,const struct ixd_ctlq_req *req) { + u8 onstack_send_buff[LIBIE_CP_TX_COPYBREAK] __aligned_largest = {};struct libie_ctlq_xn_send_params send_params = {}; -u8 onstack_send_buff[LIBIE_CP_TX_COPYBREAK ] = {};struct kvec *recv_mem;void *send_buff;int err;
@@ -82,6 +82,7 @@ int ixd_ctlq_do_req(struct ixd_adapter *adapter, const struct ixd_ctlq_req *req) req->send_buff_init (adapter, send_buff, req->ctx); err =libie_ctlq_xn_send (&send_params); +ixd_ctlq_clean_sq (adapter,1 );if (err)return err;
@@ -90,7 +91,6 @@ int ixd_ctlq_do_req(struct ixd_adapter *adapter, const struct ixd_ctlq_req *req) err = req->recv_process (adapter, recv_mem->iov_base, recv_mem->iov_len, req->ctx); -ixd_ctlq_clean_sq (adapter,1 );libie_ctlq_release_rx_buf (recv_mem);return err;
[0] https://sashiko.dev/#/patchset/20260515224443.2772147-1-anthony.l.nguyen%40intel.com
Quoted 552 lines
Co-developed-by Amritha Nambiar <[email protected]>Signed-off-by Amritha Nambiar <[email protected]>Reviewed-by Maciej Fijalkowski <[email protected]>Signed-off-by Larysa Zaremba <[email protected]>Tested-by Bharath R <[email protected]>Signed-off-by Tony Nguyen <[email protected]>--- drivers/net/ethernet/intel/ixd/Makefile | 2 + drivers/net/ethernet/intel/ixd/ixd.h | 10 + drivers/net/ethernet/intel/ixd/ixd_ctlq.c | 149 +++++++++++++++ drivers/net/ethernet/intel/ixd/ixd_ctlq.h | 33 ++++ drivers/net/ethernet/intel/ixd/ixd_lib.c | 25 ++- drivers/net/ethernet/intel/ixd/ixd_main.c | 3 + drivers/net/ethernet/intel/ixd/ixd_virtchnl.c | 178 ++++++++++++++++++ drivers/net/ethernet/intel/ixd/ixd_virtchnl.h | 12 ++ 8 files changed, 411 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ethernet/intel/ixd/ixd_ctlq.c create mode 100644 drivers/net/ethernet/intel/ixd/ixd_ctlq.h create mode 100644 drivers/net/ethernet/intel/ixd/ixd_virtchnl.c create mode 100644 drivers/net/ethernet/intel/ixd/ixd_virtchnl.hdrivers/net/ethernet/intel/ixd/Makefile +2
-0@@ -6,5 +6,7 @@ obj-$(CONFIG_IXD) += ixd.o ixd-y := ixd_main.o +ixd-y += ixd_ctlq.o ixd-y += ixd_dev.o ixd-y += ixd_lib.o +ixd-y += ixd_virtchnl.odrivers/net/ethernet/intel/ixd/ixd.h +10
-0@@ -10,19 +10,29 @@* struct ixd_adapter - Data structure representing a CPF * @cp_ctx: Control plane communication context * @init_task: Delayed initialization after reset +* @mbx_task: Control queue Rx handling * @xnm: virtchnl transaction manager * @asq: Send control queue info * @arq: Receive control queue info +* @vc_ver: Negotiated virtchnl version +* @caps: Negotiated virtchnl capabilities */ struct ixd_adapter {struct libie_ctlq_ctx cp_ctx;struct {struct delayed_work init_work;u8 reset_retries; +u8 vc_retries; } init_task; +struct delayed_work mbx_task;struct libie_ctlq_xn_manager *xnm;struct libie_ctlq_info *asq;struct libie_ctlq_info *arq; +struct { +u32 major; +u32 minor; + } vc_ver; +struct virtchnl2_get_capabilities caps; };/** drivers/net/ethernet/intel/ixd/ixd_ctlq.c new file +149
-0@@ -0,0 +1,149 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* Copyright (C) 2025 Intel Corporation */ + +#include "ixd.h" +#include "ixd_ctlq.h" +#include "ixd_virtchnl.h" + +/** +* ixd_ctlq_clean_sq - Clean the send control queue after sending the message +* @adapter: The adapter that sent the messages +* @num_sent: Number of sent messages to be released +* +* Free the libie send resources after sending the message and handling +* the response. +*/ +static void ixd_ctlq_clean_sq (struct ixd_adapter *adapter,u16 num_sent) +{ +if (!num_sent) +return ; + +struct libie_ctlq_xn_clean_params params = { + .ctlq = adapter->asq, + .ctx = &adapter->cp_ctx, + .num_msgs = num_sent, + .rel_tx_buf = kfree, + }; + +libie_ctlq_xn_send_clean (¶ms); +} + +/** +* ixd_ctlq_init_sparams - Initialize control queue send parameters +* @adapter: The adapter with initialized mailbox +* @sparams: Parameters to initialize +* @msg_buf: DMA-mappable pointer to the message being sent +* @msg_size: Message size +*/ +static void ixd_ctlq_init_sparams (struct ixd_adapter *adapter, +struct libie_ctlq_xn_send_params *sparams, +void *msg_buf,size_t msg_size) +{ + *sparams = (struct libie_ctlq_xn_send_params ) { + .rel_tx_buf = kfree, + .xnm = adapter->xnm, + .ctlq = adapter->asq, + .timeout_ms =IXD_CTLQ_TIMEOUT , + .send_buf = (struct kvec ) { + .iov_base = msg_buf, + .iov_len = msg_size, + }, + }; +} + +/** +* ixd_ctlq_do_req - Perform a standard virtchnl request +* @adapter: The adapter with initialized mailbox +* @req: virtchnl request description +* +* Return: %0 if a message was sent and received a response +* that was successfully handled by the custom callback, +* negative error otherwise. +*/ +int ixd_ctlq_do_req (struct ixd_adapter *adapter,const struct ixd_ctlq_req *req) +{ +struct libie_ctlq_xn_send_params send_params = {}; +u8 onstack_send_buff[LIBIE_CP_TX_COPYBREAK ] = {}; +struct kvec *recv_mem; +void *send_buff; +int err; + + send_buff =libie_cp_can_send_onstack (req->send_size) ? + &onstack_send_buff :kzalloc (req->send_size,GFP_KERNEL ); +if (!send_buff) +return -ENOMEM ; + +ixd_ctlq_init_sparams (adapter, &send_params, send_buff, + req->send_size); + + send_params.chnl_opcode = req->opcode; + +if (req->send_buff_init) + req->send_buff_init (adapter, send_buff, req->ctx); + + err =libie_ctlq_xn_send (&send_params); +if (err) +return err; + + recv_mem = &send_params.recv_mem; +if (req->recv_process) + err = req->recv_process (adapter, recv_mem->iov_base, + recv_mem->iov_len, req->ctx); + +ixd_ctlq_clean_sq (adapter,1 ); +libie_ctlq_release_rx_buf (recv_mem); + +return err; +} + +/** +* ixd_ctlq_handle_msg - Default control queue message handler +* @ctx: Control plane communication context +* @msg: Message received +*/ +static void ixd_ctlq_handle_msg (struct libie_ctlq_ctx *ctx, +struct libie_ctlq_msg *msg) +{ +struct ixd_adapter *adapter =pci_get_drvdata (ctx->mmio_info.pdev); + +if (ixd_vc_can_handle_msg (msg)) +ixd_vc_recv_event_msg (adapter, msg); +else +dev_dbg_ratelimited (ixd_to_dev (adapter), +"Received an unsupported opcode 0x%x from the CP\n" , + msg->chnl_opcode); + +libie_ctlq_release_rx_buf (&msg->recv_mem); +} + +/** +* ixd_ctlq_recv_mb_msg - Receive a potential message over mailbox periodically +* @adapter: The adapter with initialized mailbox +*/ +static void ixd_ctlq_recv_mb_msg (struct ixd_adapter *adapter) +{ +struct libie_ctlq_xn_recv_params xn_params = { + .xnm = adapter->xnm, + .ctlq = adapter->arq, + .ctlq_msg_handler = ixd_ctlq_handle_msg, + .budget =LIBIE_CTLQ_MAX_XN_ENTRIES , + }; + +libie_ctlq_xn_recv (&xn_params); +} + +/** +* ixd_ctlq_rx_task - Periodically check for mailbox responses and events +* @work: work handle +*/ +void ixd_ctlq_rx_task (struct work_struct *work) +{ +struct ixd_adapter *adapter; + + adapter = container_of(work, struct ixd_adapter, mbx_task.work); + +queue_delayed_work (system_unbound_wq, &adapter->mbx_task, +msecs_to_jiffies (300 )); + +ixd_ctlq_recv_mb_msg (adapter); +}drivers/net/ethernet/intel/ixd/ixd_ctlq.h new file +33
-0@@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* Copyright (C) 2025 Intel Corporation */ + +#ifndef _IXD_CTLQ_H_ +#define _IXD_CTLQ_H_ + +#include <linux/intel/virtchnl2.h> + +#define IXD_CTLQ_TIMEOUT 2000 + +/** +* struct ixd_ctlq_req - Standard virtchnl request description +* @opcode: protocol opcode, only virtchnl2 is needed for now +* @send_size: required length of the send buffer +* @send_buff_init: function to initialize the allocated send buffer +* @recv_process: function to handle the CP response +* @ctx: additional context for callbacks +*/ +struct ixd_ctlq_req { +enum virtchnl2_op opcode; +size_t send_size; +void (*send_buff_init)(struct ixd_adapter *adapter,void *send_buff, +void *ctx); +int (*recv_process)(struct ixd_adapter *adapter,void *recv_buff, +size_t recv_size,void *ctx); +void *ctx; +}; + +int ixd_ctlq_do_req (struct ixd_adapter *adapter, +const struct ixd_ctlq_req *req); +void ixd_ctlq_rx_task (struct work_struct *work); + +#endif /* _IXD_CTLQ_H_ */ drivers/net/ethernet/intel/ixd/ixd_lib.c +24
-1@@ -2,6 +2,7 @@/* Copyright (C) 2025 Intel Corporation */ #include "ixd.h" +#include "ixd_virtchnl.h" #define IXD_DFLT_MBX_Q_LEN 64@@ -67,6 +68,8 @@ static void ixd_adapter_fill_dflt_ctlqs(struct ixd_adapter *adapter)*/ void ixd_deinit_dflt_mbx (struct ixd_adapter *adapter) { +cancel_delayed_work_sync (&adapter->mbx_task); +if (adapter->xnm)libie_ctlq_xn_deinit (adapter->xnm, &adapter->cp_ctx);@@ -108,6 +111,8 @@ int ixd_init_dflt_mbx(struct ixd_adapter *adapter)return -ENOENT ; } +queue_delayed_work (system_unbound_wq, &adapter->mbx_task,0 ); +return 0 ; }@@ -136,8 +141,26 @@ void ixd_init_task(struct work_struct *work) adapter->init_task.reset_retries =0 ; err =ixd_init_dflt_mbx (adapter); -if (err) +if (err) {dev_err (ixd_to_dev (adapter),"Failed to initialize the default mailbox: %pe\n" ,ERR_PTR (err)); +return ; + } + +if (!ixd_vc_dev_init (adapter)) { + adapter->init_task.vc_retries =0 ; +return ; + } + +ixd_deinit_dflt_mbx (adapter); +if (++adapter->init_task.vc_retries >5 ) { +dev_err (ixd_to_dev (adapter), +"Failed to establish mailbox communications with the hardware\n" ); +return ; + } + +ixd_trigger_reset (adapter); +queue_delayed_work (system_unbound_wq, &adapter->init_task.init_work, +msecs_to_jiffies (500 )); }drivers/net/ethernet/intel/ixd/ixd_main.c +3
-0@@ -2,6 +2,7 @@/* Copyright (C) 2025 Intel Corporation */ #include "ixd.h" +#include "ixd_ctlq.h" #include "ixd_lan_regs.h" MODULE_DESCRIPTION ("Intel(R) Control Plane Function Device Driver" );@@ -19,6 +20,7 @@ static void ixd_remove(struct pci_dev *pdev)/* Do not mix removal with (re)initialization */ cancel_delayed_work_sync (&adapter->init_task.init_work); +/* Leave the device clean on exit */ ixd_trigger_reset (adapter);ixd_deinit_dflt_mbx (adapter);@@ -110,6 +112,7 @@ static int ixd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)INIT_DELAYED_WORK (&adapter->init_task.init_work, ixd_init_task); +INIT_DELAYED_WORK (&adapter->mbx_task, ixd_ctlq_rx_task);ixd_trigger_reset (adapter); queue_delayed_work(system_unbound_wq, &adapter->init_task.init_work,drivers/net/ethernet/intel/ixd/ixd_virtchnl.c new file +178
-0@@ -0,0 +1,178 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* Copyright (C) 2025 Intel Corporation */ + +#include "ixd.h" +#include "ixd_ctlq.h" +#include "ixd_virtchnl.h" + +/** +* ixd_vc_recv_event_msg - Handle virtchnl event message +* @adapter: The adapter handling the message +* @ctlq_msg: Message received +*/ +void ixd_vc_recv_event_msg (struct ixd_adapter *adapter, +struct libie_ctlq_msg *ctlq_msg) +{ +int payload_size = ctlq_msg->data_len; +struct virtchnl2_event *v2e; + +if (payload_size <sizeof (*v2e)) { +dev_warn_ratelimited (ixd_to_dev (adapter), +"Failed to receive valid payload for event msg (op 0x%X len %u)\n" , + ctlq_msg->chnl_opcode, + payload_size); +return ; + } + + v2e = (struct virtchnl2_event *)ctlq_msg->recv_mem.iov_base; + +dev_dbg (ixd_to_dev (adapter),"Got event 0x%X from the CP\n" , +le32_to_cpu (v2e->event)); +} + +/** +* ixd_vc_can_handle_msg - Decide if an event has to be handled by virtchnl code +* @ctlq_msg: Message received +* +* Return: %true if virtchnl code can handle the event, %false otherwise +*/ +bool ixd_vc_can_handle_msg (struct libie_ctlq_msg *ctlq_msg) +{ +return ctlq_msg->chnl_opcode ==VIRTCHNL2_OP_EVENT ; +} + +/** +* ixd_handle_caps - Handle VIRTCHNL2_OP_GET_CAPS response +* @adapter: The adapter for which the capabilities are being updated +* @recv_buff: Buffer containing the response +* @recv_size: Response buffer size +* @ctx: unused +* +* Return: %0 if the response format is correct and was handled as expected, +* negative error otherwise. +*/ +static int ixd_handle_caps (struct ixd_adapter *adapter,void *recv_buff, +size_t recv_size,void *ctx) +{ +if (recv_size <sizeof (adapter->caps)) +return -EBADMSG ; + + adapter->caps = *(typeof(adapter->caps) *)recv_buff; + +return 0 ; +} + +/** +* ixd_req_vc_caps - Request and save device capability +* @adapter: The adapter to get the capabilities for +* +* Return: success or error if sending the get capability message fails +*/ +static int ixd_req_vc_caps (struct ixd_adapter *adapter) +{ +const struct ixd_ctlq_req req = { + .opcode =VIRTCHNL2_OP_GET_CAPS , + .send_size =sizeof (struct virtchnl2_get_capabilities ), + .ctx =NULL , + .send_buff_init =NULL , + .recv_process = ixd_handle_caps, + }; + +return ixd_ctlq_do_req (adapter, &req); +} + +/** +* ixd_get_vc_ver - Get version info from adapter +* +* Return: filled in virtchannel2 version info, ready for sending +*/ +static struct virtchnl2_version_info ixd_get_vc_ver (void ) +{ +return (struct virtchnl2_version_info ) { + .major =cpu_to_le32 (VIRTCHNL2_VERSION_MAJOR_2 ), + .minor =cpu_to_le32 (VIRTCHNL2_VERSION_MINOR_0 ), + }; +} + +static void ixd_fill_vc_ver (struct ixd_adapter *adapter,void *send_buff, +void *ctx) +{ + *(struct virtchnl2_version_info *)send_buff =ixd_get_vc_ver (); +} + +/** +* ixd_handle_vc_ver - Handle VIRTCHNL2_OP_VERSION response +* @adapter: The adapter for which the version is being updated +* @recv_buff: Buffer containing the response +* @recv_size: Response buffer size +* @ctx: Unused +* +* Return: %0 if the response format is correct and was handled as expected, +* negative error otherwise. +*/ +static int ixd_handle_vc_ver (struct ixd_adapter *adapter,void *recv_buff, +size_t recv_size,void *ctx) +{ +struct virtchnl2_version_info need_ver =ixd_get_vc_ver (); +struct virtchnl2_version_info *recv_ver; + +if (recv_size <sizeof (need_ver)) +return -EBADMSG ; + + recv_ver = recv_buff; +if (le32_to_cpu (need_ver.major) >le32_to_cpu (recv_ver->major)) +return -EOPNOTSUPP ; + + adapter->vc_ver.major =le32_to_cpu (recv_ver->major); + adapter->vc_ver.minor =le32_to_cpu (recv_ver->minor); + +return 0 ; +} + +/** +* ixd_req_vc_version - Request and save Virtchannel2 version +* @adapter: The adapter to get the version for +* +* Return: success or error if sending fails or the response was not as expected +*/ +static int ixd_req_vc_version (struct ixd_adapter *adapter) +{ +const struct ixd_ctlq_req req = { + .opcode =VIRTCHNL2_OP_VERSION , + .send_size =sizeof (struct virtchnl2_version_info ), + .ctx =NULL , + .send_buff_init = ixd_fill_vc_ver, + .recv_process = ixd_handle_vc_ver, + }; + +return ixd_ctlq_do_req (adapter, &req); +} + +/** +* ixd_vc_dev_init - virtchnl device core initialization +* @adapter: device information +* +* Return: %0 on success or error if any step of the initialization fails +*/ +int ixd_vc_dev_init (struct ixd_adapter *adapter) +{ +int err; + + err =ixd_req_vc_version (adapter); +if (err) { +dev_warn (ixd_to_dev (adapter), +"Getting virtchnl version failed, error=%pe\n" , +ERR_PTR (err)); +return err; + } + + err =ixd_req_vc_caps (adapter); +if (err) { +dev_warn (ixd_to_dev (adapter), +"Getting virtchnl capabilities failed, error=%pe\n" , +ERR_PTR (err)); +return err; + } + +return err; +}drivers/net/ethernet/intel/ixd/ixd_virtchnl.h new file +12
-0@@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* Copyright (C) 2025 Intel Corporation */ + +#ifndef _IXD_VIRTCHNL_H_ +#define _IXD_VIRTCHNL_H_ + +int ixd_vc_dev_init (struct ixd_adapter *adapter); +bool ixd_vc_can_handle_msg (struct libie_ctlq_msg *ctlq_msg); +void ixd_vc_recv_event_msg (struct ixd_adapter *adapter, +struct libie_ctlq_msg *ctlq_msg); + +#endif /* _IXD_VIRTCHNL_H_ */ Signature · 1 line
2.47.1
Re: [PATCH net-next v3 13/14] ixd: add the core initialization
In reply to Tony NguyenQuoted 10 lines · Tony Nguyen
From: Larysa Zaremba <[email protected]>
As the mailbox is setup, initialize the core. This makes use of the send and receive mailbox message framework for virtchnl communication between the driver and device Control Plane (CP).
To start with, driver confirms the virtchnl version with the CP. Once that is done, it requests and gets the required capabilities and resources needed such as max vectors, queues, vports etc.
Quoted 6 lines
Use a unified way of handling the virtchnl messages, where a single function handles all related memory management and the caller only provides the callbacks to fill the send buffer and to handle the response.
Place generic control queue message handling separately to facilitate the addition of protocols other than virtchannel in the future.
Sashiko's concern about devlink being registered too early is actually valid. Would say this is not a serious issue at this stage in the development, but here is a diff addressing this:
drivers/net/ethernet/intel/ixd/ixd_lib.c +2 -0
@@ -2,6 +2,7 @@/* Copyright (C) 2025 Intel Corporation */ #include "ixd.h" +#include "ixd_devlink.h" #include "ixd_virtchnl.h" #define IXD_DFLT_MBX_Q_LEN 64
@@ -150,6 +151,7 @@ void ixd_init_task(struct work_struct *work)if (!ixd_vc_dev_init (adapter)) { adapter->init_task.vc_retries =0 ; +ixd_devlink_register (adapter);return ; }
drivers/net/ethernet/intel/ixd/ixd_main.c +0 -2
@@ -125,8 +125,6 @@ static int ixd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)queue_delayed_work (system_unbound_wq, &adapter->init_task.init_work,msecs_to_jiffies (500 )); -ixd_devlink_register (adapter); -return 0 ; free_adapter:
Quoted 553 lines
Co-developed-by Amritha Nambiar <[email protected]>Signed-off-by Amritha Nambiar <[email protected]>Reviewed-by Maciej Fijalkowski <[email protected]>Signed-off-by Larysa Zaremba <[email protected]>Tested-by Bharath R <[email protected]>Signed-off-by Tony Nguyen <[email protected]>--- drivers/net/ethernet/intel/ixd/Makefile | 2 + drivers/net/ethernet/intel/ixd/ixd.h | 10 + drivers/net/ethernet/intel/ixd/ixd_ctlq.c | 149 +++++++++++++++ drivers/net/ethernet/intel/ixd/ixd_ctlq.h | 33 ++++ drivers/net/ethernet/intel/ixd/ixd_lib.c | 25 ++- drivers/net/ethernet/intel/ixd/ixd_main.c | 3 + drivers/net/ethernet/intel/ixd/ixd_virtchnl.c | 178 ++++++++++++++++++ drivers/net/ethernet/intel/ixd/ixd_virtchnl.h | 12 ++ 8 files changed, 411 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ethernet/intel/ixd/ixd_ctlq.c create mode 100644 drivers/net/ethernet/intel/ixd/ixd_ctlq.h create mode 100644 drivers/net/ethernet/intel/ixd/ixd_virtchnl.c create mode 100644 drivers/net/ethernet/intel/ixd/ixd_virtchnl.hdrivers/net/ethernet/intel/ixd/Makefile +2
-0@@ -6,5 +6,7 @@ obj-$(CONFIG_IXD) += ixd.o ixd-y := ixd_main.o +ixd-y += ixd_ctlq.o ixd-y += ixd_dev.o ixd-y += ixd_lib.o +ixd-y += ixd_virtchnl.odrivers/net/ethernet/intel/ixd/ixd.h +10
-0@@ -10,19 +10,29 @@* struct ixd_adapter - Data structure representing a CPF * @cp_ctx: Control plane communication context * @init_task: Delayed initialization after reset +* @mbx_task: Control queue Rx handling * @xnm: virtchnl transaction manager * @asq: Send control queue info * @arq: Receive control queue info +* @vc_ver: Negotiated virtchnl version +* @caps: Negotiated virtchnl capabilities */ struct ixd_adapter {struct libie_ctlq_ctx cp_ctx;struct {struct delayed_work init_work;u8 reset_retries; +u8 vc_retries; } init_task; +struct delayed_work mbx_task;struct libie_ctlq_xn_manager *xnm;struct libie_ctlq_info *asq;struct libie_ctlq_info *arq; +struct { +u32 major; +u32 minor; + } vc_ver; +struct virtchnl2_get_capabilities caps; };/** drivers/net/ethernet/intel/ixd/ixd_ctlq.c new file +149
-0@@ -0,0 +1,149 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* Copyright (C) 2025 Intel Corporation */ + +#include "ixd.h" +#include "ixd_ctlq.h" +#include "ixd_virtchnl.h" + +/** +* ixd_ctlq_clean_sq - Clean the send control queue after sending the message +* @adapter: The adapter that sent the messages +* @num_sent: Number of sent messages to be released +* +* Free the libie send resources after sending the message and handling +* the response. +*/ +static void ixd_ctlq_clean_sq (struct ixd_adapter *adapter,u16 num_sent) +{ +if (!num_sent) +return ; + +struct libie_ctlq_xn_clean_params params = { + .ctlq = adapter->asq, + .ctx = &adapter->cp_ctx, + .num_msgs = num_sent, + .rel_tx_buf = kfree, + }; + +libie_ctlq_xn_send_clean (¶ms); +} + +/** +* ixd_ctlq_init_sparams - Initialize control queue send parameters +* @adapter: The adapter with initialized mailbox +* @sparams: Parameters to initialize +* @msg_buf: DMA-mappable pointer to the message being sent +* @msg_size: Message size +*/ +static void ixd_ctlq_init_sparams (struct ixd_adapter *adapter, +struct libie_ctlq_xn_send_params *sparams, +void *msg_buf,size_t msg_size) +{ + *sparams = (struct libie_ctlq_xn_send_params ) { + .rel_tx_buf = kfree, + .xnm = adapter->xnm, + .ctlq = adapter->asq, + .timeout_ms =IXD_CTLQ_TIMEOUT , + .send_buf = (struct kvec ) { + .iov_base = msg_buf, + .iov_len = msg_size, + }, + }; +} + +/** +* ixd_ctlq_do_req - Perform a standard virtchnl request +* @adapter: The adapter with initialized mailbox +* @req: virtchnl request description +* +* Return: %0 if a message was sent and received a response +* that was successfully handled by the custom callback, +* negative error otherwise. +*/ +int ixd_ctlq_do_req (struct ixd_adapter *adapter,const struct ixd_ctlq_req *req) +{ +struct libie_ctlq_xn_send_params send_params = {}; +u8 onstack_send_buff[LIBIE_CP_TX_COPYBREAK ] = {}; +struct kvec *recv_mem; +void *send_buff; +int err; + + send_buff =libie_cp_can_send_onstack (req->send_size) ? + &onstack_send_buff :kzalloc (req->send_size,GFP_KERNEL ); +if (!send_buff) +return -ENOMEM ; + +ixd_ctlq_init_sparams (adapter, &send_params, send_buff, + req->send_size); + + send_params.chnl_opcode = req->opcode; + +if (req->send_buff_init) + req->send_buff_init (adapter, send_buff, req->ctx); + + err =libie_ctlq_xn_send (&send_params); +if (err) +return err; + + recv_mem = &send_params.recv_mem; +if (req->recv_process) + err = req->recv_process (adapter, recv_mem->iov_base, + recv_mem->iov_len, req->ctx); + +ixd_ctlq_clean_sq (adapter,1 ); +libie_ctlq_release_rx_buf (recv_mem); + +return err; +} + +/** +* ixd_ctlq_handle_msg - Default control queue message handler +* @ctx: Control plane communication context +* @msg: Message received +*/ +static void ixd_ctlq_handle_msg (struct libie_ctlq_ctx *ctx, +struct libie_ctlq_msg *msg) +{ +struct ixd_adapter *adapter =pci_get_drvdata (ctx->mmio_info.pdev); + +if (ixd_vc_can_handle_msg (msg)) +ixd_vc_recv_event_msg (adapter, msg); +else +dev_dbg_ratelimited (ixd_to_dev (adapter), +"Received an unsupported opcode 0x%x from the CP\n" , + msg->chnl_opcode); + +libie_ctlq_release_rx_buf (&msg->recv_mem); +} + +/** +* ixd_ctlq_recv_mb_msg - Receive a potential message over mailbox periodically +* @adapter: The adapter with initialized mailbox +*/ +static void ixd_ctlq_recv_mb_msg (struct ixd_adapter *adapter) +{ +struct libie_ctlq_xn_recv_params xn_params = { + .xnm = adapter->xnm, + .ctlq = adapter->arq, + .ctlq_msg_handler = ixd_ctlq_handle_msg, + .budget =LIBIE_CTLQ_MAX_XN_ENTRIES , + }; + +libie_ctlq_xn_recv (&xn_params); +} + +/** +* ixd_ctlq_rx_task - Periodically check for mailbox responses and events +* @work: work handle +*/ +void ixd_ctlq_rx_task (struct work_struct *work) +{ +struct ixd_adapter *adapter; + + adapter = container_of(work, struct ixd_adapter, mbx_task.work); + +queue_delayed_work (system_unbound_wq, &adapter->mbx_task, +msecs_to_jiffies (300 )); + +ixd_ctlq_recv_mb_msg (adapter); +}drivers/net/ethernet/intel/ixd/ixd_ctlq.h new file +33
-0@@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* Copyright (C) 2025 Intel Corporation */ + +#ifndef _IXD_CTLQ_H_ +#define _IXD_CTLQ_H_ + +#include <linux/intel/virtchnl2.h> + +#define IXD_CTLQ_TIMEOUT 2000 + +/** +* struct ixd_ctlq_req - Standard virtchnl request description +* @opcode: protocol opcode, only virtchnl2 is needed for now +* @send_size: required length of the send buffer +* @send_buff_init: function to initialize the allocated send buffer +* @recv_process: function to handle the CP response +* @ctx: additional context for callbacks +*/ +struct ixd_ctlq_req { +enum virtchnl2_op opcode; +size_t send_size; +void (*send_buff_init)(struct ixd_adapter *adapter,void *send_buff, +void *ctx); +int (*recv_process)(struct ixd_adapter *adapter,void *recv_buff, +size_t recv_size,void *ctx); +void *ctx; +}; + +int ixd_ctlq_do_req (struct ixd_adapter *adapter, +const struct ixd_ctlq_req *req); +void ixd_ctlq_rx_task (struct work_struct *work); + +#endif /* _IXD_CTLQ_H_ */ drivers/net/ethernet/intel/ixd/ixd_lib.c +24
-1@@ -2,6 +2,7 @@/* Copyright (C) 2025 Intel Corporation */ #include "ixd.h" +#include "ixd_virtchnl.h" #define IXD_DFLT_MBX_Q_LEN 64@@ -67,6 +68,8 @@ static void ixd_adapter_fill_dflt_ctlqs(struct ixd_adapter *adapter)*/ void ixd_deinit_dflt_mbx (struct ixd_adapter *adapter) { +cancel_delayed_work_sync (&adapter->mbx_task); +if (adapter->xnm)libie_ctlq_xn_deinit (adapter->xnm, &adapter->cp_ctx);@@ -108,6 +111,8 @@ int ixd_init_dflt_mbx(struct ixd_adapter *adapter)return -ENOENT ; } +queue_delayed_work (system_unbound_wq, &adapter->mbx_task,0 ); +return 0 ; }@@ -136,8 +141,26 @@ void ixd_init_task(struct work_struct *work) adapter->init_task.reset_retries =0 ; err =ixd_init_dflt_mbx (adapter); -if (err) +if (err) {dev_err (ixd_to_dev (adapter),"Failed to initialize the default mailbox: %pe\n" ,ERR_PTR (err)); +return ; + } + +if (!ixd_vc_dev_init (adapter)) { + adapter->init_task.vc_retries =0 ; +return ; + } + +ixd_deinit_dflt_mbx (adapter); +if (++adapter->init_task.vc_retries >5 ) { +dev_err (ixd_to_dev (adapter), +"Failed to establish mailbox communications with the hardware\n" ); +return ; + } + +ixd_trigger_reset (adapter); +queue_delayed_work (system_unbound_wq, &adapter->init_task.init_work, +msecs_to_jiffies (500 )); }drivers/net/ethernet/intel/ixd/ixd_main.c +3
-0@@ -2,6 +2,7 @@/* Copyright (C) 2025 Intel Corporation */ #include "ixd.h" +#include "ixd_ctlq.h" #include "ixd_lan_regs.h" MODULE_DESCRIPTION ("Intel(R) Control Plane Function Device Driver" );@@ -19,6 +20,7 @@ static void ixd_remove(struct pci_dev *pdev)/* Do not mix removal with (re)initialization */ cancel_delayed_work_sync (&adapter->init_task.init_work); +/* Leave the device clean on exit */ ixd_trigger_reset (adapter);ixd_deinit_dflt_mbx (adapter);@@ -110,6 +112,7 @@ static int ixd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)INIT_DELAYED_WORK (&adapter->init_task.init_work, ixd_init_task); +INIT_DELAYED_WORK (&adapter->mbx_task, ixd_ctlq_rx_task);ixd_trigger_reset (adapter); queue_delayed_work(system_unbound_wq, &adapter->init_task.init_work,drivers/net/ethernet/intel/ixd/ixd_virtchnl.c new file +178
-0@@ -0,0 +1,178 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* Copyright (C) 2025 Intel Corporation */ + +#include "ixd.h" +#include "ixd_ctlq.h" +#include "ixd_virtchnl.h" + +/** +* ixd_vc_recv_event_msg - Handle virtchnl event message +* @adapter: The adapter handling the message +* @ctlq_msg: Message received +*/ +void ixd_vc_recv_event_msg (struct ixd_adapter *adapter, +struct libie_ctlq_msg *ctlq_msg) +{ +int payload_size = ctlq_msg->data_len; +struct virtchnl2_event *v2e; + +if (payload_size <sizeof (*v2e)) { +dev_warn_ratelimited (ixd_to_dev (adapter), +"Failed to receive valid payload for event msg (op 0x%X len %u)\n" , + ctlq_msg->chnl_opcode, + payload_size); +return ; + } + + v2e = (struct virtchnl2_event *)ctlq_msg->recv_mem.iov_base; + +dev_dbg (ixd_to_dev (adapter),"Got event 0x%X from the CP\n" , +le32_to_cpu (v2e->event)); +} + +/** +* ixd_vc_can_handle_msg - Decide if an event has to be handled by virtchnl code +* @ctlq_msg: Message received +* +* Return: %true if virtchnl code can handle the event, %false otherwise +*/ +bool ixd_vc_can_handle_msg (struct libie_ctlq_msg *ctlq_msg) +{ +return ctlq_msg->chnl_opcode ==VIRTCHNL2_OP_EVENT ; +} + +/** +* ixd_handle_caps - Handle VIRTCHNL2_OP_GET_CAPS response +* @adapter: The adapter for which the capabilities are being updated +* @recv_buff: Buffer containing the response +* @recv_size: Response buffer size +* @ctx: unused +* +* Return: %0 if the response format is correct and was handled as expected, +* negative error otherwise. +*/ +static int ixd_handle_caps (struct ixd_adapter *adapter,void *recv_buff, +size_t recv_size,void *ctx) +{ +if (recv_size <sizeof (adapter->caps)) +return -EBADMSG ; + + adapter->caps = *(typeof(adapter->caps) *)recv_buff; + +return 0 ; +} + +/** +* ixd_req_vc_caps - Request and save device capability +* @adapter: The adapter to get the capabilities for +* +* Return: success or error if sending the get capability message fails +*/ +static int ixd_req_vc_caps (struct ixd_adapter *adapter) +{ +const struct ixd_ctlq_req req = { + .opcode =VIRTCHNL2_OP_GET_CAPS , + .send_size =sizeof (struct virtchnl2_get_capabilities ), + .ctx =NULL , + .send_buff_init =NULL , + .recv_process = ixd_handle_caps, + }; + +return ixd_ctlq_do_req (adapter, &req); +} + +/** +* ixd_get_vc_ver - Get version info from adapter +* +* Return: filled in virtchannel2 version info, ready for sending +*/ +static struct virtchnl2_version_info ixd_get_vc_ver (void ) +{ +return (struct virtchnl2_version_info ) { + .major =cpu_to_le32 (VIRTCHNL2_VERSION_MAJOR_2 ), + .minor =cpu_to_le32 (VIRTCHNL2_VERSION_MINOR_0 ), + }; +} + +static void ixd_fill_vc_ver (struct ixd_adapter *adapter,void *send_buff, +void *ctx) +{ + *(struct virtchnl2_version_info *)send_buff =ixd_get_vc_ver (); +} + +/** +* ixd_handle_vc_ver - Handle VIRTCHNL2_OP_VERSION response +* @adapter: The adapter for which the version is being updated +* @recv_buff: Buffer containing the response +* @recv_size: Response buffer size +* @ctx: Unused +* +* Return: %0 if the response format is correct and was handled as expected, +* negative error otherwise. +*/ +static int ixd_handle_vc_ver (struct ixd_adapter *adapter,void *recv_buff, +size_t recv_size,void *ctx) +{ +struct virtchnl2_version_info need_ver =ixd_get_vc_ver (); +struct virtchnl2_version_info *recv_ver; + +if (recv_size <sizeof (need_ver)) +return -EBADMSG ; + + recv_ver = recv_buff; +if (le32_to_cpu (need_ver.major) >le32_to_cpu (recv_ver->major)) +return -EOPNOTSUPP ; + + adapter->vc_ver.major =le32_to_cpu (recv_ver->major); + adapter->vc_ver.minor =le32_to_cpu (recv_ver->minor); + +return 0 ; +} + +/** +* ixd_req_vc_version - Request and save Virtchannel2 version +* @adapter: The adapter to get the version for +* +* Return: success or error if sending fails or the response was not as expected +*/ +static int ixd_req_vc_version (struct ixd_adapter *adapter) +{ +const struct ixd_ctlq_req req = { + .opcode =VIRTCHNL2_OP_VERSION , + .send_size =sizeof (struct virtchnl2_version_info ), + .ctx =NULL , + .send_buff_init = ixd_fill_vc_ver, + .recv_process = ixd_handle_vc_ver, + }; + +return ixd_ctlq_do_req (adapter, &req); +} + +/** +* ixd_vc_dev_init - virtchnl device core initialization +* @adapter: device information +* +* Return: %0 on success or error if any step of the initialization fails +*/ +int ixd_vc_dev_init (struct ixd_adapter *adapter) +{ +int err; + + err =ixd_req_vc_version (adapter); +if (err) { +dev_warn (ixd_to_dev (adapter), +"Getting virtchnl version failed, error=%pe\n" , +ERR_PTR (err)); +return err; + } + + err =ixd_req_vc_caps (adapter); +if (err) { +dev_warn (ixd_to_dev (adapter), +"Getting virtchnl capabilities failed, error=%pe\n" , +ERR_PTR (err)); +return err; + } + +return err; +}drivers/net/ethernet/intel/ixd/ixd_virtchnl.h new file +12
-0@@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* Copyright (C) 2025 Intel Corporation */ + +#ifndef _IXD_VIRTCHNL_H_ +#define _IXD_VIRTCHNL_H_ + +int ixd_vc_dev_init (struct ixd_adapter *adapter); +bool ixd_vc_can_handle_msg (struct libie_ctlq_msg *ctlq_msg); +void ixd_vc_recv_event_msg (struct ixd_adapter *adapter, +struct libie_ctlq_msg *ctlq_msg); + +#endif /* _IXD_VIRTCHNL_H_ */ Signature · 1 line
2.47.1
Tony Nguyen
maintainerPATCH v3 14/14 ixd: add devlink support
In reply to Tony NguyenFrom: Amritha Nambiar <[email protected]>
Enable initial support for the devlink interface with the ixd driver. The ixd hardware is a single function PCIe device. So, the PCIe adapter gets its own devlink instance to manage device-wide resources or configuration.
$ devlink dev show pci/0000:83:00.6
$ devlink dev info pci/0000:83:00.6
pci/0000:83:00.6:
driver ixd
serial_number 00-a0-c9-ff-ff-23-45-67
versions:
fixed:
device.type MEV
running:
virtchnl 2.0--- Documentation/networking/devlink/index.rst | 1 + Documentation/networking/devlink/ixd.rst | 30 ++++++ drivers/net/ethernet/intel/ixd/Kconfig | 1 + drivers/net/ethernet/intel/ixd/Makefile | 1 + drivers/net/ethernet/intel/ixd/ixd_devlink.c | 97 ++++++++++++++++++++ drivers/net/ethernet/intel/ixd/ixd_devlink.h | 44 +++++++++ drivers/net/ethernet/intel/ixd/ixd_main.c | 16 +++- 7 files changed, 187 insertions(+), 3 deletions(-) create mode 100644 Documentation/networking/devlink/ixd.rst create mode 100644 drivers/net/ethernet/intel/ixd/ixd_devlink.c create mode 100644 drivers/net/ethernet/intel/ixd/ixd_devlink.h
Documentation/networking/devlink/index.rst +1 -0
@@ -88,6 +88,7 @@ parameters, info versions, and other features it supports. ionic iosm ixgbe + ixd kvaser_pciefd kvaser_usb mlx4
Documentation/networking/devlink/ixd.rst new file +30 -0
@@ -0,0 +1,30 @@ +.. SPDX-License-Identifier: GPL-2.0 + +=================== +ixd devlink support +=================== + +This document describes the devlink features implemented by the ``ixd`` +device driver. + +Info versions +============= + +The ``ixd`` driver reports the following versions + +.. list-table:: devlink info versions implemented + :widths: 5 5 5 90 + + * - Name + - Type + - Example + - Description + * - ``device.type`` + - fixed + - MEV + - The hardware type for this device + * - ``virtchnl`` + - running + - 2.0 + - 2-digit version number (major.minor) of the communication channel + (virtchnl) used by the device.
drivers/net/ethernet/intel/ixd/Kconfig +1 -0
@@ -7,6 +7,7 @@ config IXD select LIBETH select LIBIE_CP select LIBIE_PCI + select NET_DEVLINK help This driver supports Intel(R) Control Plane PCI Function of Intel E2100 and later IPUs and FNICs.
drivers/net/ethernet/intel/ixd/Makefile +1 -0
@@ -8,5 +8,6 @@ obj-$(CONFIG_IXD) += ixd.o ixd-y := ixd_main.o ixd-y += ixd_ctlq.o ixd-y += ixd_dev.o +ixd-y += ixd_devlink.o ixd-y += ixd_lib.o ixd-y += ixd_virtchnl.o
drivers/net/ethernet/intel/ixd/ixd_devlink.c new file +97 -0
97 lines not on this page · raw message
drivers/net/ethernet/intel/ixd/ixd_devlink.h new file +44 -0
44 lines not on this page · raw message
drivers/net/ethernet/intel/ixd/ixd_main.c +13 -3
@@ -4,6 +4,7 @@#include "ixd.h" #include "ixd_ctlq.h" #include "ixd_lan_regs.h" +#include "ixd_devlink.h" MODULE_DESCRIPTION ("Intel(R) Control Plane Function Device Driver" );MODULE_IMPORT_NS ("LIBIE_CP" );
@@ -21,11 +22,14 @@ static void ixd_remove(struct pci_dev *pdev)/* Do not mix removal with (re)initialization */ cancel_delayed_work_sync (&adapter->init_task.init_work); +ixd_devlink_unregister (adapter); +/* Leave the device clean on exit */ ixd_trigger_reset (adapter);ixd_deinit_dflt_mbx (adapter);libie_pci_unmap_all_mmio_regions (&adapter->cp_ctx.mmio_info); +ixd_devlink_free (adapter); }/**
@@ -93,7 +97,7 @@ static int ixd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)if (WARN_ON (ent->device !=IXD_DEV_ID_CPF ))return -EINVAL ; - adapter =devm_kzalloc (&pdev->dev,sizeof (*adapter),GFP_KERNEL ); + adapter =ixd_adapter_alloc (&pdev->dev);if (!adapter)return -ENOMEM ;
@@ -102,13 +106,13 @@ static int ixd_probe(struct pci_dev *pdev, const struct pci_device_id *ent) err =libie_pci_init_dev (pdev);if (err) -return err; + goto free_adapter;pci_set_drvdata (pdev, adapter); err =ixd_iomap_regions (adapter);if (err) -return err; + goto free_adapter;INIT_DELAYED_WORK (&adapter->init_task.init_work, ixd_init_task);
@@ -118,7 +122,13 @@ static int ixd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)queue_delayed_work (system_unbound_wq, &adapter->init_task.init_work,msecs_to_jiffies (500 )); +ixd_devlink_register (adapter); +return 0 ; + +free_adapter: +ixd_devlink_free (adapter); +return err; }static const struct pci_device_id ixd_pci_tbl[] = {
Signature · 1 line
2.47.1
Re: [PATCH net-next v3 14/14] ixd: add devlink support
Quoted 5 lines · Tony Nguyen
From: Amritha Nambiar <[email protected]>
Enable initial support for the devlink interface with the ixd driver. The ixd hardware is a single function PCIe device. So, the PCIe adapter gets its own devlink instance to manage device-wide resources or configuration.
I have accidentally posted the answer to the previous patch, here is a duplicate:
Sashiko's concern about devlink being registered too early is actually valid. Would say this is not a serious issue at this stage in the development, but here is a diff addressing this:
drivers/net/ethernet/intel/ixd/ixd_lib.c +2 -0
@@ -2,6 +2,7 @@/* Copyright (C) 2025 Intel Corporation */ #include "ixd.h" +#include "ixd_devlink.h" #include "ixd_virtchnl.h" #define IXD_DFLT_MBX_Q_LEN 64
@@ -150,6 +151,7 @@ void ixd_init_task(struct work_struct *work)if (!ixd_vc_dev_init (adapter)) { adapter->init_task.vc_retries =0 ; +ixd_devlink_register (adapter);return ; }
drivers/net/ethernet/intel/ixd/ixd_main.c +0 -2
@@ -125,8 +125,6 @@ static int ixd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)queue_delayed_work (system_unbound_wq, &adapter->init_task.init_work,msecs_to_jiffies (500 )); -ixd_devlink_register (adapter); -return 0 ; free_adapter:
Quoted 327 lines
$ devlink dev show pci/0000:83:00.6$ devlink dev info pci/0000:83:00.6 pci/0000:83:00.6: driver ixd serial_number 00-a0-c9-ff-ff-23-45-67 versions: fixed: device.type MEV running: virtchnl 2.0Signed-off-by Amritha Nambiar <[email protected]>Reviewed-by Michal Swiatkowski <[email protected]>Reviewed-by Maciej Fijalkowski <[email protected]>Reviewed-by Przemek Kitszel <[email protected]>Signed-off-by Larysa Zaremba <[email protected]>Tested-by Bharath R <[email protected]>Signed-off-by Tony Nguyen <[email protected]>--- Documentation/networking/devlink/index.rst | 1 + Documentation/networking/devlink/ixd.rst | 30 ++++++ drivers/net/ethernet/intel/ixd/Kconfig | 1 + drivers/net/ethernet/intel/ixd/Makefile | 1 + drivers/net/ethernet/intel/ixd/ixd_devlink.c | 97 ++++++++++++++++++++ drivers/net/ethernet/intel/ixd/ixd_devlink.h | 44 +++++++++ drivers/net/ethernet/intel/ixd/ixd_main.c | 16 +++- 7 files changed, 187 insertions(+), 3 deletions(-) create mode 100644 Documentation/networking/devlink/ixd.rst create mode 100644 drivers/net/ethernet/intel/ixd/ixd_devlink.c create mode 100644 drivers/net/ethernet/intel/ixd/ixd_devlink.hDocumentation/networking/devlink/index.rst +1
-0@@ -88,6 +88,7 @@ parameters, info versions, and other features it supports. ionic iosm ixgbe + ixd kvaser_pciefd kvaser_usb mlx4Documentation/networking/devlink/ixd.rst new file +30
-0@@ -0,0 +1,30 @@ +.. SPDX-License-Identifier: GPL-2.0 + +=================== +ixd devlink support +=================== + +This document describes the devlink features implemented by the ``ixd`` +device driver. + +Info versions +============= + +The ``ixd`` driver reports the following versions + +.. list-table:: devlink info versions implemented + :widths: 5 5 5 90 + + * - Name + - Type + - Example + - Description + * - ``device.type`` + - fixed + - MEV + - The hardware type for this device + * - ``virtchnl`` + - running + - 2.0 + - 2-digit version number (major.minor) of the communication channel + (virtchnl) used by the device.drivers/net/ethernet/intel/ixd/Kconfig +1
-0@@ -7,6 +7,7 @@ config IXD select LIBETH select LIBIE_CP select LIBIE_PCI + select NET_DEVLINK help This driver supports Intel(R) Control Plane PCI Function of Intel E2100 and later IPUs and FNICs.drivers/net/ethernet/intel/ixd/Makefile +1
-0@@ -8,5 +8,6 @@ obj-$(CONFIG_IXD) += ixd.o ixd-y := ixd_main.o ixd-y += ixd_ctlq.o ixd-y += ixd_dev.o +ixd-y += ixd_devlink.o ixd-y += ixd_lib.o ixd-y += ixd_virtchnl.odrivers/net/ethernet/intel/ixd/ixd_devlink.c new file +97
-0@@ -0,0 +1,97 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright (c) 2025, Intel Corporation. */ + +#include "ixd.h" +#include "ixd_devlink.h" + +#define IXD_DEVLINK_INFO_LEN 128 + +/** +* ixd_fill_dsn - Get the serial number for the ixd device +* @adapter: adapter to query +* @buf: storage buffer for the info request +*/ +static void ixd_fill_dsn (struct ixd_adapter *adapter,char *buf) +{ +u8 dsn[8 ]; + +/* Copy the DSN into an array in Big Endian format */ +put_unaligned_be64 (pci_get_dsn (adapter->cp_ctx.mmio_info.pdev), dsn); + +snprintf (buf,IXD_DEVLINK_INFO_LEN ,"%8phD" , dsn); +} + +/** +* ixd_fill_device_name - Get the name of the underlying hardware +* @adapter: adapter to query +* @buf: storage buffer for the info request +* @buf_size: size of the storage buffer +*/ +static void ixd_fill_device_name (struct ixd_adapter *adapter,char *buf, +size_t buf_size) +{ +if (adapter->caps.device_type ==cpu_to_le32 (VIRTCHNL2_MEV_DEVICE )) +snprintf (buf, buf_size,"%s" ,"MEV" ); +else +snprintf (buf, buf_size,"%s" ,"UNKNOWN" ); +} + +/** +* ixd_devlink_info_get - .info_get devlink handler +* @devlink: devlink instance structure +* @req: the devlink info request +* @extack: extended netdev ack structure +* +* Callback for the devlink .info_get operation. Reports information about the +* device. +* +* Return: zero on success or an error code on failure. +*/ +static int ixd_devlink_info_get (struct devlink *devlink, +struct devlink_info_req *req, +struct netlink_ext_ack *extack) +{ +struct ixd_adapter *adapter =devlink_priv (devlink); +char buf[IXD_DEVLINK_INFO_LEN ]; +int err; + +ixd_fill_dsn (adapter, buf); + err =devlink_info_serial_number_put (req, buf); +if (err) +return err; + +ixd_fill_device_name (adapter, buf,IXD_DEVLINK_INFO_LEN ); + err =devlink_info_version_fixed_put (req,"device.type" , buf); +if (err) +return err; + +snprintf (buf,sizeof (buf),"%u.%u" , + adapter->vc_ver.major, adapter->vc_ver.minor); + +return devlink_info_version_running_put (req,"virtchnl" , buf); +} + +static const struct devlink_ops ixd_devlink_ops = { + .info_get = ixd_devlink_info_get, +}; + +/** +* ixd_adapter_alloc - Allocate devlink and return adapter pointer +* @dev: the device to allocate for +* +* Allocate a devlink instance for this device and return the private area as +* the adapter structure. +* +* Return: adapter structure on success, NULL on failure +*/ +struct ixd_adapter *ixd_adapter_alloc (struct device *dev) +{ +struct devlink *devlink; + + devlink =devlink_alloc (&ixd_devlink_ops,sizeof (struct ixd_adapter ), + dev); +if (!devlink) +return NULL ; + +return devlink_priv (devlink); +}drivers/net/ethernet/intel/ixd/ixd_devlink.h new file +44
-0@@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Copyright (c) 2025, Intel Corporation. */ + +#ifndef _IXD_DEVLINK_H_ +#define _IXD_DEVLINK_H_ +#include <net/devlink.h> + +struct ixd_adapter *ixd_adapter_alloc (struct device *dev); + +/** +* ixd_devlink_free - teardown the devlink +* @adapter: the adapter structure to free +* +*/ +static inline void ixd_devlink_free (struct ixd_adapter *adapter) +{ +struct devlink *devlink =priv_to_devlink (adapter); + +devlink_free (devlink); +} + +/** +* ixd_devlink_unregister - Unregister devlink resources for this adapter. +* @adapter: the adapter structure to cleanup +* +* Releases resources used by devlink and cleans up associated memory. +*/ +static inline void ixd_devlink_unregister (struct ixd_adapter *adapter) +{ +devlink_unregister (priv_to_devlink (adapter)); +} + +/** +* ixd_devlink_register - Register devlink interface for this adapter +* @adapter: pointer to ixd adapter structure to be associated with devlink +* +* Register the devlink instance associated with this adapter +*/ +static inline void ixd_devlink_register (struct ixd_adapter *adapter) +{ +devlink_register (priv_to_devlink (adapter)); +} + +#endif /* _IXD_DEVLINK_H_ */ drivers/net/ethernet/intel/ixd/ixd_main.c +13
-3@@ -4,6 +4,7 @@#include "ixd.h" #include "ixd_ctlq.h" #include "ixd_lan_regs.h" +#include "ixd_devlink.h" MODULE_DESCRIPTION ("Intel(R) Control Plane Function Device Driver" );MODULE_IMPORT_NS ("LIBIE_CP" );@@ -21,11 +22,14 @@ static void ixd_remove(struct pci_dev *pdev)/* Do not mix removal with (re)initialization */ cancel_delayed_work_sync (&adapter->init_task.init_work); +ixd_devlink_unregister (adapter); +/* Leave the device clean on exit */ ixd_trigger_reset (adapter);ixd_deinit_dflt_mbx (adapter);libie_pci_unmap_all_mmio_regions (&adapter->cp_ctx.mmio_info); +ixd_devlink_free (adapter); }/** @@ -93,7 +97,7 @@ static int ixd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)if (WARN_ON (ent->device !=IXD_DEV_ID_CPF ))return -EINVAL ; - adapter =devm_kzalloc (&pdev->dev,sizeof (*adapter),GFP_KERNEL ); + adapter =ixd_adapter_alloc (&pdev->dev);if (!adapter)return -ENOMEM ;@@ -102,13 +106,13 @@ static int ixd_probe(struct pci_dev *pdev, const struct pci_device_id *ent) err =libie_pci_init_dev (pdev);if (err) -return err; + goto free_adapter;pci_set_drvdata (pdev, adapter); err =ixd_iomap_regions (adapter);if (err) -return err; + goto free_adapter;INIT_DELAYED_WORK (&adapter->init_task.init_work, ixd_init_task);@@ -118,7 +122,13 @@ static int ixd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)queue_delayed_work (system_unbound_wq, &adapter->init_task.init_work,msecs_to_jiffies (500 )); +ixd_devlink_register (adapter); +return 0 ; + +free_adapter: +ixd_devlink_free (adapter); +return err; }static const struct pci_device_id ixd_pci_tbl[] = {Signature · 1 line
2.47.1
Quoted 1 line · Tony Nguyen
Larysa Zaremba says:
I have reviewed Sashiko's feedback and there are some valid points remaining after several rounds of AI review (both Sashiko and "local" [0]). They are a minority of comments and all pretty much fall into the following categories:
* existing minor idpf problems with range checking
* problems fixed in the same series
* some more serious problems in the ixd code, but IMO acceptable for introductory boilerplate series.
[0] https://netdev-ai.bots.linux.dev/ai-local.html
Quoted 242 lines
This patch series adds the iXD driver, which supports the Intel(R) Control Plane PCI Function on Intel E2100 and later IPUs and FNICs. It facilitates a centralized control over multiple IDPF PFs/VFs/SFs exposed by the same card. The reason for the separation is to be able to offload the control plane to the host different from where the data plane is running.
This is the first phase in the release of this driver where we implement the initialization of the core PCI driver. Subsequent phases will implement advanced features like usage of idpf ethernet aux device, link management, NVM update via devlink, switchdev port representors, data and exception path, flow rule programming, etc.
The first phase entails the following aspects:
1. Additional libie functionalities:
Patches 1-5 introduce additional common library API for drivers to communicate with the control plane through mailbox communication. A control queue is a hardware interface which is used by the driver to interact with other subsystems (like firmware). The library APIs allow the driver to setup and configure the control queues to send and receive virtchnl messages. The library has an internal bookkeeping (XN API) mechanism to keep track of the send messages. It supports both synchronous as well as asynchronous way of handling the messages. The library also handles the timeout internally for synchronous messages using events. This reduces the driver's overhead in handling the timeout error cases.The current patch series supports only APIs that are needed for device initialization. These include APIs in the
libie_pcimodule:
* Allocating/freeing the DMA memory and mapping the MMIO regions for BAR0, read/write APIs for drivers to access the MMIO memoryand
libie_cpmodule:
* Control queue initialization and configuration
* Transport initialization for bookkeeping
* Blocking and asynchronous mailbox transactionsOnce the mailbox is initialized, the drivers can send and receive virtchnl messages to/from the control plane.
The modules above are not supposed to be linked witn the main libie library, but do share the folder with it.
2. idpf:
Patches 6-9 refactor the idpf driver to use the libie APIs for control queue configuration, virtchnl transaction, device initialization and reset and adjust related code accordingly.3. ixd:
Patches 11-14 add the ixd driver and implement multiple pieces of the initialization flow as follows:
* Add the ability to load
* A reset is issued to ensure a clean device state, followed by initialization of the mailbox
* Device capabilities:
As part of initialization, the driver has to determine what the device is capable of (ex. max queues, vports, etc). This information is obtained from the firmware and stored by the driver.
* Enable initial support for the devlink interface
---
v3:
- lock libie ctlq transaction earlier on Rx path
- improve ctlq Rx buffer size validation both in idpf and libie
- fix RSS LUT buf size (will also go to stable separately)
- improve xnm shutdown handling
- skip zero-sized BAR regions instread of returning error in idpf
- unify treatment of initialized and uninitialized ctlq messagesv2: https://lore.kernel.org/netdev/[email protected]/
- improved failure handling and input validation
- removed cp version from devlink in ixdv1: https://lore.kernel.org/netdev/[email protected]/
The following are changes since commit
822d4a8e390a08ccfaf2abb347ae670b230b196f:
net: usb: usbnet: use proper ep number macros
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue200GbEAmritha Nambiar (1):
ixd: add devlink supportLarysa Zaremba (5):
idpf: makembx_taskqueueing and cancelling more consistent
idpf: print a debug message and bail in case of non-event ctlq message
ixd: add basic driver framework for Intel(R) Control Plane Function
ixd: add reset checks and initialize the mailbox
ixd: add the core initializationPavan Kumar Linga (4):
libeth: allow to create fill queues without NAPI
idpf: remove 'vport_params_reqd' field
idpf: refactor idpf to uselibie_pciAPIs
idpf: refactor idpf to use libie control queuesPhani R Burra (3):
libie: add PCI device initialization helpers to libie
libie: add control queue support
libie: add bookkeeping support for control queue messagesVictor Raj (1):
virtchnl: create 'include/linux/intel' and move necessary header files.../device_drivers/ethernet/index.rst | 1 + .../device_drivers/ethernet/intel/ixd.rst | 39 + Documentation/networking/devlink/index.rst | 1 + Documentation/networking/devlink/ixd.rst | 30 + MAINTAINERS | 6 +- drivers/infiniband/hw/irdma/i40iw_if.c | 2 +- drivers/infiniband/hw/irdma/icrdma_if.c | 2 +- drivers/infiniband/hw/irdma/ig3rdma_if.c | 2 +- drivers/infiniband/hw/irdma/main.c | 2 +- drivers/infiniband/hw/irdma/main.h | 2 +- drivers/net/ethernet/intel/Kconfig | 2 + drivers/net/ethernet/intel/Makefile | 1 + drivers/net/ethernet/intel/i40e/i40e.h | 4 +- .../net/ethernet/intel/i40e/i40e_adminq_cmd.h | 2 +- drivers/net/ethernet/intel/i40e/i40e_client.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_common.c | 2 +- .../net/ethernet/intel/i40e/i40e_ethtool.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- .../net/ethernet/intel/i40e/i40e_prototype.h | 2 +- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 4 +- drivers/net/ethernet/intel/i40e/i40e_txrx.h | 2 +- .../ethernet/intel/i40e/i40e_virtchnl_pf.h | 2 +- drivers/net/ethernet/intel/iavf/iavf.h | 2 +- .../net/ethernet/intel/iavf/iavf_adminq_cmd.h | 2 +- drivers/net/ethernet/intel/iavf/iavf_common.c | 2 +- drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +- .../net/ethernet/intel/iavf/iavf_prototype.h | 2 +- drivers/net/ethernet/intel/iavf/iavf_txrx.c | 2 +- drivers/net/ethernet/intel/iavf/iavf_txrx.h | 2 +- drivers/net/ethernet/intel/iavf/iavf_types.h | 4 +- .../net/ethernet/intel/iavf/iavf_virtchnl.c | 2 +- drivers/net/ethernet/intel/ice/ice.h | 2 +- .../net/ethernet/intel/ice/ice_adminq_cmd.h | 2 +- drivers/net/ethernet/intel/ice/ice_base.c | 2 +- drivers/net/ethernet/intel/ice/ice_common.h | 2 +- drivers/net/ethernet/intel/ice/ice_flow.h | 2 +- drivers/net/ethernet/intel/ice/ice_idc_int.h | 4 +- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- drivers/net/ethernet/intel/ice/ice_txrx_lib.c | 2 +- drivers/net/ethernet/intel/ice/ice_type.h | 2 +- drivers/net/ethernet/intel/ice/ice_vf_lib.h | 2 +- .../net/ethernet/intel/ice/virt/virtchnl.h | 2 +- drivers/net/ethernet/intel/idpf/Kconfig | 1 + drivers/net/ethernet/intel/idpf/Makefile | 2 - drivers/net/ethernet/intel/idpf/idpf.h | 103 +- .../net/ethernet/intel/idpf/idpf_controlq.c | 621 ------ .../net/ethernet/intel/idpf/idpf_controlq.h | 144 -- .../ethernet/intel/idpf/idpf_controlq_api.h | 177 -- .../ethernet/intel/idpf/idpf_controlq_setup.c | 169 -- drivers/net/ethernet/intel/idpf/idpf_dev.c | 101 +- .../net/ethernet/intel/idpf/idpf_ethtool.c | 28 +- drivers/net/ethernet/intel/idpf/idpf_idc.c | 38 +- drivers/net/ethernet/intel/idpf/idpf_lib.c | 69 +- drivers/net/ethernet/intel/idpf/idpf_main.c | 117 +- drivers/net/ethernet/intel/idpf/idpf_mem.h | 20 - drivers/net/ethernet/intel/idpf/idpf_txrx.h | 4 +- drivers/net/ethernet/intel/idpf/idpf_vf_dev.c | 99 +- .../net/ethernet/intel/idpf/idpf_virtchnl.c | 1844 +++++++---------- .../net/ethernet/intel/idpf/idpf_virtchnl.h | 96 +- .../ethernet/intel/idpf/idpf_virtchnl_ptp.c | 306 ++- drivers/net/ethernet/intel/ixd/Kconfig | 15 + drivers/net/ethernet/intel/ixd/Makefile | 13 + drivers/net/ethernet/intel/ixd/ixd.h | 58 + drivers/net/ethernet/intel/ixd/ixd_ctlq.c | 149 ++ drivers/net/ethernet/intel/ixd/ixd_ctlq.h | 33 + drivers/net/ethernet/intel/ixd/ixd_dev.c | 89 + drivers/net/ethernet/intel/ixd/ixd_devlink.c | 97 + drivers/net/ethernet/intel/ixd/ixd_devlink.h | 44 + drivers/net/ethernet/intel/ixd/ixd_lan_regs.h | 68 + drivers/net/ethernet/intel/ixd/ixd_lib.c | 166 ++ drivers/net/ethernet/intel/ixd/ixd_main.c | 147 ++ drivers/net/ethernet/intel/ixd/ixd_virtchnl.c | 178 ++ drivers/net/ethernet/intel/ixd/ixd_virtchnl.h | 12 + drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | 2 +- .../ethernet/intel/ixgbe/ixgbe_type_e610.h | 2 +- drivers/net/ethernet/intel/libeth/rx.c | 12 +- drivers/net/ethernet/intel/libie/Kconfig | 14 + drivers/net/ethernet/intel/libie/Makefile | 8 + drivers/net/ethernet/intel/libie/adminq.c | 2 +- drivers/net/ethernet/intel/libie/controlq.c | 1213 +++++++++++ drivers/net/ethernet/intel/libie/fwlog.c | 2 +- drivers/net/ethernet/intel/libie/pci.c | 208 ++ drivers/net/ethernet/intel/libie/rx.c | 2 +- include/linux/{net => }/intel/i40e_client.h | 0 include/linux/{net => }/intel/iidc_rdma.h | 0 include/linux/{net => }/intel/iidc_rdma_ice.h | 0 .../linux/{net => }/intel/iidc_rdma_idpf.h | 0 include/linux/{net => }/intel/libie/adminq.h | 0 include/linux/intel/libie/controlq.h | 426 ++++ include/linux/{net => }/intel/libie/fwlog.h | 2 +- include/linux/intel/libie/pci.h | 56 + include/linux/{net => }/intel/libie/pctype.h | 0 include/linux/{net => }/intel/libie/rx.h | 0 include/linux/{avf => intel}/virtchnl.h | 0 .../idpf => include/linux/intel}/virtchnl2.h | 0 .../linux/intel}/virtchnl2_lan_desc.h | 0 include/net/libeth/rx.h | 4 +- 97 files changed, 4236 insertions(+), 2883 deletions(-) create mode 100644 Documentation/networking/device_drivers/ethernet/intel/ixd.rst create mode 100644 Documentation/networking/devlink/ixd.rst delete mode 100644 drivers/net/ethernet/intel/idpf/idpf_controlq.c delete mode 100644 drivers/net/ethernet/intel/idpf/idpf_controlq.h delete mode 100644 drivers/net/ethernet/intel/idpf/idpf_controlq_api.h delete mode 100644 drivers/net/ethernet/intel/idpf/idpf_controlq_setup.c delete mode 100644 drivers/net/ethernet/intel/idpf/idpf_mem.h create mode 100644 drivers/net/ethernet/intel/ixd/Kconfig create mode 100644 drivers/net/ethernet/intel/ixd/Makefile create mode 100644 drivers/net/ethernet/intel/ixd/ixd.h create mode 100644 drivers/net/ethernet/intel/ixd/ixd_ctlq.c create mode 100644 drivers/net/ethernet/intel/ixd/ixd_ctlq.h create mode 100644 drivers/net/ethernet/intel/ixd/ixd_dev.c create mode 100644 drivers/net/ethernet/intel/ixd/ixd_devlink.c create mode 100644 drivers/net/ethernet/intel/ixd/ixd_devlink.h create mode 100644 drivers/net/ethernet/intel/ixd/ixd_lan_regs.h create mode 100644 drivers/net/ethernet/intel/ixd/ixd_lib.c create mode 100644 drivers/net/ethernet/intel/ixd/ixd_main.c create mode 100644 drivers/net/ethernet/intel/ixd/ixd_virtchnl.c create mode 100644 drivers/net/ethernet/intel/ixd/ixd_virtchnl.h create mode 100644 drivers/net/ethernet/intel/libie/controlq.c create mode 100644 drivers/net/ethernet/intel/libie/pci.c rename include/linux/{net => }/intel/i40e_client.h (100%) rename include/linux/{net => }/intel/iidc_rdma.h (100%) rename include/linux/{net => }/intel/iidc_rdma_ice.h (100%) rename include/linux/{net => }/intel/iidc_rdma_idpf.h (100%) rename include/linux/{net => }/intel/libie/adminq.h (100%) create mode 100644 include/linux/intel/libie/controlq.h rename include/linux/{net => }/intel/libie/fwlog.h (98%) create mode 100644 include/linux/intel/libie/pci.h rename include/linux/{net => }/intel/libie/pctype.h (100%) rename include/linux/{net => }/intel/libie/rx.h (100%) rename include/linux/{avf => intel}/virtchnl.h (100%) rename {drivers/net/ethernet/intel/idpf => include/linux/intel}/virtchnl2.h (100%) rename {drivers/net/ethernet/intel/idpf => include/linux/intel}/virtchnl2_lan_desc.h (100%)Signature · 1 line
2.47.1