[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 b/drivers/virtio

[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 V3 00/19] vDPA driver for virtio-pci device

2021-01-03 Thread Jason Wang
dynamic id in order to be less confusing with virtio-pci driver - No feature whitelist, supporting any features (mq, config etc) Thanks Jason Wang (19): virtio-pci: do not access iomem via struct virtio_pci_device directly virtio-pci: split out modern device virtio-pci-modern: factor out

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

2020-12-30 Thread Jason Wang
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 feature prototyping and testing. Please review Changes from V2: - don't try to use

Re: [PATCH 12/21] vhost-vdpa: introduce uAPI to get the number of virtqueue groups

2020-12-30 Thread Jason Wang
On 2020/12/30 下午6:05, Eli Cohen wrote: On Wed, Dec 16, 2020 at 02:48:09PM +0800, Jason Wang wrote: Follows the vDPA support for multiple address spaces, this patch introduce uAPI for the userspace to know the number of virtqueue groups supported by the vDPA device. Signed-off-by: Jason Wang

Re: [PATCH 12/21] vhost-vdpa: introduce uAPI to get the number of virtqueue groups

2020-12-29 Thread Jason Wang
On 2020/12/29 下午8:24, Eli Cohen wrote: On Wed, Dec 16, 2020 at 02:48:09PM +0800, Jason Wang wrote: Follows the vDPA support for multiple address spaces, this patch introduce uAPI for the userspace to know the number of virtqueue groups supported by the vDPA device. Can you explain what

Re: [PATCH 11/21] vhost-vdpa: introduce asid based IOTLB

2020-12-29 Thread Jason Wang
On 2020/12/29 下午7:53, Eli Cohen wrote: + +static struct vhost_vdpa_as *vhost_vdpa_alloc_as(struct vhost_vdpa *v, u32 asid) +{ + struct hlist_head *head = >as[asid % VHOST_VDPA_IOTLB_BUCKETS]; + struct vhost_vdpa_as *as; + + if (asid_to_as(v, asid)) + return

Re: [PATCH 11/21] vhost-vdpa: introduce asid based IOTLB

2020-12-29 Thread Jason Wang
On 2020/12/29 下午8:05, Eli Cohen wrote: + +static int vhost_vdpa_remove_as(struct vhost_vdpa *v, u32 asid) The return value is never interpreted. I think it should either be made void or return values checked. Right, will make it void. +{ + struct vhost_vdpa_as *as =

Re: [PATCH 11/21] vhost-vdpa: introduce asid based IOTLB

2020-12-29 Thread Jason Wang
On 2020/12/29 下午7:41, Eli Cohen wrote: On Wed, Dec 16, 2020 at 02:48:08PM +0800, Jason Wang wrote: This patch converts the vhost-vDPA device to support multiple IOTLBs tagged via ASID via hlist. This will be used for supporting multiple address spaces in the following patches. Signed-off

Re: [PATCH 10/21] vhost: support ASID in IOTLB API

2020-12-29 Thread Jason Wang
On 2020/12/29 下午6:20, Eli Cohen wrote: -static int vhost_process_iotlb_msg(struct vhost_dev *dev, +static int vhost_process_iotlb_msg(struct vhost_dev *dev, u16 asid, struct vhost_iotlb_msg *msg) { int ret = 0; + if (asid != 0) +

Re: [PATCH 07/21] vdpa: multiple address spaces support

2020-12-29 Thread Jason Wang
On 2020/12/29 下午3:28, Eli Cohen wrote: @@ -43,6 +43,8 @@ struct vdpa_vq_state { * @index: device index * @features_valid: were features initialized? for legacy guests * @nvqs: the number of virtqueues + * @ngroups: the number of virtqueue groups + * @nas: the number of address spaces

Re: [PATCH 07/21] vdpa: multiple address spaces support

2020-12-29 Thread Jason Wang
On 2020/12/29 下午3:28, Eli Cohen wrote: @@ -43,6 +43,8 @@ struct vdpa_vq_state { * @index: device index * @features_valid: were features initialized? for legacy guests * @nvqs: the number of virtqueues + * @ngroups: the number of virtqueue groups + * @nas: the number of address spaces

Re: [PATCH v2] vhost/vsock: add IOTLB API support

2020-12-23 Thread Jason Wang
zi Signed-off-by: Stefano Garzarella Acked-by: Jason Wang --- The patch is the same of v1, but I re-tested it with: - QEMU v5.2.0-551-ga05f8ecd88 - Linux 5.9.15 (host) - Linux 5.9.15 and 5.10.0 (guest) Now, enabling 'ats' it works well, there are just a few simple changes.

Re: [PATCH] vdpa_sim: use iova module to allocate IOVA addresses

2020-12-22 Thread Jason Wang
Garzarella Few nits, but: Acked-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.h | 2 + drivers/vdpa/vdpa_sim/vdpa_sim.c | 108 +++ drivers/vdpa/Kconfig | 1 + 3 files changed, 69 insertions(+), 42 deletions(-) diff --git a/drivers/vdpa

Re: [PATCH RFC 00/12] vdpa: generalize vdpa simulator and add block device

2020-12-22 Thread Jason Wang
On 2020/12/22 下午8:29, Jason Wang wrote: On 2020/12/22 下午6:57, Stefano Garzarella wrote: On Tue, Dec 22, 2020 at 10:44:48AM +0800, Jason Wang wrote: On 2020/12/21 下午7:14, Stefano Garzarella wrote: On Mon, Dec 21, 2020 at 11:16:54AM +0800, Jason Wang wrote: On 2020/12/18 下午7:38, Stefano

Re: [PATCH RFC 00/12] vdpa: generalize vdpa simulator and add block device

2020-12-22 Thread Jason Wang
On 2020/12/22 下午6:57, Stefano Garzarella wrote: On Tue, Dec 22, 2020 at 10:44:48AM +0800, Jason Wang wrote: On 2020/12/21 下午7:14, Stefano Garzarella wrote: On Mon, Dec 21, 2020 at 11:16:54AM +0800, Jason Wang wrote: On 2020/12/18 下午7:38, Stefano Garzarella wrote: On Mon, Nov 16, 2020

Re: [PATCH RFC 00/12] vdpa: generalize vdpa simulator and add block device

2020-12-21 Thread Jason Wang
On 2020/12/21 下午7:14, Stefano Garzarella wrote: On Mon, Dec 21, 2020 at 11:16:54AM +0800, Jason Wang wrote: On 2020/12/18 下午7:38, Stefano Garzarella wrote: On Mon, Nov 16, 2020 at 11:37:48AM +0800, Jason Wang wrote: On 2020/11/13 下午9:47, Stefano Garzarella wrote: Thanks to Max

Re: [PATCH RFC 00/12] vdpa: generalize vdpa simulator and add block device

2020-12-20 Thread Jason Wang
On 2020/12/18 下午7:38, Stefano Garzarella wrote: On Mon, Nov 16, 2020 at 11:37:48AM +0800, Jason Wang wrote: On 2020/11/13 下午9:47, Stefano Garzarella wrote: Thanks to Max that started this work! I took his patches, and extended the block simulator a bit. This series moves the network device

Re: [PATCH -next] vdpa: Mark macaddr_buf with static keyword

2020-12-17 Thread Jason Wang
(macaddr, charp, 0); MODULE_PARM_DESC(macaddr, "Ethernet MAC address"); -u8 macaddr_buf[ETH_ALEN]; +static u8 macaddr_buf[ETH_ALEN]; static struct vdpasim *vdpasim_net_dev; Acked-by: Jason Wang

Re: [PATCH 00/21] Control VQ support in vDPA

2020-12-17 Thread Jason Wang
On 2020/12/18 上午6:28, Michael S. Tsirkin wrote: On Thu, Dec 17, 2020 at 05:02:49PM +0800, Jason Wang wrote: On 2020/12/17 下午3:58, Michael S. Tsirkin wrote: On Thu, Dec 17, 2020 at 11:30:18AM +0800, Jason Wang wrote: On 2020/12/16 下午5:47, Michael S. Tsirkin wrote: On Wed, Dec 16, 2020 at 02

Re: [PATCH 00/21] Control VQ support in vDPA

2020-12-17 Thread Jason Wang
On 2020/12/17 下午3:58, Michael S. Tsirkin wrote: On Thu, Dec 17, 2020 at 11:30:18AM +0800, Jason Wang wrote: On 2020/12/16 下午5:47, Michael S. Tsirkin wrote: On Wed, Dec 16, 2020 at 02:47:57PM +0800, Jason Wang wrote: Hi All: This series tries to add the support for control virtqueue in vDPA

Re: [PATCH v4 12/18] vdpa_sim: add get_config callback in vdpasim_dev_attr

2020-12-16 Thread Jason Wang
vdpasim_net_get_config() callback. This is safe since in vdpa_get_config() we already check that .set_features() callback is called before .get_config(). Signed-off-by: Stefano Garzarella Acked-by: Jason Wang --- v4: - explained in the commit message that the moving is safe [Jason] v3

Re: [PATCH v4 04/18] vdpa_sim: make IOTLB entries limit configurable

2020-12-16 Thread Jason Wang
On 2020/12/15 下午10:42, Stefano Garzarella wrote: Some devices may require a higher limit for the number of IOTLB entries, so let's make it configurable through a module parameter. By default, it's initialized with the current limit (2048). Suggested-by: Jason Wang Signed-off-by: Stefano

Re: [PATCH 00/21] Control VQ support in vDPA

2020-12-16 Thread Jason Wang
On 2020/12/16 下午5:47, Michael S. Tsirkin wrote: On Wed, Dec 16, 2020 at 02:47:57PM +0800, Jason Wang wrote: Hi All: This series tries to add the support for control virtqueue in vDPA. Control virtqueue is used by networking device for accepting various commands from the driver. It's a must

[PATCH 21/21] vdpasim: control virtqueue support

2020-12-15 Thread Jason Wang
for the driver to set mac address. Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 189 +++ 1 file changed, 166 insertions(+), 23 deletions(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index fe90a783bde4..0fd06ac491cd 100644

[PATCH 20/21] vdpa_sim: filter destination mac address

2020-12-15 Thread Jason Wang
This patch implements a simple unicast filter for vDPA simulator. Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 49 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim

[PATCH 19/21] vdpa_sim: factor out buffer completion logic

2020-12-15 Thread Jason Wang
Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 33 +--- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index 8d051cf25f0a..e901177c6dfe 100644 --- a/drivers/vdpa

[PATCH 18/21] vdpa_sim: advertise VIRTIO_NET_F_MTU

2020-12-15 Thread Jason Wang
We've already reported maximum mtu via config space, so let's advertise the feature. Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index

[PATCH 16/21] vhost-vdpa: support ASID based IOTLB API

2020-12-15 Thread Jason Wang
device with more than one address spaces that depends on platform IOMMU. This work will be done by moving the IOMMU logic from vhost-vDPA to vDPA device driver. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 127 -- drivers/vhost/vhost.c | 4 +- 2

[PATCH 17/21] vdpa_sim: split vdpasim_virtqueue's iov field in out_iov and in_iov

2020-12-15 Thread Jason Wang
with vringh_getdesc_iotlb(). We are using VIRTIO terminology for "out" (readable by the device) and "in" (writable by the device) descriptors. Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 11 ++- 1 file changed, 6 insertions(+),

[PATCH 15/21] vhost-vdpa: introduce uAPI to set group ASID

2020-12-15 Thread Jason Wang
Follows the vDPA support for associating ASID to a specific virtqueue group. This patch adds a uAPI to support setting them from userspace. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 8 include/uapi/linux/vhost.h | 7 +++ 2 files changed, 15 insertions(+) diff

[PATCH 14/21] vhost-vdpa: uAPI to get virtqueue group id

2020-12-15 Thread Jason Wang
Follows the support for virtqueue group in vDPA. This patches introduces uAPI to get the virtqueue group ID for a specific virtqueue in vhost-vdpa. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 8 include/uapi/linux/vhost.h | 8 2 files changed, 16 insertions

[PATCH 13/21] vhost-vdpa: introduce uAPI to get the number of address spaces

2020-12-15 Thread Jason Wang
This patch introduces the uAPI for getting the number of address spaces supported by this vDPA device. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 3 +++ include/uapi/linux/vhost.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c

[PATCH 12/21] vhost-vdpa: introduce uAPI to get the number of virtqueue groups

2020-12-15 Thread Jason Wang
Follows the vDPA support for multiple address spaces, this patch introduce uAPI for the userspace to know the number of virtqueue groups supported by the vDPA device. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 4 include/uapi/linux/vhost.h | 3 +++ 2 files changed, 7

[PATCH 11/21] vhost-vdpa: introduce asid based IOTLB

2020-12-15 Thread Jason Wang
This patch converts the vhost-vDPA device to support multiple IOTLBs tagged via ASID via hlist. This will be used for supporting multiple address spaces in the following patches. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 106 --- 1 file changed

[PATCH 10/21] vhost: support ASID in IOTLB API

2020-12-15 Thread Jason Wang
This patches allows userspace to send ASID based IOTLB message to vhost. This idea is to use the reserved u32 field in the existing V2 IOTLB message. Vhost device should advertise this capability via VHOST_BACKEND_F_IOTLB_ASID backend feature. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c

[PATCH 09/21] vhost_iotlb: split out IOTLB initialization

2020-12-15 Thread Jason Wang
This patch splits out IOTLB initialization to make sure it could be reused by external modules. Signed-off-by: Jason Wang --- drivers/vhost/iotlb.c | 23 ++- include/linux/vhost_iotlb.h | 2 ++ 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers

[PATCH 08/21] vdpa: introduce config operations for associating ASID to a virtqueue group

2020-12-15 Thread Jason Wang
This patch introduces a new bus operation to allow the vDPA bus driver to associate an ASID to a virtqueue group. Signed-off-by: Jason Wang --- include/linux/vdpa.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h index 0a9a754f8180

[PATCH 07/21] vdpa: multiple address spaces support

2020-12-15 Thread Jason Wang
and 1 address spaces for all vDPA devices. And vhost-vDPA will simply reject the device with more than 1 virtqueue groups or address spaces. Signed-off-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_main.c | 2 +- drivers/vdpa/mlx5/net/mlx5_vnet.c | 5 +++-- drivers/vdpa/vdpa.c | 4

[PATCH 06/21] vdpa: introduce virtqueue groups

2020-12-15 Thread Jason Wang
group ID for a specific virtqueue. All the vDPA device drivers were converted to simply support a single virtqueue group. Signed-off-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_main.c | 9 - drivers/vdpa/mlx5/net/mlx5_vnet.c | 8 +++- drivers/vdpa/vdpa.c | 4

[PATCH 04/21] vhost-vdpa: switch to use vhost-vdpa specific IOTLB

2020-12-15 Thread Jason Wang
To ease the implementation of per group ASID support for vDPA device. This patch switches to use a vhost-vdpa specific IOTLB to avoid the unnecessary refactoring of the vhost core. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 18 ++ 1 file changed, 10 insertions(+), 8

[PATCH 05/21] vdpa: add the missing comment for nvqs in struct vdpa_device

2020-12-15 Thread Jason Wang
Signed-off-by: Jason Wang --- include/linux/vdpa.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h index 30bc7a7223bb..8ab8dcde705d 100644 --- a/include/linux/vdpa.h +++ b/include/linux/vdpa.h @@ -42,6 +42,7 @@ struct vdpa_vq_state { * @config

[PATCH 03/21] vhost-vdpa: passing iotlb to IOMMU mapping helpers

2020-12-15 Thread Jason Wang
To prepare for the ASID support for vhost-vdpa, try to pass IOTLB object to dma helpers. No functional changes, it's just a preparation for support multiple IOTLBs. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 41 +++-- 1 file changed, 23 insertions

[PATCH 02/21] virtio-vdpa: don't set callback if virtio doesn't need it

2020-12-15 Thread Jason Wang
There's no need for setting callbacks for the driver that doesn't care about that. Signed-off-by: Jason Wang --- drivers/virtio/virtio_vdpa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c index 4a9ddb44b2a7

[PATCH 01/21] vhost: move the backend feature bits to vhost_types.h

2020-12-15 Thread Jason Wang
We should store feature bits in vhost_types.h as what has been done for e.g VHOST_F_LOG_ALL. Signed-off-by: Jason Wang --- include/uapi/linux/vhost.h | 5 - include/uapi/linux/vhost_types.h | 5 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/uapi/linux

[PATCH 00/21] Control VQ support in vDPA

2020-12-15 Thread Jason Wang
when using ASID with IOTLB batching requests - switch to use Stefano's patch for having separated iov - remove unused "used_as" variable - fix the iotlb/asid checking in vhost_vdpa_unmap() Thanks Jason Wang (20): vhost: move the backend feature bits to vhost_types.h virtio-vdpa:

Re: [PATCH v1] vdpa/mlx5: Use write memory barrier after updating CQ index

2020-12-10 Thread Jason Wang
index resulting in CQ overrun. Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Eli Cohen --- V0 -> V1 Use dma_wmb() instead of wmb() Acked-by: Jason Wang drivers/vdpa/mlx5/net/mlx5_vnet.c | 5 + 1 file changed, 5 insertions(+

Re: [PATCH v3 05/19] vdpa_sim: remove the limit of IOTLB entries

2020-12-09 Thread Jason Wang
On 2020/12/9 下午6:58, Stefano Garzarella wrote: On Mon, Dec 07, 2020 at 12:00:07PM +0800, Jason Wang wrote: On 2020/12/4 上午1:04, Stefano Garzarella wrote: The simulated devices can support multiple queues, so this limit should be defined according to the number of queues supported

Re: [PATCH v2 2/2] drivers: gpio: add virtio-gpio guest driver

2020-12-09 Thread Jason Wang
On 2020/12/8 下午3:02, Enrico Weigelt, metux IT consult wrote: On 08.12.20 03:36, Jason Wang wrote: Hi, So we endup with two solutions (without a prompt): 1) using select, user may end up with driver without transport IMHO not an entirely unusual situation in other places of the kernel, eg

Re: [PATCH v2 2/2] drivers: gpio: add virtio-gpio guest driver

2020-12-07 Thread Jason Wang
On 2020/12/7 下午5:33, Enrico Weigelt, metux IT consult wrote: On 07.12.20 04:48, Jason Wang wrote: Hi, Not a native speaker but event sounds like something driver read from device. Looking at the below lists, most of them except for VIRTIO_GPIO_EV_HOST_LEVEL looks more like a command. okay

Re: [PATCH v2 2/2] drivers: gpio: add virtio-gpio guest driver

2020-12-07 Thread Jason Wang
On 2020/12/7 下午9:53, Michael S. Tsirkin wrote: On Mon, Dec 07, 2020 at 11:12:50AM +0800, Jason Wang wrote: On 2020/12/6 上午3:32, Michael S. Tsirkin wrote: On Sat, Dec 05, 2020 at 08:59:55AM +0100, Enrico Weigelt, metux IT consult wrote: On 04.12.20 04:35, Jason Wang wrote: --- a/drivers

Re: [PATCH v3 19/19] vdpa: split vdpasim to core and net modules

2020-12-06 Thread Jason Wang
m/Makefile | 1 + 5 files changed, 292 insertions(+), 222 deletions(-) create mode 100644 drivers/vdpa/vdpa_sim/vdpa_sim.h create mode 100644 drivers/vdpa/vdpa_sim/vdpa_sim_net.c Acked-by: Jason Wang

Re: [PATCH v3 15/19] vdpa_sim: set vringh notify callback

2020-12-06 Thread Jason Wang
On 2020/12/4 上午1:05, Stefano Garzarella wrote: Instead of calling the vq callback directly, we can leverage the vringh_notify() function, adding vdpasim_vq_notify() and setting it in the vringh notify callback. Suggested-by: Jason Wang Signed-off-by: Stefano Garzarella Acked-by: Jason

Re: [PATCH v3 14/19] vdpa_sim: add set_config callback in vdpasim_dev_attr

2020-12-06 Thread Jason Wang
off-by: Stefano Garzarella Acked-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index f935ade0806b..03a8717f80ea 100644 --- a/drivers/v

Re: [PATCH v3 13/19] vdpa_sim: add get_config callback in vdpasim_dev_attr

2020-12-06 Thread Jason Wang
On 2020/12/4 上午1:05, Stefano Garzarella wrote: The get_config callback can be used by the device to fill the config structure. The callback will be invoked in vdpasim_get_config() before copying bytes into caller buffer. Move vDPA-net config updates from vdpasim_set_features() in the new

Re: [PATCH v3 12/19] vdpa_sim: make 'config' generic and usable for any device type

2020-12-06 Thread Jason Wang
(+), 4 deletions(-) Acked-by: Jason Wang diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index 949f4231d08a..fe71ed7890e1 100644 --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c @@ -62,6 +62,7 @@ struct vdpasim_virtqueue

Re: [PATCH] vhost scsi: fix error return code in vhost_scsi_set_endpoint()

2020-12-06 Thread Jason Wang
destroy_vq_cmds; } Acked-by: Jason Wang

Re: [PATCH v3 05/19] vdpa_sim: remove the limit of IOTLB entries

2020-12-06 Thread Jason Wang
On 2020/12/4 上午1:04, Stefano Garzarella wrote: The simulated devices can support multiple queues, so this limit should be defined according to the number of queues supported by the device. Since we are in a simulator, let's simply remove that limit. Suggested-by: Jason Wang Acked-by: Jason

Re: [PATCH v3 04/19] vhost/iotlb: add VHOST_IOTLB_UNLIMITED macro

2020-12-06 Thread Jason Wang
On 2020/12/4 上午1:04, Stefano Garzarella wrote: It's possible to allocate an unlimited IOTLB calling vhost_iotlb_alloc() with 'limit' = 0. Add a new macro (VHOST_IOTLB_UNLIMITED) for this case and document it in the vhost_iotlb_alloc() documentation block. Suggested-by: Jason Wang Signed-off

Re: [PATCH v2 2/2] drivers: gpio: add virtio-gpio guest driver

2020-12-06 Thread Jason Wang
On 2020/12/4 下午5:36, Enrico Weigelt, metux IT consult wrote: On 04.12.20 04:35, Jason Wang wrote: Hi, Is the plan to keep this doc synced with the one in the virtio specification? Yes, of course. I'm still in progress of doing the beaurocratic stuff w/ virtio-tc folks (ID registration

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

2020-12-06 Thread Jason Wang
On 2020/12/5 上午1:12, Randy Dunlap wrote: On 12/4/20 7:20 AM, Stefano Garzarella wrote: On Fri, Dec 04, 2020 at 12:03:53PM +0800, Jason Wang wrote: 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

Re: [PATCH v2 2/2] drivers: gpio: add virtio-gpio guest driver

2020-12-06 Thread Jason Wang
On 2020/12/6 上午4:05, Enrico Weigelt, metux IT consult wrote: On 05.12.20 20:32, Michael S. Tsirkin wrote: Hi, It seems a bit of a mess, at this point I'm not entirely sure when should drivers select VIRTIO and when depend on it. if VIRTIO just enables something that could be seen as

Re: [PATCH v2 2/2] drivers: gpio: add virtio-gpio guest driver

2020-12-06 Thread Jason Wang
On 2020/12/6 上午3:32, Michael S. Tsirkin wrote: On Sat, Dec 05, 2020 at 08:59:55AM +0100, Enrico Weigelt, metux IT consult wrote: On 04.12.20 04:35, Jason Wang wrote: --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -1615,6 +1615,15 @@ config GPIO_MOCKUP         tools/testing

Re: [PATCH] vdpa/mlx5: Use write memory barrier after updating CQ index

2020-12-06 Thread Jason Wang
mvq->event_cb.callback(mvq->event_cb.private); Acked-by: Jason Wang

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

2020-12-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 b/drivers/virtio

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

2020-12-03 Thread Jason Wang
-by: Jason Wang --- drivers/vdpa/Kconfig | 6 + drivers/vdpa/Makefile | 1 + drivers/vdpa/virtio_pci/Makefile | 2 + drivers/vdpa/virtio_pci/vp_vdpa.c | 455 ++ 4 files changed, 464 insertions(+) create mode 100644 drivers/vdpa/virtio_pci

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

2020-12-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 V2 17/19] vdpa: set the virtqueue num during register

2020-12-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. Signed-off-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_main.c | 5 ++--- drivers/vdpa/mlx5/net/mlx5_vnet.c | 5 ++--- drivers/vdpa

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

2020-12-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 V2 14/19] virtio-pci-modern: introduce helper to get notification offset

2020-12-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 b/drivers/virtio

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

2020-12-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 V2 13/19] virtio-pci-modern: introduce helper for getting queue nums

2020-12-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 V2 12/19] virtio-pci-modern: introduce helper for setting/geting queue size

2020-12-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 b/drivers

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

2020-12-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 b/drivers/virtio

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

2020-12-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 b/drivers/virtio

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

2020-12-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 b/drivers/virtio

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

2020-12-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 b/drivers/virtio

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

2020-12-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 b/drivers/virtio

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

2020-12-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 V2 04/19] virtio-pci-modern: introduce vp_modern_remove()

2020-12-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 b/drivers

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

2020-12-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 V2 02/19] virtio-pci: split out modern device

2020-12-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 V2 01/19] virtio-pci: do not access iomem via struct virtio_pci_device directly

2020-12-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 V2 00/19] vDPA driver for virtio-pci device

2020-12-03 Thread Jason Wang
log - split the patches furtherly to ease the reviewing Changes from V1: - Split common codes from virito-pci and share it with vDPA driver - Use dynamic id in order to be less confusing with virtio-pci driver - No feature whitelist, supporting any features (mq, config etc) Thanks Jason Wang (19

Re: [PATCH v2 2/2] drivers: gpio: add virtio-gpio guest driver

2020-12-03 Thread Jason Wang
On 2020/12/4 上午3:11, Enrico Weigelt, metux IT consult wrote: Introducing new gpio driver for virtual GPIO devices via virtio. The driver allows routing gpio control into VM guests, eg. brigding virtual gpios to specific host gpios, or attaching simulators for automatic application testing.

Re: [PATCH] vdpa/mlx5: Use random MAC for the vdpa net instance

2020-12-03 Thread Jason Wang
On 2020/12/3 下午8:24, Eli Cohen wrote: It is mentioned in Parav's patchset that this will be coming in a subsequent patch to his vdpa tool. So I think kernel has two options: - require a mac when device is created, we supply it to guest Yes, the driver should always set VIRTIO_NET_F_MAC and

Re: [PATCH] vdpa/mlx5: Use random MAC for the vdpa net instance

2020-12-02 Thread Jason Wang
On 2020/12/2 下午5:23, Michael S. Tsirkin wrote: On Wed, Dec 02, 2020 at 07:57:14AM +0200, Eli Cohen wrote: On Wed, Dec 02, 2020 at 12:18:36PM +0800, Jason Wang wrote: On 2020/12/1 下午5:23, Cindy Lu wrote: On Mon, Nov 30, 2020 at 11:33 PM Michael S. Tsirkin wrote: On Mon, Nov 30, 2020 at 06

Re: [PATCH] vdpa/mlx5: Use random MAC for the vdpa net instance

2020-12-02 Thread Jason Wang
On 2020/12/2 下午9:04, Michael S. Tsirkin wrote: On Wed, Dec 02, 2020 at 08:56:37PM +0800, Jason Wang wrote: On 2020/12/2 下午5:30, Michael S. Tsirkin wrote: On Wed, Dec 02, 2020 at 12:18:36PM +0800, Jason Wang wrote: On 2020/12/1 下午5:23, Cindy Lu wrote: On Mon, Nov 30, 2020 at 11:33 PM

Re: [PATCH] vdpa/mlx5: Use random MAC for the vdpa net instance

2020-12-02 Thread Jason Wang
On 2020/12/2 下午9:07, Michael S. Tsirkin wrote: Two questions here: 1. Now we don't have support for control virtqueue. Yet, we must filter packets based on MAC, what do you suggest to do here? How about an ioctl to pass the mac to the device? Maybe mirroring the control vq struct format ...

Re: [PATCH] vdpa/mlx5: Use random MAC for the vdpa net instance

2020-12-02 Thread Jason Wang
On 2020/12/2 下午8:17, Michael S. Tsirkin wrote: On Wed, Dec 02, 2020 at 02:12:41PM +0200, Eli Cohen wrote: On Wed, Dec 02, 2020 at 04:23:11AM -0500, Michael S. Tsirkin wrote: On Wed, Dec 02, 2020 at 07:57:14AM +0200, Eli Cohen wrote: On Wed, Dec 02, 2020 at 12:18:36PM +0800, Jason Wang wrote

Re: [PATCH] vdpa/mlx5: Use random MAC for the vdpa net instance

2020-12-02 Thread Jason Wang
On 2020/12/2 下午5:30, Michael S. Tsirkin wrote: On Wed, Dec 02, 2020 at 12:18:36PM +0800, Jason Wang wrote: On 2020/12/1 下午5:23, Cindy Lu wrote: On Mon, Nov 30, 2020 at 11:33 PM Michael S. Tsirkin wrote: On Mon, Nov 30, 2020 at 06:41:45PM +0800, Cindy Lu wrote: On Mon, Nov 30, 2020 at 5:33

Re: [PATCH] vdpa/mlx5: Use random MAC for the vdpa net instance

2020-12-01 Thread Jason Wang
On 2020/12/1 下午5:23, Cindy Lu wrote: On Mon, Nov 30, 2020 at 11:33 PM Michael S. Tsirkin wrote: On Mon, Nov 30, 2020 at 06:41:45PM +0800, Cindy Lu wrote: On Mon, Nov 30, 2020 at 5:33 PM Michael S. Tsirkin wrote: On Mon, Nov 30, 2020 at 11:27:59AM +0200, Eli Cohen wrote: On Mon, Nov 30,

Re: [PATCH v2 12/17] vdpa_sim: add get_config callback in vdpasim_dev_attr

2020-11-30 Thread Jason Wang
On 2020/11/30 下午10:14, Stefano Garzarella wrote: On Mon, Nov 30, 2020 at 11:25:31AM +0800, Jason Wang wrote: On 2020/11/26 下午10:49, Stefano Garzarella wrote: The get_config callback can be used by the device to fill the config structure. The callback will be invoked in vdpasim_get_config

Re: [PATCH v2 17/17] vdpa: split vdpasim to core and net modules

2020-11-29 Thread Jason Wang
On 2020/11/26 下午10:49, Stefano Garzarella wrote: From: Max Gurtovoy Introduce new vdpa_sim_net and vdpa_sim (core) drivers. This is a preparation for adding a vdpa simulator module for block devices. Signed-off-by: Max Gurtovoy [sgarzare: various cleanups/fixes] Signed-off-by: Stefano

Re: [PATCH v2 16/17] vdpa_sim: split vdpasim_virtqueue's iov field in out_iov and in_iov

2020-11-29 Thread Jason Wang
to use them with vringh_getdesc_iotlb(). We are using VIRTIO terminology for "out" (readable by the device) and "in" (writable by the device) descriptors. Signed-off-by: Stefano Garzarella --- v2: - used VIRTIO terminology [Stefan] --- Acked-by: Jason Wang d

Re: [PATCH v2 13/17] vdpa_sim: set vringh notify callback

2020-11-29 Thread Jason Wang
On 2020/11/26 下午10:49, Stefano Garzarella wrote: Instead of calling the vq callback directly, we can leverage the vringh_notify() function, adding vdpasim_vq_notify() and setting it in the vringh notify callback. Suggested-by: Jason Wang Signed-off-by: Stefano Garzarella --- drivers/vdpa

Re: [PATCH v2 12/17] vdpa_sim: add get_config callback in vdpasim_dev_attr

2020-11-29 Thread Jason Wang
On 2020/11/26 下午10:49, Stefano Garzarella wrote: The get_config callback can be used by the device to fill the config structure. The callback will be invoked in vdpasim_get_config() before copying bytes into caller buffer. Move vDPA-net config updates from vdpasim_set_features() in the new

Re: [PATCH v2 10/17] vdpa_sim: store parsed MAC address in a buffer

2020-11-29 Thread Jason Wang
/vdpa_sim.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) Acked-by: Jason Wang diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index b84d9acd130c..9f2ca3a77025 100644 --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c +++ b/drivers/vdpa/vdpa_sim

<    1   2   3   4   5   6   7   8   9   10   >