RE: [PATCH linux-next v2 4/7] vdpa: Define vdpa mgmt device, ops and a netlink interface

2021-01-03 Thread Parav Pandit
> From: Jason Wang > Sent: Monday, January 4, 2021 12:33 PM > > On 2021/1/4 上午11:31, Parav Pandit wrote: > > To add one or more VDPA devices, define a management device which > > allows adding or removing vdpa device. A management device defines set > > of callbacks to manage vdpa devices. > >

RE: [PATCH linux-next v2 7/7] vdpa_sim_net: Add support for user supported devices

2021-01-03 Thread Parav Pandit
> From: Jason Wang > Sent: Monday, January 4, 2021 12:35 PM > > On 2021/1/4 上午11:31, Parav Pandit wrote: > > static int __init vdpasim_net_init(void) > > { > > int ret = 0; > > @@ -176,6 +264,8 @@ static int __init vdpasim_net_init(void) > > > > if (default_device) > >

Re: [PATCH linux-next v2 7/7] vdpa_sim_net: Add support for user supported devices

2021-01-03 Thread Jason Wang
On 2021/1/4 上午11:31, Parav Pandit wrote: static int __init vdpasim_net_init(void) { int ret = 0; @@ -176,6 +264,8 @@ static int __init vdpasim_net_init(void) if (default_device) ret = vdpasim_net_default_dev_register(); + else + ret =

Re: [PATCH linux-next v2 4/7] vdpa: Define vdpa mgmt device, ops and a netlink interface

2021-01-03 Thread Jason Wang
On 2021/1/4 上午11:31, Parav Pandit wrote: To add one or more VDPA devices, define a management device which allows adding or removing vdpa device. A management device defines set of callbacks to manage vdpa devices. To begin with, it defines add and remove callbacks through which a user defined

Re: [PATCH linux-next v2 1/7] vdpa_sim_net: Make mac address array static

2021-01-03 Thread Jason Wang
On 2021/1/4 上午11:31, Parav Pandit wrote: MAC address array is used only in vdpa_sim_net.c. Hence, keep it static. Signed-off-by: Parav Pandit --- Changelog: v1->v2: - new patch --- drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH V2 00/19] vDPA driver for virtio-pci device

2021-01-03 Thread Jason Wang
On 2021/1/3 下午8:37, Michael S. Tsirkin wrote: On Thu, Dec 31, 2020 at 11:52:14AM +0800, Jason Wang wrote: On 2020/12/4 下午12:03, Jason Wang wrote: Hi all: This series tries to implement a vDPA driver for virtio-pci device which will bridge between vDPA bus and virtio-pci device. This could

[PATCH V3 19/19] vdpa: introduce virtio pci driver

2021-01-03 Thread Jason Wang
This patch introduce a vDPA driver for virtio-pci device. It bridges the virtio-pci control command to the vDPA bus. This will be used for features prototyping and testing. Note that get/restore virtqueue state is not supported which needs extension on the virtio specification. Signed-off-by:

[PATCH V3 18/19] virtio_vdpa: don't warn when fail to disable vq

2021-01-03 Thread Jason Wang
There's no guarantee that the device can disable a specific virtqueue through set_vq_ready(). One example is the modern virtio-pci device. So this patch removes the warning. Signed-off-by: Jason Wang --- drivers/virtio/virtio_vdpa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff

[PATCH V3 17/19] vdpa: set the virtqueue num during register

2021-01-03 Thread Jason Wang
This patch delay the queue number setting to vDPA device registering. This allows us to probe the virtqueue numbers between device allocation and registering. Reviewed-by: Stefano Garzarella Signed-off-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_main.c | 5 ++---

[PATCH V3 16/19] virtio-pci: introduce modern device module

2021-01-03 Thread Jason Wang
Signed-off-by: Jason Wang --- drivers/virtio/Kconfig | 10 +- drivers/virtio/Makefile| 1 + drivers/virtio/virtio_pci_common.h | 27 +- drivers/virtio/virtio_pci_modern.c | 617 - drivers/virtio/virtio_pci_modern_dev.c | 599

[PATCH V3 15/19] virito-pci-modern: rename map_capability() to vp_modern_map_capability()

2021-01-03 Thread Jason Wang
To ease the split, map_capability() was renamed to vp_modern_map_capability(). While at it, add the comments for the arguments and switch to use virtio_pci_modern_device as the first parameter. Signed-off-by: Jason Wang --- drivers/virtio/virtio_pci_modern.c | 46 +++---

[PATCH V3 14/19] virtio-pci-modern: introduce helper to get notification offset

2021-01-03 Thread Jason Wang
This patch introduces help to get notification offset of modern device. Signed-off-by: Jason Wang --- drivers/virtio/virtio_pci_modern.c | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/virtio/virtio_pci_modern.c

[PATCH V3 13/19] virtio-pci-modern: introduce helper for getting queue nums

2021-01-03 Thread Jason Wang
This patch introduces helper for getting queue num of modern device. Signed-off-by: Jason Wang --- drivers/virtio/virtio_pci_modern.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c index

[PATCH V3 12/19] virtio-pci-modern: introduce helper for setting/geting queue size

2021-01-03 Thread Jason Wang
This patch introduces helper for setting/getting queue size for modern device. Signed-off-by: Jason Wang --- drivers/virtio/virtio_pci_modern.c | 34 -- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_pci_modern.c

[PATCH V3 11/19] virtio-pci-modern: introduce helper to set/get queue_enable

2021-01-03 Thread Jason Wang
This patch introduces a helper to set/get queue_enable for modern device. Signed-off-by: Jason Wang --- drivers/virtio/virtio_pci_modern.c | 37 +- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/drivers/virtio/virtio_pci_modern.c

[PATCH V3 10/19] virtio-pci-modern: introduce vp_modern_queue_address()

2021-01-03 Thread Jason Wang
This patch introduce a helper to set virtqueue address for modern address. Signed-off-by: Jason Wang --- drivers/virtio/virtio_pci_modern.c | 33 -- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/drivers/virtio/virtio_pci_modern.c

[PATCH V3 09/19] virtio-pci-modern: introduce vp_modern_set_queue_vector()

2021-01-03 Thread Jason Wang
This patch introduces a helper to set virtqueue MSI vector. Signed-off-by: Jason Wang --- drivers/virtio/virtio_pci_modern.c | 35 -- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/drivers/virtio/virtio_pci_modern.c

[PATCH V3 08/19] virtio-pci-modern: introduce vp_modern_generation()

2021-01-03 Thread Jason Wang
This patch introduces vp_modern_generation() to get device generation. Signed-off-by: Jason Wang --- drivers/virtio/virtio_pci_modern.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c

[PATCH V3 07/19] virtio-pci-modern: introduce helpers for setting and getting features

2021-01-03 Thread Jason Wang
This patch introduces helpers for setting and getting features. Signed-off-by: Jason Wang --- drivers/virtio/virtio_pci_modern.c | 43 +++--- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/drivers/virtio/virtio_pci_modern.c

[PATCH V3 06/19] virtio-pci-modern: introduce helpers for setting and getting status

2021-01-03 Thread Jason Wang
This patch introduces helpers to allow set and get device status. Signed-off-by: Jason Wang --- drivers/virtio/virtio_pci_modern.c | 37 +++--- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/drivers/virtio/virtio_pci_modern.c

[PATCH V3 05/19] virtio-pci-modern: introduce helper to set config vector

2021-01-03 Thread Jason Wang
This patch introduces vp_modern_config_vector() for setting config vector. Signed-off-by: Jason Wang --- drivers/virtio/virtio_pci_modern.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_pci_modern.c

[PATCH V3 04/19] virtio-pci-modern: introduce vp_modern_remove()

2021-01-03 Thread Jason Wang
This patch introduces vp_modern_remove() doing device resources cleanup to make it can be used. Signed-off-by: Jason Wang --- drivers/virtio/virtio_pci_modern.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_pci_modern.c

[PATCH V3 03/19] virtio-pci-modern: factor out modern device initialization logic

2021-01-03 Thread Jason Wang
This patch factors out the modern device initialization logic into a helper. Note that it still depends on the caller to enable pci device which allows the caller to use e.g devres. Signed-off-by: Jason Wang --- drivers/virtio/virtio_pci_modern.c | 50 +- 1 file

[PATCH V3 02/19] virtio-pci: split out modern device

2021-01-03 Thread Jason Wang
This patch splits out the virtio-pci modern device only attributes into another structure. While at it, a dedicated probe method for modern only attributes is introduced. This may help for split the logic into a dedicated module. Signed-off-by: Jason Wang --- drivers/virtio/virtio_pci_common.h

[PATCH V3 00/19] vDPA driver for virtio-pci device

2021-01-03 Thread Jason Wang
Hi all: This series tries to implement a vDPA driver for virtio-pci device which will bridge between vDPA bus and virtio-pci device. This could be used for future feature prototyping and testing. Please review Changes since V2: - tweak config prompt - switch from 'cb' to 'config_cb' for

[PATCH V3 01/19] virtio-pci: do not access iomem via struct virtio_pci_device directly

2021-01-03 Thread Jason Wang
Instead of accessing iomem via struct virito_pci_device directly, tweak to call the io accessors through the iomem structure. This will ease the splitting of modern virtio device logic. Signed-off-by: Jason Wang --- drivers/virtio/virtio_pci_modern.c | 76 ++ 1 file

[PATCH linux-next v2 6/7] vdpa: Enable user to query vdpa device info

2021-01-03 Thread Parav Pandit
Enable user to query vdpa device information. $ vdpa dev add mgmtdev vdpasim_net name foo2 Show the newly created vdpa device by its name: $ vdpa dev show foo2 foo2: type network mgmtdev vdpasim_net vendor_id 0 max_vqs 2 max_vq_size 256 $ vdpa dev show foo2 -jp { "dev": { "foo2": {

[PATCH linux-next v2 7/7] vdpa_sim_net: Add support for user supported devices

2021-01-03 Thread Parav Pandit
Enable user to create vdpasim net simulate devices. Show vdpa management device that supports creating, deleting vdpa devices. $ vdpa mgmtdev show vdpasim_net: supported_classes net $ vdpa mgmtdev show -jp { "show": { "vdpasim_net": { "supported_classes": {

[PATCH linux-next v2 3/7] vdpa: Extend routine to accept vdpa device name

2021-01-03 Thread Parav Pandit
In a subsequent patch, when user initiated command creates a vdpa device, the user chooses the name of the vdpa device. To support it, extend the device allocation API to consider this name specified by the caller driver. Signed-off-by: Parav Pandit Reviewed-by: Eli Cohen Acked-by: Jason Wang

[PATCH linux-next v2 5/7] vdpa: Enable a user to add and delete a vdpa device

2021-01-03 Thread Parav Pandit
Add the ability to add and delete a vdpa device. Examples: Create a vdpa device of type network named "foo2" from the management device vdpasim: $ vdpa dev add mgmtdev vdpasim_net name foo2 Delete the vdpa device after its use: $ vdpa dev del foo2 Signed-off-by: Parav Pandit Reviewed-by: Eli

[PATCH linux-next v2 4/7] vdpa: Define vdpa mgmt device, ops and a netlink interface

2021-01-03 Thread Parav Pandit
To add one or more VDPA devices, define a management device which allows adding or removing vdpa device. A management device defines set of callbacks to manage vdpa devices. To begin with, it defines add and remove callbacks through which a user defined vdpa device can be added or removed. A

[PATCH linux-next v2 1/7] vdpa_sim_net: Make mac address array static

2021-01-03 Thread Parav Pandit
MAC address array is used only in vdpa_sim_net.c. Hence, keep it static. Signed-off-by: Parav Pandit --- Changelog: v1->v2: - new patch --- drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim_net.c

[PATCH linux-next v2 0/7] Introduce vdpa management tool

2021-01-03 Thread Parav Pandit
This patchset covers user requirements for managing existing vdpa devices, using a tool and its internal design notes for kernel drivers. Background and user requirements: -- (1) Currently VDPA device is created by driver when driver is loaded. However, user should

[PATCH linux-next v2 2/7] vdpa_sim_net: Add module param to disable default vdpa net device

2021-01-03 Thread Parav Pandit
To support creating multiple vdpa devices and to allow user to manage them, add a knob to disable a default vdpa net device. Signed-off-by: Parav Pandit --- Changelog: v1->v2: - new patch --- drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 41 1 file changed, 29

Re: [PATCH V2 19/19] vdpa: introduce virtio pci driver

2021-01-03 Thread Jason Wang
On 2020/12/4 下午11:20, Stefano Garzarella wrote: +#define VP_VDPA_QUEUE_MAX 256 +#define VP_VDPA_DRIVER_NAME "vp_vdpa" + +struct vp_vring { +    void __iomem *notify; +    char msix_name[256]; Can we use a macro for the msix_name size, since we use 256 in multiple places? Yes, will switch

Re: [PATCH V2 16/19] virtio-pci: introduce modern device module

2021-01-03 Thread Jason Wang
On 2020/12/5 上午1:10, Randy Dunlap wrote: Hi Jason-- On 12/3/20 8:03 PM, Jason Wang wrote: diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig index 7b41130d3f35..d1a6bd2a975f 100644 --- a/drivers/virtio/Kconfig +++ b/drivers/virtio/Kconfig @@ -12,6 +12,14 @@ config

Re: [PATCH V2 00/19] vDPA driver for virtio-pci device

2021-01-03 Thread Michael S. Tsirkin
On Thu, Dec 31, 2020 at 11:52:14AM +0800, Jason Wang wrote: > > On 2020/12/4 下午12:03, Jason Wang wrote: > > Hi all: > > > > This series tries to implement a vDPA driver for virtio-pci device > > which will bridge between vDPA bus and virtio-pci device. > > > > This could be used for future