Re: [RFC PATCH 00/22] Enhance VHOST to enable SoC-to-SoC communication

2020-09-17 Thread Jason Wang
On 2020/9/16 下午7:47, Kishon Vijay Abraham I wrote: Hi Jason, On 16/09/20 8:40 am, Jason Wang wrote: On 2020/9/15 下午11:47, Kishon Vijay Abraham I wrote: Hi Jason, On 15/09/20 1:48 pm, Jason Wang wrote: Hi Kishon: On 2020/9/14 下午3:23, Kishon Vijay Abraham I wrote: Then you need something

Re: [vhost next 0/2] mlx5 vdpa fix netdev status

2020-09-17 Thread Jason Wang
requirements. 2. Fix the failure to set the bit Eli Cohen (2): vdpa/mlx5: Make use of a specific 16 bit endianness API vdpa/mlx5: Fix failure to bring link up drivers/vdpa/mlx5/net/mlx5_vnet.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) Acked-by: Jason Wang

Re: [PATCH v2 -next] vdpa: mlx5: change Kconfig depends to fix build errors

2020-09-17 Thread Jason Wang
Dunlap Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: virtualization@lists.linux-foundation.org Cc: Saeed Mahameed Cc: Leon Romanovsky Cc: net...@vger.kernel.org --- v2: change from select to depends (Saeed) drivers/vdpa/Kconfig |2 +- 1 file changed, 1 insertion(+),

Re: [RFC PATCH 00/22] Enhance VHOST to enable SoC-to-SoC communication

2020-09-15 Thread Jason Wang
On 2020/9/15 下午11:47, Kishon Vijay Abraham I wrote: Hi Jason, On 15/09/20 1:48 pm, Jason Wang wrote: Hi Kishon: On 2020/9/14 下午3:23, Kishon Vijay Abraham I wrote: Then you need something that is functional equivalent to virtio PCI which is actually the concept of vDPA (e.g vDPA provides

Re: [RFC PATCH 00/22] Enhance VHOST to enable SoC-to-SoC communication

2020-09-15 Thread Jason Wang
Hi Kishon: On 2020/9/14 下午3:23, Kishon Vijay Abraham I wrote: Then you need something that is functional equivalent to virtio PCI which is actually the concept of vDPA (e.g vDPA provides alternatives if the queue_sel is hard in the EP implementation). Okay, I just tried to compare the 'struct

Re: [PATCH] vhost: reduce stack usage in log_used

2020-09-15 Thread Jason Wang
* Set to true when starting a modern virtio device. */ Acked-by: Jason Wang ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH] vhost_vdpa: Fix duplicate included kernel.h

2020-09-15 Thread Jason Wang
--- a/drivers/vhost/vdpa.c +++ b/drivers/vhost/vdpa.c @@ -22,7 +22,6 @@ #include #include #include -#include #include "vhost.h" Acked-by: Jason Wang ___ Virtualization mailing list Virtualization@lists.linux-foundation

Re: [PATCH v2] i2c: virtio: add a virtio i2c frontend driver

2020-09-13 Thread Jason Wang
On 2020/9/11 上午11:48, Jie Deng wrote: Add an I2C bus driver for virtio para-virtualization. The controller can be emulated by the backend driver in any device model software by following the virtio protocol. This driver communicates with the backend driver through a virtio I2C message

Re: [PATCH] vhost: reduce stack usage in log_used

2020-09-13 Thread Jason Wang
- Original Message - > Fix the warning: [-Werror=-Wframe-larger-than=] > > drivers/vhost/vhost.c: In function log_used: > drivers/vhost/vhost.c:1906:1: > warning: the frame size of 1040 bytes is larger than 1024 bytes > > Signed-off-by: Li Wang > --- > drivers/vhost/vhost.c | 14

Re: [PATCH] vhost-vdpa: fix memory leak in error path

2020-09-09 Thread Jason Wang
, >mm->pinned_vm); } mmap_read_unlock(dev->mm); + +free_page: free_page((unsigned long)page_list); return ret; } Cc: sta...@vger.kernel.org Acked-by: Jason Wang ___ Virtualization mailing list Virtualization@lists.l

Re: [PATCH] vhost_vdpa: remove unnecessary spin_lock in vhost_vring_call

2020-09-09 Thread Jason Wang
-by: Jason Wang --- drivers/vhost/vdpa.c | 8 +--- drivers/vhost/vhost.c | 3 --- drivers/vhost/vhost.h | 1 - 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index 3fab94f88894..bc679d0b7b87 100644 --- a/drivers/vhost/vdpa.c

Re: [PATCH] i2c: virtio: add a virtio i2c frontend driver

2020-09-09 Thread Jason Wang
On 2020/9/3 下午1:34, Jie Deng wrote: --- a/drivers/i2c/busses/Makefile +++ b/drivers/i2c/busses/Makefile @@ -6,6 +6,9 @@ # ACPI drivers obj-$(CONFIG_I2C_SCMI)+= i2c-scmi.o +# VIRTIO I2C host controller driver +obj-$(CONFIG_I2C_VIRTIO) += i2c-virtio.o + # PC SMBus

Re: [PATCH] i2c: virtio: add a virtio i2c frontend driver

2020-09-09 Thread Jason Wang
On 2020/9/8 上午9:40, Jie Deng wrote: On 2020/9/7 13:40, Jason Wang wrote: +struct virtio_i2c_msg { +    struct virtio_i2c_hdr hdr; +    char *buf; +    u8 status; Any reason for separating status out of virtio_i2c_hdr? The status is not from i2c_msg. You meant ic2_hdr? You

Re: [RFC PATCH 00/22] Enhance VHOST to enable SoC-to-SoC communication

2020-09-09 Thread Jason Wang
On 2020/9/9 上午12:37, Cornelia Huck wrote: Then you need something that is functional equivalent to virtio PCI which is actually the concept of vDPA (e.g vDPA provides alternatives if the queue_sel is hard in the EP implementation). It seems I really need to read up on vDPA more... do you have

Re: [PATCH] vhost: new vhost_vdpa SET/GET_BACKEND_FEATURES handlers

2020-09-08 Thread Jason Wang
- Original Message - > This commit introduced vhost_vdpa_set/get_backend_features() to > resolve these issues: > (1)In vhost_vdpa ioctl SET_BACKEND_FEATURES path, currect code > would try to acquire vhost dev mutex twice > (first shown in vhost_vdpa_unlocked_ioctl), which can lead > to

Re: [PATCH v2] vdpa/mlx5: Setup driver only if VIRTIO_CONFIG_S_DRIVER_OK

2020-09-08 Thread Jason Wang
- Original Message - > set_map() is used by mlx5 vdpa to create a memory region based on the > address map passed by the iotlb argument. If we get successive calls, we > will destroy the current memory region and build another one based on > the new address mapping. We also need to

Re: [PATCH] vdpa/mlx5: Setup driver only if VIRTIO_CONFIG_S_DRIVER_OK

2020-09-08 Thread Jason Wang
- Original Message - > On Mon, Sep 07, 2020 at 06:53:23AM -0400, Jason Wang wrote: > > > > > > - Original Message - > > > If the memory map changes before the driver status is > > > VIRTIO_CONFIG_S_DRIVER_OK, don't attempt to cre

Re: [PATCH] vdpa/mlx5: Setup driver only if VIRTIO_CONFIG_S_DRIVER_OK

2020-09-07 Thread Jason Wang
- Original Message - > If the memory map changes before the driver status is > VIRTIO_CONFIG_S_DRIVER_OK, don't attempt to create resources because it > may fail. For example, if the VQ is not ready there is no point in > creating resources. > > Fixes: 1a86b377aa21 ("vdpa/mlx5: Add

[PATCH] vhost-vdpa: fix backend feature ioctls

2020-09-07 Thread Jason Wang
held which will lead a deadlock This patch fixes the above issues. Cc: Eli Cohen Reported-by: Zhu Lingshan Fixes: 653055b9acd4 ("vhost-vdpa: support get/set backend features") Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 30 -- 1 file changed, 16 inserti

Re: [PATCH] i2c: virtio: add a virtio i2c frontend driver

2020-09-06 Thread Jason Wang
On 2020/9/4 下午9:21, Jie Deng wrote: On 2020/9/4 12:06, Jason Wang wrote: diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index 293e7a0..70c8e30 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig @@ -21,6 +21,17 @@ config I2C_ALI1535

Re: [PATCH] i2c: virtio: add a virtio i2c frontend driver

2020-09-03 Thread Jason Wang
On 2020/9/3 下午1:34, Jie Deng wrote: Add an I2C bus driver for virtio para-virtualization. The controller can be emulated by the backend driver in any device model software by following the virtio protocol. This driver communicates with the backend driver through a virtio I2C message structure

Re: [PATCH] i2c: virtio: add a virtio i2c frontend driver

2020-09-03 Thread Jason Wang
On 2020/9/3 下午3:19, Jie Deng wrote: On 2020/9/3 14:12, Jason Wang wrote: On 2020/9/3 下午1:34, Jie Deng wrote: Add an I2C bus driver for virtio para-virtualization. The controller can be emulated by the backend driver in any device model software by following the virtio protocol

Re: [PATCH] i2c: virtio: add a virtio i2c frontend driver

2020-09-03 Thread Jason Wang
On 2020/9/3 下午1:34, Jie Deng wrote: Add an I2C bus driver for virtio para-virtualization. The controller can be emulated by the backend driver in any device model software by following the virtio protocol. This driver communicates with the backend driver through a virtio I2C message structure

Re: [RFC PATCH 00/22] Enhance VHOST to enable SoC-to-SoC communication

2020-09-01 Thread Jason Wang
On 2020/9/1 下午1:24, Kishon Vijay Abraham I wrote: Hi, On 28/08/20 4:04 pm, Cornelia Huck wrote: On Thu, 9 Jul 2020 14:26:53 +0800 Jason Wang wrote: [Let me note right at the beginning that I first noted this while listening to Kishon's talk at LPC on Wednesday. I might be very confused

Re: [PATCH net-next] vhost: fix typo in error message

2020-08-31 Thread Jason Wang
{ r = vhost_update_used_flags(vq); if (r) - vq_err(vq, "Failed to enable notification at %p: %d\n", + vq_err(vq, "Failed to disable notification at %p: %d\n", >used->fl

Re: [PATCH V2 2/3] vhost: vdpa: report iova range

2020-08-31 Thread Jason Wang
On 2020/8/23 下午2:40, Eli Cohen wrote: +static void vhost_vdpa_set_iova_range(struct vhost_vdpa *v) +{ + struct vdpa_iova_range *range = >range; + struct iommu_domain_geometry geo; + struct vdpa_device *vdpa = v->vdpa; + const struct vdpa_config_ops *ops = vdpa->config; +

[PATCH V2 3/3] vdpa_sim: implement get_iova_range()

2020-08-21 Thread Jason Wang
Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index 62d640327145..89854e17c3c2 100644 --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c +++ b/drivers/vdpa

[PATCH V2 2/3] vhost: vdpa: report iova range

2020-08-21 Thread Jason Wang
DOMAIN_ATTR_GEOMETRY, otherwise [0, ULLONG_MAX] is assumed. For safety, this patch also rules out the map request which is not in the valid range. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 41 include/uapi/linux/vhost.h | 4 include/uapi/linux

[PATCH V2 0/3] vDPA: API for reporting IOVA range

2020-08-21 Thread Jason Wang
range in vhost-vDPA Thanks Jason Wang (3): vdpa: introduce config op to get valid iova range vhost: vdpa: report iova range vdpa_sim: implement get_iova_range() drivers/vdpa/vdpa_sim/vdpa_sim.c | 12 ++ drivers/vhost/vdpa.c | 41 include

[PATCH V2 1/3] vdpa: introduce config op to get valid iova range

2020-08-21 Thread Jason Wang
This patch introduce a config op to get valid iova range from the vDPA device. Signed-off-by: Jason Wang --- include/linux/vdpa.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h index eae0bfd87d91..30bc7a7223bb 100644

Re: [PATCH -next] vdpa: Remove duplicate include

2020-08-18 Thread Jason Wang
/drivers/vhost/vdpa.c @@ -22,7 +22,6 @@ #include #include #include -#include #include "vhost.h" Acked-by: Jason Wang ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.o

Re: [PATCH -next] vdpa/mlx5: Remove duplicate include

2020-08-18 Thread Jason Wang
100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -8,7 +8,6 @@ #include #include #include -#include #include "mlx5_vnet.h" #include "mlx5_vdpa_ifc.h" #include "mlx5_vdpa.h

Re: VDPA Debug/Statistics

2020-08-11 Thread Jason Wang
On 2020/8/11 下午7:58, Eli Cohen wrote: On Tue, Aug 11, 2020 at 11:26:20AM +, Eli Cohen wrote: Hi All Currently, the only statistics we get for a VDPA instance comes from the virtio_net device instance. Since VDPA involves hardware acceleration, there can be quite a lot of information

Re: vdpa: handling of VIRTIO_F_ACCESS_PLATFORM/VIRTIO_F_ORDER_PLATFORM

2020-08-11 Thread Jason Wang
On 2020/8/11 下午5:52, Michael S. Tsirkin wrote: Hi! I'd like to raise the question of whether we can drop the requirement of VIRTIO_F_ACCESS_PLATFORM from vdpa? As far as I can see, it is merely required for virtio vdpa - so should we not enforce it there? If we don't enforce it, virtio will

Re: [PATCH 1/4] vdpa: introduce config op to get valid iova range

2020-08-11 Thread Jason Wang
On 2020/8/11 下午4:29, Michael S. Tsirkin wrote: On Tue, Aug 11, 2020 at 10:53:09AM +0800, Jason Wang wrote: On 2020/8/10 下午8:05, Michael S. Tsirkin wrote: On Thu, Aug 06, 2020 at 03:43:54PM +0300, Eli Cohen wrote: On Thu, Aug 06, 2020 at 08:29:22AM -0400, Michael S. Tsirkin wrote: On Thu

[PATCH 1/2] MAINTAINERS: add a dedicated entry for vDPA

2020-08-10 Thread Jason Wang
vDPA is an independent subsystem, so use a dedicated entry for that. Signed-off-by: Jason Wang --- MAINTAINERS | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 4e2698cc7e23..314398f0e276 100644 --- a/MAINTAINERS +++ b/MAINTAINERS

[PATCH 2/2] vDPA: add Eli Cohen as mellanox vDPA driver supporter

2020-08-10 Thread Jason Wang
Cc: Eli Cohen Signed-off-by: Jason Wang --- MAINTAINERS | 6 ++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 314398f0e276..ed1851413fcc 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -18186,6 +18186,12 @@ S: Maintained F: drivers/vdpa/ F

Re: [PATCH] vdpa_sim: init iommu lock

2020-08-10 Thread Jason Wang
ccess to iommu iotlb") Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index df3224b138ee..604d9d25ca47 100644 --- a/dr

Re: [PATCH V5 1/6] vhost: introduce vhost_vring_call

2020-08-10 Thread Jason Wang
On 2020/8/10 下午9:37, Michael S. Tsirkin wrote: On Wed, Aug 05, 2020 at 10:16:16AM +0800, Jason Wang wrote: On 2020/8/4 下午5:21, Michael S. Tsirkin wrote:   +struct vhost_vring_call { +    struct eventfd_ctx *ctx; +    struct irq_bypass_producer producer; +    spinlock_t ctx_lock; It's

Re: [PATCH 1/4] vdpa: introduce config op to get valid iova range

2020-08-10 Thread Jason Wang
. Tsirkin wrote: On Wed, Jun 17, 2020 at 11:29:44AM +0800, Jason Wang wrote: This patch introduce a config op to get valid iova range from the vDPA device. Signed-off-by: Jason Wang --- include/linux/vdpa.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/include/linux/vdpa.h b

Re: [PATCH] vdpa/mlx5: Fix erroneous null pointer checks

2020-08-06 Thread Jason Wang
On 2020/8/7 上午11:37, Jason Wang wrote: On 2020/8/7 上午3:18, Alex Dewar wrote: In alloc_inout() in net/mlx5_vnet.c, there are a few places where memory is allocated to *in and *out, but only the values of in and out are null-checked (i.e. there is a missing dereference). Fix this. Addresses

Re: [PATCH][next] vdpa/mlx5: fix memory allocation failure checks

2020-08-06 Thread Jason Wang
;Null pointer dereference") Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Colin Ian King Acked-by: Jason Wang --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git

Re: [PATCH] vdpa/mlx5: Fix uninitialised variable in core/mr.c

2020-08-06 Thread Jason Wang
t;Uninitialized variables") Signed-off-by: Alex Dewar Acked-by: Jason Wang --- drivers/vdpa/mlx5/core/mr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/mlx5/core/mr.c b/drivers/vdpa/mlx5/core/mr.c index f5dec0274133..ef1c550f8266 100644 --- a/drivers

Re: [PATCH 1/2] vdpa: ifcvf: return err when fail to request config irq

2020-08-06 Thread Jason Wang
On 2020/7/23 下午5:12, Jason Wang wrote: We ignore the err of requesting config interrupt, fix this. Fixes: e7991f376a4d ("ifcvf: implement config interrupt in IFCVF") Cc: Zhu Lingshan Signed-off-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_main.c | 4 1 file changed, 4

Re: [PATCH] vdpa/mlx5: Fix erroneous null pointer checks

2020-08-06 Thread Jason Wang
INULL)") Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Alex Dewar Acked-by: Jason Wang --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/vdpa/mlx5/net/mlx5_vn

Re: [PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space

2020-08-06 Thread Jason Wang
On 2020/8/6 下午1:58, Michael S. Tsirkin wrote: On Thu, Aug 06, 2020 at 11:37:38AM +0800, Jason Wang wrote: On 2020/8/5 下午7:45, Michael S. Tsirkin wrote: #define virtio_cread(vdev, structname, member, ptr) \ do

Re: [PATCH 1/4] vdpa: introduce config op to get valid iova range

2020-08-06 Thread Jason Wang
On 2020/8/6 下午8:29, Michael S. Tsirkin wrote: On Thu, Aug 06, 2020 at 03:03:55PM +0300, Eli Cohen wrote: On Wed, Aug 05, 2020 at 08:51:56AM -0400, Michael S. Tsirkin wrote: On Wed, Jun 17, 2020 at 11:29:44AM +0800, Jason Wang wrote: This patch introduce a config op to get valid iova range

Re: [PATCH 1/4] vdpa: introduce config op to get valid iova range

2020-08-06 Thread Jason Wang
On 2020/8/6 下午8:10, Eli Cohen wrote: On Wed, Jun 17, 2020 at 06:29:44AM +0300, Jason Wang wrote: This patch introduce a config op to get valid iova range from the vDPA device. Signed-off-by: Jason Wang --- include/linux/vdpa.h | 14 ++ 1 file changed, 14 insertions(+) diff

Re: [PATCH v2 19/24] vdpa: make sure set_features in invoked for legacy

2020-08-06 Thread Jason Wang
On 2020/8/6 下午6:00, Michael S. Tsirkin wrote: On Thu, Aug 06, 2020 at 03:27:38PM +0800, Jason Wang wrote: On 2020/8/6 下午1:53, Michael S. Tsirkin wrote: On Thu, Aug 06, 2020 at 11:23:05AM +0800, Jason Wang wrote: On 2020/8/5 下午7:40, Michael S. Tsirkin wrote: On Wed, Aug 05, 2020 at 02:14

Re: [PATCH v2 19/24] vdpa: make sure set_features in invoked for legacy

2020-08-06 Thread Jason Wang
On 2020/8/6 下午1:53, Michael S. Tsirkin wrote: On Thu, Aug 06, 2020 at 11:23:05AM +0800, Jason Wang wrote: On 2020/8/5 下午7:40, Michael S. Tsirkin wrote: On Wed, Aug 05, 2020 at 02:14:07PM +0800, Jason Wang wrote: On 2020/8/4 上午5:00, Michael S. Tsirkin wrote: Some legacy guests just assume

Re: [PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space

2020-08-05 Thread Jason Wang
On 2020/8/5 下午7:45, Michael S. Tsirkin wrote: #define virtio_cread(vdev, structname, member, ptr) \ do {\ might_sleep(); \ /* Must

Re: [PATCH 4/4] vhost: vdpa: report iova range

2020-08-05 Thread Jason Wang
On 2020/8/5 下午8:58, Michael S. Tsirkin wrote: On Wed, Jun 17, 2020 at 11:29:47AM +0800, Jason Wang wrote: This patch introduces a new ioctl for vhost-vdpa device that can report the iova range by the device. For device that depends on platform IOMMU, we fetch the iova range via

Re: [PATCH 3/4] vdpa: get_iova_range() is mandatory for device specific DMA translation

2020-08-05 Thread Jason Wang
On 2020/8/5 下午8:55, Michael S. Tsirkin wrote: On Wed, Jun 17, 2020 at 11:29:46AM +0800, Jason Wang wrote: In order to let userspace work correctly, get_iova_range() is a must for the device that has its own DMA translation logic. I guess you mean for a device. However in absence of ths op, I

Re: [PATCH 1/4] vdpa: introduce config op to get valid iova range

2020-08-05 Thread Jason Wang
On 2020/8/5 下午8:51, Michael S. Tsirkin wrote: On Wed, Jun 17, 2020 at 11:29:44AM +0800, Jason Wang wrote: This patch introduce a config op to get valid iova range from the vDPA device. Signed-off-by: Jason Wang --- include/linux/vdpa.h | 14 ++ 1 file changed, 14 insertions

Re: [PATCH v2 19/24] vdpa: make sure set_features in invoked for legacy

2020-08-05 Thread Jason Wang
On 2020/8/5 下午7:40, Michael S. Tsirkin wrote: On Wed, Aug 05, 2020 at 02:14:07PM +0800, Jason Wang wrote: On 2020/8/4 上午5:00, Michael S. Tsirkin wrote: Some legacy guests just assume features are 0 after reset. We detect that config space is accessed before features are set and set features

Re: [PATCH v2 22/24] vdpa_sim: fix endian-ness of config space

2020-08-05 Thread Jason Wang
On 2020/8/5 下午8:06, Michael S. Tsirkin wrote: On Wed, Aug 05, 2020 at 02:21:07PM +0800, Jason Wang wrote: On 2020/8/4 上午5:00, Michael S. Tsirkin wrote: VDPA sim accesses config space as native endian - this is wrong since it's a modern device and actually uses LE. It only supports modern

Re: [PATCH V4 linux-next 00/12] VDPA support for Mellanox ConnectX devices

2020-08-05 Thread Jason Wang
Add support library for mlx5 VDPA implementation vdpa/mlx5: Add shared memory registration code vdpa/mlx5: Add VDPA driver for supported mlx5 devices Jason Wang (5): vhost-vdpa: refine ioctl pre-processing vhost: generialize backend features setting/getting vhost-vdpa: support get/

Re: [PATCH V4 linux-next 00/12] VDPA support for Mellanox ConnectX devices

2020-08-05 Thread Jason Wang
On 2020/8/5 上午12:20, Eli Cohen wrote: Hi Michael, please note that this series depends on mlx5 core device driver patches in mlx5-next branch in git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git. git pull git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git

Re: [PATCH V4 linux-next 08/12] vdpa: Modify get_vq_state() to return error code

2020-08-05 Thread Jason Wang
On 2020/8/5 上午12:20, Eli Cohen wrote: Modify get_vq_state() so it returns an error code. In case of hardware acceleration, the available index may be retrieved from the device, an operation that can possibly fail. Reviewed-by: Parav Pandit Signed-off-by: Eli Cohen Acked-by: Jason Wang

Re: [PATCH V4 linux-next 12/12] vdpa/mlx5: Add VDPA driver for supported mlx5 devices

2020-08-05 Thread Jason Wang
the driver. Currently, only VFs are supported. In subsequent patches we will have devlink support to control which VF is used for VDPA and which function is used for regular networking. Reviewed-by: Parav Pandit Signed-off-by: Eli Cohen --- Acked-by: Jason Wang

Re: [PATCH V5 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa

2020-08-05 Thread Jason Wang
On 2020/7/31 下午2:55, Zhu Lingshan wrote: +static void vhost_vdpa_setup_vq_irq(struct vhost_vdpa *v, u16 qid) +{ + struct vhost_virtqueue *vq = >vqs[qid]; + const struct vdpa_config_ops *ops = v->vdpa->config; + struct vdpa_device *vdpa = v->vdpa; + int ret, irq; + +

Re: [PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space

2020-08-05 Thread Jason Wang
On 2020/8/4 上午4:58, Michael S. Tsirkin wrote: Currently all config space fields are of the type __uXX. This confuses people and some drivers (notably vdpa) access them using CPU endian-ness - which only works well for legacy or LE platforms. Update virtio_cread/virtio_cwrite macros to allow

Re: [PATCH v2 22/24] vdpa_sim: fix endian-ness of config space

2020-08-05 Thread Jason Wang
On 2020/8/4 上午5:00, Michael S. Tsirkin wrote: VDPA sim accesses config space as native endian - this is wrong since it's a modern device and actually uses LE. It only supports modern guests so we could punt and just force LE, but let's use the full virtio APIs since people tend to copy/paste

Re: [PATCH v2 19/24] vdpa: make sure set_features in invoked for legacy

2020-08-05 Thread Jason Wang
On 2020/8/4 上午5:00, Michael S. Tsirkin wrote: Some legacy guests just assume features are 0 after reset. We detect that config space is accessed before features are set and set features to 0 automatically. Note: some legacy guests might not even access config space, if this is reported in the

Re: [PATCH V5 1/6] vhost: introduce vhost_vring_call

2020-08-04 Thread Jason Wang
On 2020/8/5 下午1:49, Zhu, Lingshan wrote: On 8/5/2020 10:16 AM, Jason Wang wrote: On 2020/8/4 下午5:21, Michael S. Tsirkin wrote:    +struct vhost_vring_call { +    struct eventfd_ctx *ctx; +    struct irq_bypass_producer producer; +    spinlock_t ctx_lock; It's not clear to me why we need

Re: [PATCH V5 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa

2020-08-04 Thread Jason Wang
On 2020/8/5 下午1:45, Zhu, Lingshan wrote: On 8/5/2020 10:36 AM, Jason Wang wrote: On 2020/8/4 下午5:31, Zhu, Lingshan wrote: On 8/4/2020 4:51 PM, Jason Wang wrote: On 2020/7/31 下午2:55, Zhu Lingshan wrote: This patch introduce a set of functions for setup/unsetup and update irq offloading

Re: [PATCH V5 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa

2020-08-04 Thread Jason Wang
On 2020/8/4 下午5:31, Zhu, Lingshan wrote: On 8/4/2020 4:51 PM, Jason Wang wrote: On 2020/7/31 下午2:55, Zhu Lingshan wrote: This patch introduce a set of functions for setup/unsetup and update irq offloading respectively by register/unregister and re-register the irq_bypass_producer

Re: [PATCH V5 1/6] vhost: introduce vhost_vring_call

2020-08-04 Thread Jason Wang
On 2020/8/4 下午5:21, Zhu, Lingshan wrote: Hi Jason, we use this lock to protect the eventfd_ctx and irq from race conditions, We don't support irq notification from vDPA device driver in this version, do we still have race condition? as we discussed before: (1)if vendor change IRQ after

Re: [PATCH V5 1/6] vhost: introduce vhost_vring_call

2020-08-04 Thread Jason Wang
On 2020/8/4 下午5:21, Michael S. Tsirkin wrote:   +struct vhost_vring_call { +    struct eventfd_ctx *ctx; +    struct irq_bypass_producer producer; +    spinlock_t ctx_lock; It's not clear to me why we need ctx_lock here. Thanks Hi Jason, we use this lock to protect the eventfd_ctx and irq

Re: [PATCH V5 1/6] vhost: introduce vhost_vring_call

2020-08-04 Thread Jason Wang
On 2020/8/4 下午4:42, Zhu, Lingshan wrote: On 8/4/2020 4:38 PM, Jason Wang wrote: On 2020/7/31 下午2:55, Zhu Lingshan wrote: This commit introduces struct vhost_vring_call which replaced raw struct eventfd_ctx *call_ctx in struct vhost_virtqueue. Besides eventfd_ctx, it contains a spin lock

Re: [PATCH V5 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa

2020-08-04 Thread Jason Wang
/!DRIVER_OK, and update irq offloading through SET_VRING_CALL. Signed-off-by: Zhu Lingshan Suggested-by: Jason Wang --- drivers/vhost/Kconfig | 1 + drivers/vhost/vdpa.c | 79 ++- 2 files changed, 79 insertions(+), 1 deletion(-) diff --git a/drivers

Re: [PATCH V5 1/6] vhost: introduce vhost_vring_call

2020-08-04 Thread Jason Wang
-by: Jason Wang --- drivers/vhost/vdpa.c | 4 ++-- drivers/vhost/vhost.c | 22 -- drivers/vhost/vhost.h | 9 - 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index a54b60d6623f..df3cf386b0cd 100644

Re: [PATCH -next v3] virtio_ring: Avoid loop when vq is broken in virtqueue_poll

2020-08-03 Thread Jason Wang
ll_packed(_vq, last_used_idx) : virtqueue_poll_split(_vq, last_used_idx); Acked-by: Jason Wang ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH] virtio_pci_modern: Fix the comment of virtio_pci_find_capability()

2020-08-03 Thread Jason Wang
y: Yi Wang Acked-by: Jason Wang --- drivers/virtio/virtio_pci_modern.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c index db93cedd262f..9bdc6f68221f 100644 --- a/drivers/virtio/virtio_pci_modern.c +++ b/driv

[PATCH] vdpasim: protect concurrent access to iommu iotlb

2020-07-31 Thread Jason Wang
pasim: vDPA device simulator") Cc: sta...@vger.kernel.org Signed-off-by: Max Gurtovoy Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 31 +++ 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/dr

Re: [PATCH V4 0/6] IRQ offloading for vDPA

2020-07-30 Thread Jason Wang
On 2020/7/28 下午12:23, Zhu Lingshan wrote: This series intends to implement IRQ offloading for vhost_vdpa. By the feat of irq forwarding facilities like posted interrupt on X86, irq bypass can help deliver interrupts to vCPU directly. vDPA devices have dedicated hardware backends like VFIO

Re: [PATCH V4 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa

2020-07-30 Thread Jason Wang
On 2020/7/29 下午10:15, Eli Cohen wrote: OK, we have a mode of operation that does not require driver intervention to manipulate the event queues so I think we're ok with this design. Good to know this. Thanks ___ Virtualization mailing list

Re: [PATCH] virtio-blk: fix discard buffer overrun

2020-07-30 Thread Jason Wang
On 2020/7/30 下午4:30, Jeffle Xu wrote: Before commit eded341c085b ("block: don't decrement nr_phys_segments for physically contigous segments") applied, the generic block layer may not guarantee that @req->nr_phys_segments equals the number of bios in the request. When

Re: [PATCH V4 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa

2020-07-29 Thread Jason Wang
On 2020/7/29 下午5:55, Eli Cohen wrote: On Wed, Jul 29, 2020 at 05:21:53PM +0800, Jason Wang wrote: On 2020/7/28 下午5:04, Eli Cohen wrote: On Tue, Jul 28, 2020 at 12:24:03PM +0800, Zhu Lingshan wrote: +static void vhost_vdpa_setup_vq_irq(struct vhost_vdpa *v, int qid) +{ + struct

Re: [PATCH] virtio_balloon: fix up endian-ness for free cmd id

2020-07-29 Thread Jason Wang
o_has_feature(vb->vdev, VIRTIO_F_VERSION_1)) + vb->cmd_id_received_cache = le32_to_cpu((__force __le32)vb->cmd_id_received_cache); + } return vb->cmd_id_received_cache; } Acked-by: Jason Wang _

Re: [PATCH V4 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa

2020-07-29 Thread Jason Wang
On 2020/7/28 下午5:04, Eli Cohen wrote: On Tue, Jul 28, 2020 at 12:24:03PM +0800, Zhu Lingshan wrote: +static void vhost_vdpa_setup_vq_irq(struct vhost_vdpa *v, int qid) +{ + struct vhost_virtqueue *vq = >vqs[qid]; + const struct vdpa_config_ops *ops = v->vdpa->config; +

Re: [PATCH V4 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa

2020-07-28 Thread Jason Wang
On 2020/7/28 下午5:18, Zhu, Lingshan wrote:    * status to 0. @@ -167,6 +220,15 @@ static long vhost_vdpa_set_status(struct vhost_vdpa *v, u8 __user *statusp)   if (status != 0 && (ops->get_status(vdpa) & ~status) != 0)   return -EINVAL;   +    /* vq irq is not expected to be

Re: [PATCH V4 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa

2020-07-28 Thread Jason Wang
DRIVER_OK/!DRIVER_OK, and update irq offloading through SET_VRING_CALL. Signed-off-by: Zhu Lingshan Suggested-by: Jason Wang --- drivers/vhost/Kconfig | 1 + drivers/vhost/vdpa.c | 79 ++- 2 files changed, 79 insertions(+), 1 deletion(-) diff --git a/drivers

Re: [PATCH V4 3/6] vDPA: add get_vq_irq() in vdpa_config_ops

2020-07-28 Thread Jason Wang
On 2020/7/28 下午12:24, Zhu Lingshan wrote: This commit adds a new function get_vq_irq() in struct vdpa_config_ops, which will return the irq number of a virtqueue. Signed-off-by: Zhu Lingshan Suggested-by: Jason Wang --- include/linux/vdpa.h | 6 ++ 1 file changed, 6 insertions

Re: [PATCH V3 vhost next 00/10] VDPA support for Mellanox ConnectX devices

2020-07-28 Thread Jason Wang
On 2020/7/28 下午2:40, Jason Wang wrote: On 2020/7/28 下午2:32, Eli Cohen wrote: On Tue, Jul 28, 2020 at 02:18:16PM +0800, Jason Wang wrote: On 2020/7/28 下午2:05, Eli Cohen wrote: Hi Michael, please note that this series depends on mlx5 core device driver patches in mlx5-next branch in git

Re: [PATCH V3 vhost next 00/10] VDPA support for Mellanox ConnectX devices

2020-07-28 Thread Jason Wang
On 2020/7/28 下午2:32, Eli Cohen wrote: On Tue, Jul 28, 2020 at 02:18:16PM +0800, Jason Wang wrote: On 2020/7/28 下午2:05, Eli Cohen wrote: Hi Michael, please note that this series depends on mlx5 core device driver patches in mlx5-next branch in git://git.kernel.org/pub/scm/linux/kernel/git

Re: [PATCH V3 vhost next 00/10] VDPA support for Mellanox ConnectX devices

2020-07-28 Thread Jason Wang
ror code vdpa/mlx5: Add hardware descriptive header file vdpa/mlx5: Add support library for mlx5 VDPA implementation vdpa/mlx5: Add shared memory registration code vdpa/mlx5: Add VDPA driver for supported mlx5 devices Jason Wang (2): vhost-vdpa: support batch updating vdpa_sim:

[PATCH 1/2] vdpa: ifcvf: return err when fail to request config irq

2020-07-23 Thread Jason Wang
We ignore the err of requesting config interrupt, fix this. Fixes: e7991f376a4d ("ifcvf: implement config interrupt in IFCVF") Cc: Zhu Lingshan Signed-off-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_main.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/vdpa/ifcvf/if

[PATCH 2/2] vdpa: ifcvf: free config irq in ifcvf_free_irq()

2020-07-23 Thread Jason Wang
IFCVF") Cc: Zhu Lingshan Signed-off-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_base.h | 2 +- drivers/vdpa/ifcvf/ifcvf_main.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/vdpa/ifcvf/ifcvf_base.h b/drivers/vdpa/ifcvf/ifcvf_base.h index f4554412e607..29

Re: [PATCH V3 3/6] vDPA: implement vq IRQ allocate/free helpers in vDPA core

2020-07-22 Thread Jason Wang
On 2020/7/22 下午6:08, Zhu Lingshan wrote: +/* + * Request irq for a vq, setup irq offloading if its a vhost_vdpa vq. + * This function should be only called through setting virtio DRIVER_OK. + * If you want to request irq during probe, you should use raw APIs + * like request_irq() or

Re: [PATCH V2 vhost next 10/10] vdpa/mlx5: Add VDPA driver for supported mlx5 devices

2020-07-20 Thread Jason Wang
n 8. Avoid call put_device() since this is not a pci device driver. Looks good to me. Acked-by: Jason Wang ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH V2 vhost next 06/10] vdpa: Modify get_vq_state() to return error code

2020-07-20 Thread Jason Wang
On 2020/7/20 下午3:14, Eli Cohen wrote: Modify get_vq_state() so it returns an error code. In case of hardware acceleration, the available index may be retrieved from the device, an operation that can possibly fail. Reviewed-by: Parav Pandit Signed-off-by: Eli Cohen Acked-by: Jason Wang

Re: [PATCH V2 vhost next 05/10] vhost: Fix documentation

2020-07-20 Thread Jason Wang
On 2020/7/20 下午3:14, Eli Cohen wrote: Fix documentation to match actual function prototypes. Reviewed-by: Parav Pandit Signed-off-by: Eli Cohen Acked-by: Jason Wang --- drivers/vhost/iotlb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/vhost

Re: [PATCH RFC v8 02/11] vhost: use batched get_vq_desc version

2020-07-20 Thread Jason Wang
On 2020/7/20 下午7:16, Eugenio Pérez wrote: On Mon, Jul 20, 2020 at 11:27 AM Michael S. Tsirkin wrote: On Thu, Jul 16, 2020 at 07:16:27PM +0200, Eugenio Perez Martin wrote: On Fri, Jul 10, 2020 at 7:58 AM Michael S. Tsirkin wrote: On Fri, Jul 10, 2020 at 07:39:26AM +0200, Eugenio Perez

Re: [PATCH V2 3/6] vDPA: implement IRQ offloading helpers in vDPA core

2020-07-20 Thread Jason Wang
On 2020/7/21 上午10:02, Zhu, Lingshan wrote: On 7/20/2020 5:40 PM, Jason Wang wrote: On 2020/7/20 下午5:07, Zhu, Lingshan wrote: +} + +static void vdpa_unsetup_irq(struct vdpa_device *vdev, int qid) +{ +    struct vdpa_driver *drv = drv_to_vdpa(vdev->dev.driver); + +    if (

Re: [PATCH V2 3/6] vDPA: implement IRQ offloading helpers in vDPA core

2020-07-20 Thread Jason Wang
On 2020/7/20 下午5:07, Zhu, Lingshan wrote: +} + +static void vdpa_unsetup_irq(struct vdpa_device *vdev, int qid) +{ +    struct vdpa_driver *drv = drv_to_vdpa(vdev->dev.driver); + +    if (drv->unsetup_vq_irq) +    drv->unsetup_vq_irq(vdev, qid); Do you need to check the existence of drv

Re: [PATCH RFC v8 02/11] vhost: use batched get_vq_desc version

2020-07-20 Thread Jason Wang
On 2020/7/17 上午1:16, Eugenio Perez Martin wrote: On Fri, Jul 10, 2020 at 7:58 AM Michael S. Tsirkin wrote: On Fri, Jul 10, 2020 at 07:39:26AM +0200, Eugenio Perez Martin wrote: How about playing with the batch size? Make it a mod parameter instead of the hard coded 64, and measure for all

[PATCH] vhost: vdpa: remove per device feature whitelist

2020-07-20 Thread Jason Wang
to emulate a software control virtqueue. - we don't do it in virtio-vDPA driver So remove this limitation. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 37 - 1 file changed, 37 deletions(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index

Re: [PATCH V2 2/6] kvm: detect assigned device via irqbypass manager

2020-07-19 Thread Jason Wang
device counters via irqbypass manager. We will increase/decrease the assigned device counter in kvm/x86. Both vDPA and VFIO would go through this code path. This code path only affect x86 for now. Signed-off-by: Zhu Lingshan Suggested-by: Jason Wang --- arch/x86/kvm/x86.c | 10 -- 1 file

Re: [PATCH vhost next 06/10] vdpa: Add means to communicate vq status on get_vq_state

2020-07-19 Thread Jason Wang
On 2020/7/16 下午6:25, Eli Cohen wrote: On Thu, Jul 16, 2020 at 05:35:18PM +0800, Jason Wang wrote: On 2020/7/16 下午4:21, Eli Cohen wrote: On Thu, Jul 16, 2020 at 04:11:00PM +0800, Jason Wang wrote: On 2020/7/16 下午3:23, Eli Cohen wrote: Currently, get_vq_state() is used only to pass

  1   2   3   4   5   6   7   8   9   10   >