Re: [PATCH] virtio-vdpa: Fix unchecked call to NULL set_vq_affinity

2023-05-12 Thread Shannon Nelson via Virtualization
On 5/12/23 6:30 AM, Michael S. Tsirkin wrote: On Fri, May 12, 2023 at 12:51:21PM +, Dragos Tatulea wrote: On Thu, 2023-05-04 at 14:51 -0400, Michael S. Tsirkin wrote: On Thu, May 04, 2023 at 01:08:54PM -0400, Feng Liu wrote: On 2023-05-04 a.m.9:50, Dragos Tatulea wrote: External email:

Re: [PATCH v5 virtio 10/11] pds_vdpa: subscribe to the pds_core events

2023-05-15 Thread Shannon Nelson via Virtualization
On 5/14/23 10:02 PM, Jason Wang wrote: On Thu, May 4, 2023 at 2:13 AM Shannon Nelson wrote: Register for the pds_core's notification events, primarily to find out when the FW has been reset so we can pass this on back up the chain. Signed-off-by: Shannon Nelson --- drivers/vdpa/pds/vdpa_de

Re: [PATCH v5 virtio 11/11] pds_vdpa: pds_vdps.rst and Kconfig

2023-05-15 Thread Shannon Nelson via Virtualization
On 5/14/23 10:07 PM, Jason Wang wrote: On Thu, May 4, 2023 at 2:13 AM Shannon Nelson wrote: Add the documentation and Kconfig entry for pds_vdpa driver. Signed-off-by: Shannon Nelson --- .../device_drivers/ethernet/amd/pds_vdpa.rst | 85 +++ .../device_drivers/ethernet/in

Re: [PATCH v2 2/3] vhost: support PACKED when setting-getting vring_base

2023-05-15 Thread Shannon Nelson via Virtualization
On 5/9/23 1:46 AM, Stefano Garzarella wrote: On Mon, Apr 24, 2023 at 03:50:30PM -0700, Shannon Nelson via Virtualization wrote: Use the right structs for PACKED or split vqs when setting and getting the vring base. Signed-off-by: Shannon Nelson --- drivers/vhost/vhost.c | 18

[PATCH v6 virtio 01/11] virtio: allow caller to override device id in vp_modern

2023-05-15 Thread Shannon Nelson via Virtualization
To add a bit of vendor flexibility with various virtio based devices, allow the caller to check for a different device id. This adds a function pointer field to struct virtio_pci_modern_device to specify an override device id check. If defined by the driver, this function will be called to check

[PATCH v6 virtio 02/11] virtio: allow caller to override device DMA mask in vp_modern

2023-05-15 Thread Shannon Nelson via Virtualization
To add a bit of vendor flexibility with various virtio based devices, allow the caller to specify a different DMA mask. This adds a dma_mask field to struct virtio_pci_modern_device. If defined by the driver, this mask will be used in a call to dma_set_mask_and_coherent() instead of the tradition

[PATCH v6 virtio 00/11] pds_vdpa driver

2023-05-15 Thread Shannon Nelson via Virtualization
This patchset implements a new module for the AMD/Pensando DSC that supports vDPA services on PDS Core VF devices. This code is based on and depends on include files from the pds_core driver described here[0]. The pds_core driver creates the auxiliary_bus devices that this module connects to, and

[PATCH v6 virtio 04/11] pds_vdpa: move enum from common to adminq header

2023-05-15 Thread Shannon Nelson via Virtualization
The pds_core_logical_qtype enum and IFNAMSIZ are not needed in the common PDS header, only needed when working with the adminq, so move them to the adminq header. Note: This patch might conflict with pds_vfio patches that are in review, depending on which patchset gets pulled first. Signed-

[PATCH v6 virtio 06/11] pds_vdpa: get vdpa management info

2023-05-15 Thread Shannon Nelson via Virtualization
Find the vDPA management information from the DSC in order to advertise it to the vdpa subsystem. Signed-off-by: Shannon Nelson Acked-by: Jason Wang --- drivers/vdpa/pds/Makefile | 3 +- drivers/vdpa/pds/aux_drv.c | 17 ++ drivers/vdpa/pds/aux_drv.h | 7 +++ drivers/vdpa/pds/debugf

[PATCH v6 virtio 07/11] pds_vdpa: virtio bar setup for vdpa

2023-05-15 Thread Shannon Nelson via Virtualization
Prep and use the "modern" virtio bar utilities to get our virtio config space ready. Signed-off-by: Shannon Nelson Acked-by: Jason Wang --- drivers/vdpa/pds/aux_drv.c | 25 + drivers/vdpa/pds/aux_drv.h | 3 +++ 2 files changed, 28 insertions(+) diff --git a/drivers/vdp

[PATCH v6 virtio 03/11] pds_vdpa: Add new vDPA driver for AMD/Pensando DSC

2023-05-15 Thread Shannon Nelson via Virtualization
This is the initial auxiliary driver framework for a new vDPA device driver, an auxiliary_bus client of the pds_core driver. The pds_core driver supplies the PCI services for the VF device and for accessing the adminq in the PF device. This patch adds the very basics of registering for the auxilia

[PATCH v6 virtio 05/11] pds_vdpa: new adminq entries

2023-05-15 Thread Shannon Nelson via Virtualization
Add new adminq definitions in support for vDPA operations. Signed-off-by: Shannon Nelson Acked-by: Jason Wang --- include/linux/pds/pds_adminq.h | 226 + 1 file changed, 226 insertions(+) diff --git a/include/linux/pds/pds_adminq.h b/include/linux/pds/pds_adminq

[PATCH v6 virtio 08/11] pds_vdpa: add vdpa config client commands

2023-05-15 Thread Shannon Nelson via Virtualization
These are the adminq commands that will be needed for setting up and using the vDPA device. There are a number of commands defined in the FW's API, but by making use of the FW's virtio BAR we only need a few of these commands for vDPA support. Signed-off-by: Shannon Nelson Acked-by: Jason Wang

[PATCH v6 virtio 10/11] pds_vdpa: subscribe to the pds_core events

2023-05-15 Thread Shannon Nelson via Virtualization
Register for the pds_core's notification events, primarily to find out when the FW has been reset so we can pass this on back up the chain. Signed-off-by: Shannon Nelson --- drivers/vdpa/pds/vdpa_dev.c | 59 - drivers/vdpa/pds/vdpa_dev.h | 1 + 2 files change

[PATCH v6 virtio 09/11] pds_vdpa: add support for vdpa and vdpamgmt interfaces

2023-05-15 Thread Shannon Nelson via Virtualization
This is the vDPA device support, where we advertise that we can support the virtio queues and deal with the configuration work through the pds_core's adminq. Signed-off-by: Shannon Nelson Acked-by: Jason Wang --- drivers/vdpa/pds/aux_drv.c | 15 + drivers/vdpa/pds/aux_drv.h | 1 + drivers/

[PATCH v6 virtio 11/11] pds_vdpa: pds_vdps.rst and Kconfig

2023-05-15 Thread Shannon Nelson via Virtualization
Add the documentation and Kconfig entry for pds_vdpa driver. Signed-off-by: Shannon Nelson --- .../device_drivers/ethernet/amd/pds_vdpa.rst | 85 +++ .../device_drivers/ethernet/index.rst | 1 + MAINTAINERS | 4 + drivers/vdpa/Kconfig

Re: [PATCH v6 virtio 04/11] pds_vdpa: move enum from common to adminq header

2023-05-16 Thread Shannon Nelson via Virtualization
On 5/15/23 11:12 PM, Michael S. Tsirkin wrote: On Mon, May 15, 2023 at 07:55:14PM -0700, Shannon Nelson wrote: The pds_core_logical_qtype enum and IFNAMSIZ are not needed in the common PDS header, only needed when working with the adminq, so move them to the adminq header. Note: This patch migh

Re: [PATCH v6 virtio 09/11] pds_vdpa: add support for vdpa and vdpamgmt interfaces

2023-05-16 Thread Shannon Nelson via Virtualization
On 5/16/23 3:35 AM, Simon Horman wrote: On Mon, May 15, 2023 at 07:55:19PM -0700, Shannon Nelson wrote: This is the vDPA device support, where we advertise that we can support the virtio queues and deal with the configuration work through the pds_core's adminq. Signed-off-by: Shannon Nelson A

Re: [PATCH v2 2/3] vhost: support PACKED when setting-getting vring_base

2023-05-16 Thread Shannon Nelson via Virtualization
On 5/16/23 12:49 AM, Stefano Garzarella wrote: On Mon, May 15, 2023 at 01:41:12PM -0700, Shannon Nelson wrote: On 5/9/23 1:46 AM, Stefano Garzarella wrote: On Mon, Apr 24, 2023 at 03:50:30PM -0700, Shannon Nelson via Virtualization wrote: Use the right structs for PACKED or split vqs when

Re: [PATCH v6 virtio 11/11] pds_vdpa: pds_vdps.rst and Kconfig

2023-05-16 Thread Shannon Nelson via Virtualization
On 5/16/23 7:24 PM, kernel test robot wrote: Hi Shannon, kernel test robot noticed the following build warnings: [auto build test WARNING on linus/master] [also build test WARNING on v6.4-rc2 next-20230516] [cannot apply to mst-vhost/linux-next] [If your patch is applied to the wrong git tree,

[PATCH v7 virtio 00/11] pds_vdpa driver

2023-05-19 Thread Shannon Nelson via Virtualization
This patchset implements a new module for the AMD/Pensando DSC that supports vDPA services on PDS Core VF devices. This code is based on and depends on include files from the pds_core driver described here[0]. The pds_core driver creates the auxiliary_bus devices that this module connects to, and

[PATCH v7 virtio 02/11] virtio: allow caller to override device DMA mask in vp_modern

2023-05-19 Thread Shannon Nelson via Virtualization
To add a bit of vendor flexibility with various virtio based devices, allow the caller to specify a different DMA mask. This adds a dma_mask field to struct virtio_pci_modern_device. If defined by the driver, this mask will be used in a call to dma_set_mask_and_coherent() instead of the tradition

[PATCH v7 virtio 01/11] virtio: allow caller to override device id in vp_modern

2023-05-19 Thread Shannon Nelson via Virtualization
To add a bit of vendor flexibility with various virtio based devices, allow the caller to check for a different device id. This adds a function pointer field to struct virtio_pci_modern_device to specify an override device id check. If defined by the driver, this function will be called to check

[PATCH v7 virtio 04/11] pds_vdpa: move enum from common to adminq header

2023-05-19 Thread Shannon Nelson via Virtualization
The pds_core_logical_qtype enum and IFNAMSIZ are not needed in the common PDS header, only needed when working with the adminq, so move them to the adminq header. Note: This patch might conflict with pds_vfio patches that are in review, depending on which patchset gets pulled first. Signed-

[PATCH v7 virtio 05/11] pds_vdpa: new adminq entries

2023-05-19 Thread Shannon Nelson via Virtualization
Add new adminq definitions in support for vDPA operations. Signed-off-by: Shannon Nelson Acked-by: Jason Wang --- include/linux/pds/pds_adminq.h | 226 + 1 file changed, 226 insertions(+) diff --git a/include/linux/pds/pds_adminq.h b/include/linux/pds/pds_adminq

[PATCH v7 virtio 06/11] pds_vdpa: get vdpa management info

2023-05-19 Thread Shannon Nelson via Virtualization
Find the vDPA management information from the DSC in order to advertise it to the vdpa subsystem. Signed-off-by: Shannon Nelson Acked-by: Jason Wang --- drivers/vdpa/pds/Makefile | 3 +- drivers/vdpa/pds/aux_drv.c | 17 ++ drivers/vdpa/pds/aux_drv.h | 7 +++ drivers/vdpa/pds/debugf

[PATCH v7 virtio 03/11] pds_vdpa: Add new vDPA driver for AMD/Pensando DSC

2023-05-19 Thread Shannon Nelson via Virtualization
This is the initial auxiliary driver framework for a new vDPA device driver, an auxiliary_bus client of the pds_core driver. The pds_core driver supplies the PCI services for the VF device and for accessing the adminq in the PF device. This patch adds the very basics of registering for the auxilia

[PATCH v7 virtio 09/11] pds_vdpa: add support for vdpa and vdpamgmt interfaces

2023-05-19 Thread Shannon Nelson via Virtualization
This is the vDPA device support, where we advertise that we can support the virtio queues and deal with the configuration work through the pds_core's adminq. Signed-off-by: Shannon Nelson --- Note: this had previously been Acked-by Jason Wang, but changed enough in v6 that I felt it needs

[PATCH v7 virtio 10/11] pds_vdpa: subscribe to the pds_core events

2023-05-19 Thread Shannon Nelson via Virtualization
Register for the pds_core's notification events, primarily to find out when the FW has been reset so we can pass this on back up the chain. Signed-off-by: Shannon Nelson Acked-by: Jason Wang --- drivers/vdpa/pds/vdpa_dev.c | 59 - drivers/vdpa/pds/vdpa_dev.h

[PATCH v7 virtio 07/11] pds_vdpa: virtio bar setup for vdpa

2023-05-19 Thread Shannon Nelson via Virtualization
Prep and use the "modern" virtio bar utilities to get our virtio config space ready. Signed-off-by: Shannon Nelson Acked-by: Jason Wang --- drivers/vdpa/pds/aux_drv.c | 25 + drivers/vdpa/pds/aux_drv.h | 3 +++ 2 files changed, 28 insertions(+) diff --git a/drivers/vdp

[PATCH v7 virtio 11/11] pds_vdpa: pds_vdps.rst and Kconfig

2023-05-19 Thread Shannon Nelson via Virtualization
Add the documentation and Kconfig entry for pds_vdpa driver. Signed-off-by: Shannon Nelson Acked-by: Jason Wang --- .../device_drivers/ethernet/amd/pds_vdpa.rst | 85 +++ .../device_drivers/ethernet/index.rst | 1 + MAINTAINERS | 4 +

[PATCH v7 virtio 08/11] pds_vdpa: add vdpa config client commands

2023-05-19 Thread Shannon Nelson via Virtualization
These are the adminq commands that will be needed for setting up and using the vDPA device. There are a number of commands defined in the FW's API, but by making use of the FW's virtio BAR we only need a few of these commands for vDPA support. Signed-off-by: Shannon Nelson Acked-by: Jason Wang

[PATCH virtio 4/4] pds_vdpa: alloc irq vectors on DRIVER_OK

2023-06-29 Thread Shannon Nelson via Virtualization
From: Allen Hubbe We were allocating irq vectors at the time the aux dev was probed, but that is before the PCI VF is assigned to a separate iommu domain by vhost_vdpa. Because vhost_vdpa later changes the iommu domain the interrupts do not work. Instead, we can allocate the irq vectors later w

[PATCH virtio 3/4] pds_vdpa: clean and reset vqs entries

2023-06-29 Thread Shannon Nelson via Virtualization
Make sure that we initialize the vqs[] entries the same way both for initial setup and after a vq reset. Fixes: 151cc834f3dd ("pds_vdpa: add support for vdpa and vdpamgmt interfaces") Signed-off-by: Shannon Nelson Reviewed-by: Brett Creeley --- drivers/vdpa/pds/vdpa_dev.c | 24 +++--

[PATCH virtio 0/4] pds_vdpa: mac, reset, and irq updates

2023-06-29 Thread Shannon Nelson via Virtualization
v2 for internal review - heavily reworked NET_F_MAC patch, matches recent PR-68875 - reordered to put "clean and reset vqs" before "alloc-irq" to make them slightly simpler patches - other minor cleanups for simpler patches These are some fixes for device providing a MAC address, for alloca

[PATCH virtio 2/4] pds_vdpa: always allow offering VIRTIO_NET_F_MAC

2023-06-29 Thread Shannon Nelson via Virtualization
Our driver sets a mac if the HW is 00:..:00 so we need to be sure to advertise VIRTIO_NET_F_MAC even if the HW doesn't. We also need to be sure that virtio_net sees the VIRTIO_NET_F_MAC and doesn't rewrite the mac address that a user may have set with the vdpa utility. After reading the hw_featur

[PATCH virtio 1/4] pds_vdpa: reset to vdpa specified mac

2023-06-29 Thread Shannon Nelson via Virtualization
From: Allen Hubbe When the vdpa device is reset, also reinitialize it with the mac address that was assigned when the device was added. Fixes: 151cc834f3dd ("pds_vdpa: add support for vdpa and vdpamgmt interfaces") Signed-off-by: Allen Hubbe Signed-off-by: Shannon Nelson Reviewed-by: Brett Cre

Re: [PATCH] vdpa: reject F_ENABLE_AFTER_DRIVER_OK if backend does not support it

2023-07-05 Thread Shannon Nelson via Virtualization
On 7/5/23 11:27 AM, Eugenio Perez Martin wrote: > On Wed, Jul 5, 2023 at 9:50 AM Jason Wang wrote: On Tue, Jul 4, 2023 at 11:45 PM Michael S. Tsirkin wrote: On Tue, Jul 04, 2023 at 01:36:11PM +0200, Eugenio Perez Martin wrote: On Tue, Jul 4, 2023 at 12:38 PM Michael S. Tsirkin wrote: On

Re: linux-next: Tree for Jul 6 [drivers/vdpa/pds/pds_vdpa.ko]

2023-07-06 Thread Shannon Nelson via Virtualization
On 7/6/23 2:07 PM, Randy Dunlap wrote: On 7/5/23 18:57, Stephen Rothwell wrote: Hi all, Please do *not* add any v6.6 related stuff to your linux-next included branches until after v6.5-rc1 has been released. Changes since 20230705: On loongarch, when DEBUG_FS is not set: ERROR: modpost: "

[PATCH virtio] pds_vdpa: protect Makefile from unconfigured debugfs

2023-07-06 Thread Shannon Nelson via Virtualization
debugfs.h protects itself from an undefined DEBUG_FS, so it is not necessary to check it in the driver code or the Makefile. The driver code had been updated for this, but the Makefile had missed the update. Link: https://lore.kernel.org/linux-next/fec68c3c-8249-7af4-5390-0495386a7...@infradead.o

Re: [PATCH virtio 1/4] pds_vdpa: reset to vdpa specified mac

2023-07-07 Thread Shannon Nelson via Virtualization
On 7/7/23 12:33 AM, Jason Wang wrote: Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding. On Fri, Jun 30, 2023 at 8:36 AM Shannon Nelson wrote: From: Allen Hubbe When the vdpa device is reset, also reiniti

Re: [PATCH virtio 2/4] pds_vdpa: always allow offering VIRTIO_NET_F_MAC

2023-07-07 Thread Shannon Nelson via Virtualization
On 7/7/23 12:44 AM, Jason Wang wrote: On Fri, Jun 30, 2023 at 8:36 AM Shannon Nelson wrote: Our driver sets a mac if the HW is 00:..:00 so we need to be sure to advertise VIRTIO_NET_F_MAC even if the HW doesn't. We also need to be sure that virtio_net sees the VIRTIO_NET_F_MAC and doesn't re

Re: [PATCH virtio 3/4] pds_vdpa: clean and reset vqs entries

2023-07-07 Thread Shannon Nelson via Virtualization
On 7/7/23 12:36 AM, Jason Wang wrote: Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding. On Fri, Jun 30, 2023 at 8:36 AM Shannon Nelson wrote: Make sure that we initialize the vqs[] entries the same way bot

Re: [PATCH virtio 1/4] pds_vdpa: reset to vdpa specified mac

2023-07-10 Thread Shannon Nelson via Virtualization
On 7/9/23 8:04 PM, Jason Wang wrote: On Sat, Jul 8, 2023 at 4:12 AM Shannon Nelson wrote: On 7/7/23 12:33 AM, Jason Wang wrote: Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding. On Fri, Jun 30, 2023 at 8

[PATCH v2 virtio 5/5] pds_vdpa: fix up debugfs feature bit printing

2023-07-10 Thread Shannon Nelson via Virtualization
Make clearer in debugfs output the difference between the hw feature bits, the features supported through the driver, and the features that have been negotiated. Signed-off-by: Shannon Nelson --- drivers/vdpa/pds/debugfs.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff

[PATCH v2 virtio 1/5] pds_vdpa: reset to vdpa specified mac

2023-07-10 Thread Shannon Nelson via Virtualization
From: Allen Hubbe When the vdpa device is reset, also reinitialize it with the mac address that was assigned when the device was added. Fixes: 151cc834f3dd ("pds_vdpa: add support for vdpa and vdpamgmt interfaces") Signed-off-by: Allen Hubbe Signed-off-by: Shannon Nelson --- drivers/vdpa/pds/

[PATCH v2 virtio 0/5] pds_vdpa: mac, reset, and irq updates

2023-07-10 Thread Shannon Nelson via Virtualization
These are some fixes for device providing a MAC address, for allocating irq resources later to support vhost use, and for properly cleaning vq info on reset. v2: - check driver feature request against supported_features, and strip the F_MAC bit if needed just before writing to the HW. - repor

[PATCH v2 virtio 2/5] pds_vdpa: always allow offering VIRTIO_NET_F_MAC

2023-07-10 Thread Shannon Nelson via Virtualization
Our driver sets a mac if the HW is 00:..:00 so we need to be sure to advertise VIRTIO_NET_F_MAC even if the HW doesn't. We also need to be sure that virtio_net sees the VIRTIO_NET_F_MAC and doesn't rewrite the mac address that a user may have set with the vdpa utility. After reading the hw_featur

[PATCH v2 virtio 4/5] pds_vdpa: alloc irq vectors on DRIVER_OK

2023-07-10 Thread Shannon Nelson via Virtualization
From: Allen Hubbe We were allocating irq vectors at the time the aux dev was probed, but that is before the PCI VF is assigned to a separate iommu domain by vhost_vdpa. Because vhost_vdpa later changes the iommu domain the interrupts do not work. Instead, we can allocate the irq vectors later w

[PATCH v2 virtio 3/5] pds_vdpa: clean and reset vqs entries

2023-07-10 Thread Shannon Nelson via Virtualization
Make sure that we initialize the vqs[] entries the same way both for initial setup and after a vq reset. Fixes: 151cc834f3dd ("pds_vdpa: add support for vdpa and vdpamgmt interfaces") Signed-off-by: Shannon Nelson --- drivers/vdpa/pds/vdpa_dev.c | 24 +--- 1 file changed, 17

[PATCH RFC net] virtio-net: add timeout for virtnet_send_command()

2023-07-18 Thread Shannon Nelson via Virtualization
When trying to talk to a device that has gone out to lunch, the virtnet_send_command() will sit and spin forever, causing a soft lockup and eventually crashing the kernel. Add a limit to the spin and return false if we hit the timeout. The 2 second time limit seems a bit arbitrary, but a reasonab

Re: [PATCH] vpda: pds: fix building without debugfs

2023-07-19 Thread Shannon Nelson via Virtualization
On 7/19/23 12:40 PM, Arnd Bergmann wrote: From: Arnd Bergmann The new debugfs code still gets called when debugfs is disabled, resulting in a link failure: ERROR: modpost: "pds_vdpa_debugfs_del_vdpadev" [drivers/vdpa/pds/pds_vdpa.ko] undefined! ERROR: modpost: "pds_vdpa_debugfs_add_vdpadev"

Re: [PATCH net-next v4 2/2] virtio-net: add cond_resched() to the command waiting loop

2023-07-20 Thread Shannon Nelson via Virtualization
On 7/20/23 1:38 AM, Jason Wang wrote: Adding cond_resched() to the command waiting loop for a better co-operation with the scheduler. This allows to give CPU a breath to run other task(workqueue) instead of busy looping when preemption is not allowed on a device whose CVQ might be slow. Signed-

Re: [PATCH net-next v4 1/2] virtio-net: convert rx mode setting to use workqueue

2023-07-20 Thread Shannon Nelson via Virtualization
On 7/20/23 1:38 AM, Jason Wang wrote: This patch convert rx mode setting to be done in a workqueue, this is a must for allow to sleep when waiting for the cvq command to response since current code is executed under addr spin lock. Note that we need to disable and flush the workqueue during fre

Re: [PATCH net-next v4 2/2] virtio-net: add cond_resched() to the command waiting loop

2023-07-20 Thread Shannon Nelson via Virtualization
On 7/20/23 1:38 AM, Jason Wang wrote: Adding cond_resched() to the command waiting loop for a better co-operation with the scheduler. This allows to give CPU a breath to run other task(workqueue) instead of busy looping when preemption is not allowed on a device whose CVQ might be slow. Signed-

[PATCH net] virtio: kdoc for struct virtio_pci_modern_device

2023-08-28 Thread Shannon Nelson via Virtualization
Finally following up to Simon's suggestion for some kdoc attention on struct virtio_pci_modern_device. Link: https://lore.kernel.org/netdev/ze%2fqs0lnuvxfa...@corigine.com/ Cc: Simon Horman Signed-off-by: Shannon Nelson --- include/linux/virtio_pci_modern.h | 34 ---

[PATCH iproute2] vdpa: consume device_features parameter

2023-09-11 Thread Shannon Nelson via Virtualization
From: Allen Hubbe Consume the parameter to device_features when parsing command line options. Otherwise the parameter may be used again as an option name. # vdpa dev add ... device_features 0xdeadbeef mac 00:11:22:33:44:55 Unknown option "0xdeadbeef" Fixes: a4442ce58ebb ("vdpa: allow provisi

[PATCH net-next] virtio: kdoc for struct virtio_pci_modern_device

2023-09-11 Thread Shannon Nelson via Virtualization
Finally following up to Simon's suggestion for some kdoc attention on struct virtio_pci_modern_device. Link: https://lore.kernel.org/netdev/ze%2fqs0lnuvxfa...@corigine.com/ Cc: Simon Horman Signed-off-by: Shannon Nelson Acked-by: Eugenio Pérez --- include/linux/virtio_pci_modern.h | 34 +++

[PATCH 2/3] vhost: support PACKED when setting-getting vring_base

2023-04-21 Thread Shannon Nelson via Virtualization
Use the right structs for PACKED or split vqs when setting and getting the vring base. Signed-off-by: Shannon Nelson --- drivers/vhost/vhost.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index f11bdbe4c2c5.

[PATCH 0/3] vhost_vdpa: better PACKED support

2023-04-21 Thread Shannon Nelson via Virtualization
While testing our vDPA driver with QEMU we found that vhost_vdpa seems to be missing some support for PACKED VQs. Adding these helped us get further in our testing. The first patch makes sure that the vhost_vdpa vqs are given the feature flags, as done in other vhost variants. The second and thi

[PATCH 1/3] vhost_vdpa: tell vqs about the negotiated

2023-04-21 Thread Shannon Nelson via Virtualization
As is done in the net, iscsi, and vsock vhost support, let the vdpa vqs know about the features that have been negotiated. This allows vhost to more safely make decisions based on the features, such as when using PACKED vs split queues. Signed-off-by: Shannon Nelson --- drivers/vhost/vdpa.c | 1

[PATCH 3/3] vhost_vdpa: support PACKED when setting-getting vring_base

2023-04-21 Thread Shannon Nelson via Virtualization
Use the right structs for PACKED or split vqs when setting and getting the vring base. Signed-off-by: Shannon Nelson --- drivers/vhost/vdpa.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index 599b8cc238c7..2

Re: [PATCH 2/3] vhost: support PACKED when setting-getting vring_base

2023-04-24 Thread Shannon Nelson via Virtualization
On 4/22/23 11:36 PM, Jason Wang wrote: On Sat, Apr 22, 2023 at 3:57 AM Shannon Nelson wrote: Use the right structs for PACKED or split vqs when setting and getting the vring base. Signed-off-by: Shannon Nelson --- drivers/vhost/vhost.c | 18 +- 1 file changed, 13 insertion

Re: [PATCH 3/3] vhost_vdpa: support PACKED when setting-getting vring_base

2023-04-24 Thread Shannon Nelson via Virtualization
On 4/22/23 11:40 PM, Jason Wang wrote: On Sat, Apr 22, 2023 at 3:57 AM Shannon Nelson wrote: Use the right structs for PACKED or split vqs when setting and getting the vring base. Signed-off-by: Shannon Nelson --- drivers/vhost/vdpa.c | 19 +++ 1 file changed, 15 insertion

[PATCH v2 2/3] vhost: support PACKED when setting-getting vring_base

2023-04-24 Thread Shannon Nelson via Virtualization
Use the right structs for PACKED or split vqs when setting and getting the vring base. Signed-off-by: Shannon Nelson --- drivers/vhost/vhost.c | 18 +- drivers/vhost/vhost.h | 8 ++-- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/drivers/vhost/vhost.c b/dri

[PATCH v2 1/3] vhost_vdpa: tell vqs about the negotiated

2023-04-24 Thread Shannon Nelson via Virtualization
As is done in the net, iscsi, and vsock vhost support, let the vdpa vqs know about the features that have been negotiated. This allows vhost to more safely make decisions based on the features, such as when using PACKED vs split queues. Signed-off-by: Shannon Nelson Acked-by: Jason Wang --- dr

[PATCH v2 3/3] vhost_vdpa: support PACKED when setting-getting vring_base

2023-04-24 Thread Shannon Nelson via Virtualization
Use the right structs for PACKED or split vqs when setting and getting the vring base. Signed-off-by: Shannon Nelson --- drivers/vhost/vdpa.c | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index 599b8cc238c7.

[PATCH v2 0/3] vhost_vdpa: better PACKED support

2023-04-24 Thread Shannon Nelson via Virtualization
While testing our vDPA driver with QEMU we found that vhost_vdpa was missing some support for PACKED VQs. Adding these helped us get further in our testing. The first patch makes sure that the vhost_vdpa vqs are given the feature flags, as done in other vhost variants. The second and third patch

Re: [PATCH v2 0/3] vhost_vdpa: better PACKED support

2023-04-25 Thread Shannon Nelson via Virtualization
On 4/24/23 11:08 PM, Michael S. Tsirkin wrote: On Mon, Apr 24, 2023 at 03:50:28PM -0700, Shannon Nelson wrote: While testing our vDPA driver with QEMU we found that vhost_vdpa was missing some support for PACKED VQs. Adding these helped us get further in our testing. The first patch makes sur

[PATCH v4 virtio 00/10] pds_vdpa driver

2023-04-25 Thread Shannon Nelson via Virtualization
This patchset implements a new module for the AMD/Pensando DSC that supports vDPA services on PDS Core VF devices. This code is based on and depends on include files from the pds_core driver described here[0]. The pds_core driver creates the auxiliary_bus devices that this module connects to, and

[PATCH v4 virtio 01/10] virtio: allow caller to override device id and DMA mask

2023-04-25 Thread Shannon Nelson via Virtualization
To add a bit of flexibility with various virtio based devices, allow the caller to specify a different device id and DMA mask. This adds fields to struct virtio_pci_modern_device to specify an override device id check and a DMA mask. int (*device_id_check)(struct pci_dev *pdev); If define

[PATCH v4 virtio 05/10] pds_vdpa: get vdpa management info

2023-04-25 Thread Shannon Nelson via Virtualization
Find the vDPA management information from the DSC in order to advertise it to the vdpa subsystem. Signed-off-by: Shannon Nelson Acked-by: Jason Wang --- drivers/vdpa/pds/Makefile | 3 +- drivers/vdpa/pds/aux_drv.c | 17 ++ drivers/vdpa/pds/aux_drv.h | 7 +++ drivers/vdpa/pds/debugf

[PATCH v4 virtio 03/10] pds_vdpa: move enum from common to adminq header

2023-04-25 Thread Shannon Nelson via Virtualization
The pds_core_logical_qtype enum and IFNAMSIZ are not needed in the common PDS header, only needed when working with the adminq, so move them to the adminq header. Note: This patch might conflict with pds_vfio patches that are in review, depending on which patchset gets pulled first. Signed-

[PATCH v4 virtio 04/10] pds_vdpa: new adminq entries

2023-04-25 Thread Shannon Nelson via Virtualization
Add new adminq definitions in support for vDPA operations. Signed-off-by: Shannon Nelson --- include/linux/pds/pds_adminq.h | 266 + 1 file changed, 266 insertions(+) diff --git a/include/linux/pds/pds_adminq.h b/include/linux/pds/pds_adminq.h index 61b0a8634e1a.

[PATCH v4 virtio 02/10] pds_vdpa: Add new vDPA driver for AMD/Pensando DSC

2023-04-25 Thread Shannon Nelson via Virtualization
This is the initial auxiliary driver framework for a new vDPA device driver, an auxiliary_bus client of the pds_core driver. The pds_core driver supplies the PCI services for the VF device and for accessing the adminq in the PF device. This patch adds the very basics of registering for the auxilia

[PATCH v4 virtio 10/10] pds_vdpa: pds_vdps.rst and Kconfig

2023-04-25 Thread Shannon Nelson via Virtualization
Add the documentation and Kconfig entry for pds_vdpa driver. Signed-off-by: Shannon Nelson --- .../device_drivers/ethernet/amd/pds_vdpa.rst | 85 +++ .../device_drivers/ethernet/index.rst | 1 + MAINTAINERS | 4 + drivers/vdpa/Kconfig

[PATCH v4 virtio 06/10] pds_vdpa: virtio bar setup for vdpa

2023-04-25 Thread Shannon Nelson via Virtualization
Prep and use the "modern" virtio bar utilities to get our virtio config space ready. Signed-off-by: Shannon Nelson --- drivers/vdpa/pds/aux_drv.c | 25 + drivers/vdpa/pds/aux_drv.h | 3 +++ 2 files changed, 28 insertions(+) diff --git a/drivers/vdpa/pds/aux_drv.c b/driv

[PATCH v4 virtio 07/10] pds_vdpa: add vdpa config client commands

2023-04-25 Thread Shannon Nelson via Virtualization
These are the adminq commands that will be needed for setting up and using the vDPA device. There are a number of commands defined in the FW's API, but by making use of the FW's virtio BAR we only need a few of these commands for vDPA support. Signed-off-by: Shannon Nelson --- Note: the previou

[PATCH v4 virtio 09/10] pds_vdpa: subscribe to the pds_core events

2023-04-25 Thread Shannon Nelson via Virtualization
Register for the pds_core's notification events, primarily to find out when the FW has been reset so we can pass this on back up the chain. Signed-off-by: Shannon Nelson --- drivers/vdpa/pds/vdpa_dev.c | 68 - drivers/vdpa/pds/vdpa_dev.h | 1 + 2 files change

[PATCH v4 virtio 08/10] pds_vdpa: add support for vdpa and vdpamgmt interfaces

2023-04-25 Thread Shannon Nelson via Virtualization
This is the vDPA device support, where we advertise that we can support the virtio queues and deal with the configuration work through the pds_core's adminq. Signed-off-by: Shannon Nelson --- drivers/vdpa/pds/aux_drv.c | 15 + drivers/vdpa/pds/aux_drv.h | 1 + drivers/vdpa/pds/debugfs.c |

Re: [PATCH v4 virtio 01/10] virtio: allow caller to override device id and DMA mask

2023-04-25 Thread Shannon Nelson via Virtualization
On 4/25/23 7:09 PM, Xuan Zhuo wrote: On Tue, 25 Apr 2023 14:25:53 -0700, Shannon Nelson wrote: To add a bit of flexibility with various virtio based devices, allow the caller to specify a different device id and DMA mask. This adds fields to struct virtio_pci_modern_device to specify an over

Re: [PATCH v4 virtio 01/10] virtio: allow caller to override device id and DMA mask

2023-05-03 Thread Shannon Nelson via Virtualization
On 5/1/23 7:44 AM, Simon Horman wrote: On Tue, Apr 25, 2023 at 02:25:53PM -0700, Shannon Nelson wrote: To add a bit of flexibility with various virtio based devices, allow the caller to specify a different device id and DMA mask. This adds fields to struct virtio_pci_modern_device to specify

[PATCH v5 virtio 07/11] pds_vdpa: virtio bar setup for vdpa

2023-05-03 Thread Shannon Nelson via Virtualization
Prep and use the "modern" virtio bar utilities to get our virtio config space ready. Signed-off-by: Shannon Nelson --- drivers/vdpa/pds/aux_drv.c | 25 + drivers/vdpa/pds/aux_drv.h | 3 +++ 2 files changed, 28 insertions(+) diff --git a/drivers/vdpa/pds/aux_drv.c b/driv

[PATCH v5 virtio 00/11] pds_vdpa driver

2023-05-03 Thread Shannon Nelson via Virtualization
This patchset implements a new module for the AMD/Pensando DSC that supports vDPA services on PDS Core VF devices. This code is based on and depends on include files from the pds_core driver described here[0]. The pds_core driver creates the auxiliary_bus devices that this module connects to, and

[PATCH v5 virtio 02/11] virtio: allow caller to override device DMA mask in vp_modern

2023-05-03 Thread Shannon Nelson via Virtualization
To add a bit of vendor flexibility with various virtio based devices, allow the caller to specify a different DMA mask. This adds a dma_mask field to struct virtio_pci_modern_device. If defined by the driver, this mask will be used in a call to dma_set_mask_and_coherent() instead of the tradition

[PATCH v5 virtio 01/11] virtio: allow caller to override device id in vp_modern

2023-05-03 Thread Shannon Nelson via Virtualization
To add a bit of vendor flexibility with various virtio based devices, allow the caller to check for a different device id. This adds a function pointer field to struct virtio_pci_modern_device to specify an override device id check. If defined by the driver, this function will be called to check

[PATCH v5 virtio 04/11] pds_vdpa: move enum from common to adminq header

2023-05-03 Thread Shannon Nelson via Virtualization
The pds_core_logical_qtype enum and IFNAMSIZ are not needed in the common PDS header, only needed when working with the adminq, so move them to the adminq header. Note: This patch might conflict with pds_vfio patches that are in review, depending on which patchset gets pulled first. Signed-

[PATCH v5 virtio 06/11] pds_vdpa: get vdpa management info

2023-05-03 Thread Shannon Nelson via Virtualization
Find the vDPA management information from the DSC in order to advertise it to the vdpa subsystem. Signed-off-by: Shannon Nelson Acked-by: Jason Wang --- drivers/vdpa/pds/Makefile | 3 +- drivers/vdpa/pds/aux_drv.c | 17 ++ drivers/vdpa/pds/aux_drv.h | 7 +++ drivers/vdpa/pds/debugf

[PATCH v5 virtio 11/11] pds_vdpa: pds_vdps.rst and Kconfig

2023-05-03 Thread Shannon Nelson via Virtualization
Add the documentation and Kconfig entry for pds_vdpa driver. Signed-off-by: Shannon Nelson --- .../device_drivers/ethernet/amd/pds_vdpa.rst | 85 +++ .../device_drivers/ethernet/index.rst | 1 + MAINTAINERS | 4 + drivers/vdpa/Kconfig

[PATCH v5 virtio 05/11] pds_vdpa: new adminq entries

2023-05-03 Thread Shannon Nelson via Virtualization
Add new adminq definitions in support for vDPA operations. Signed-off-by: Shannon Nelson --- include/linux/pds/pds_adminq.h | 266 + 1 file changed, 266 insertions(+) diff --git a/include/linux/pds/pds_adminq.h b/include/linux/pds/pds_adminq.h index 61b0a8634e1a.

[PATCH v5 virtio 03/11] pds_vdpa: Add new vDPA driver for AMD/Pensando DSC

2023-05-03 Thread Shannon Nelson via Virtualization
This is the initial auxiliary driver framework for a new vDPA device driver, an auxiliary_bus client of the pds_core driver. The pds_core driver supplies the PCI services for the VF device and for accessing the adminq in the PF device. This patch adds the very basics of registering for the auxilia

[PATCH v5 virtio 08/11] pds_vdpa: add vdpa config client commands

2023-05-03 Thread Shannon Nelson via Virtualization
These are the adminq commands that will be needed for setting up and using the vDPA device. There are a number of commands defined in the FW's API, but by making use of the FW's virtio BAR we only need a few of these commands for vDPA support. Signed-off-by: Shannon Nelson --- drivers/vdpa/pds/

[PATCH v5 virtio 10/11] pds_vdpa: subscribe to the pds_core events

2023-05-03 Thread Shannon Nelson via Virtualization
Register for the pds_core's notification events, primarily to find out when the FW has been reset so we can pass this on back up the chain. Signed-off-by: Shannon Nelson --- drivers/vdpa/pds/vdpa_dev.c | 68 - drivers/vdpa/pds/vdpa_dev.h | 1 + 2 files change

[PATCH v5 virtio 09/11] pds_vdpa: add support for vdpa and vdpamgmt interfaces

2023-05-03 Thread Shannon Nelson via Virtualization
This is the vDPA device support, where we advertise that we can support the virtio queues and deal with the configuration work through the pds_core's adminq. Signed-off-by: Shannon Nelson --- drivers/vdpa/pds/aux_drv.c | 15 + drivers/vdpa/pds/aux_drv.h | 1 + drivers/vdpa/pds/debugfs.c |