Re: [PATCH v1 net-next 15/15] net/nebula-matrix: add kernel/user coexist mode support
From: Andrew Lunn
Date: Wed Dec 24 2025 - 05:52:35 EST
On Tue, Dec 23, 2025 at 11:50:38AM +0800, illusion.wang wrote:
> 1. Coexistence Function Implementation
> Create a virtual dev and wrap it with a VFIO group and VFIO mediated device (mdev) framework,
> or use the traditional cdev approach.
> 2. Mode Switching During DPDK Startup/Shutdown in Coexistence Scenarios
> The function nbl_userdev_switch_network handles mode transitions when starting/stopping DPDK
> in coexistence environments.
> 3. User-Space Driver Scenarios: Coexistence vs. Non-Coexistence (UIO/VFIO)
> Leonis PF0 is designated as the management Physical Function (PF).
> If PF1 operates in kernel mode and DPDK is launched:
> Coexistence mode:
> Commands are issued via ioctl to the PF1 driver's kernel layer (nbl_userdev_channel_ioctl).
> DPDK blocks on the ioctl call in kernel space.
> PF1 intercepts and modifies the request, then forwards it via mailbox to PF0 for processing.
> DPDK remains blocked, waiting for an ACK response from the mailbox.
> Non-Coexistence mode:
> Direct mailbox communication is used between PF1 and PF0 without kernel intervention.
> 4. Event Notification Mechanism
> For PF0 to proactively send mailbox messages (e.g., link status updates) to other VFs/PFs:
> A software ring buffer and eventfd are implemented for shared memory between kernel and user space.
> The kernel copies subscribed messages into the ring buffer and triggers an eventfd wake-up to notify
> DPDK's interrupt thread.
I would suggest dropping this patch from the initial series. You are
going to need to split up some of the other patches, and you already
have 15 patches.
Andrew