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 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 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

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

2020-07-19 Thread Jason Wang
On 2020/7/19 上午3:49, Eli Cohen wrote: On Fri, Jul 17, 2020 at 04:57:29PM +0800, Jason Wang wrote: Looks like checking intialized is enough. Will fix this. + +static void mlx5_vdpa_set_vq_ready(struct vdpa_device *vdev, u16 idx, bool ready) +{ + struct mlx5_vdpa_dev *mvdev = to_mvdev

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

2020-07-17 Thread Jason Wang
On 2020/7/16 下午7:54, Eli Cohen wrote: On Thu, Jul 16, 2020 at 05:14:32PM +0800, Jason Wang wrote: +static void suspend_vqs(struct mlx5_vdpa_net *ndev) +{ + int i; + + for (i = 0; i < MLX5_MAX_SUPPORTED_VQS; i++) + suspend_vq(ndev, >vqs[i]); In teardown_virt

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

2020-07-16 Thread Jason Wang
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 the available index value of a vq. Extend the struct to return status on the VQ to the caller. For now

Re: [PATCH vhost next 09/10] vdpa/mlx5: Add shared memory registration code

2020-07-16 Thread Jason Wang
On 2020/7/16 下午4:28, Eli Cohen wrote: On Thu, Jul 16, 2020 at 04:13:21PM +0800, Jason Wang wrote: On 2020/7/16 下午3:23, Eli Cohen wrote: Add code to support registering guest's memory region for the device. It would be better to use "userspace" memory here since vhost-vDPA cou

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

2020-07-16 Thread Jason Wang
On 2020/7/16 下午3:23, Eli Cohen wrote: Add a front end VDPA driver that registers in the VDPA bus and provides networking to a guest. The VDPA driver creates the necessary resources on the VF it is driving such that data path will be offloaded. Notifications are being communicated through the

Re: [PATCH vhost next 09/10] vdpa/mlx5: Add shared memory registration code

2020-07-16 Thread Jason Wang
On 2020/7/16 下午3:23, Eli Cohen wrote: Add code to support registering guest's memory region for the device. It would be better to use "userspace" memory here since vhost-vDPA could be used by e.g dpdk application on the host in the future. Thanks

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

2020-07-16 Thread Jason Wang
On 2020/7/16 下午3:23, Eli Cohen wrote: Currently, get_vq_state() is used only to pass the available index value of a vq. Extend the struct to return status on the VQ to the caller. For now, define VQ_STATE_NOT_READY. In the future it will be extended to include other infomration. Modify

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

2020-07-16 Thread Jason Wang
On 2020/7/16 下午3:23, 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 don't apply] vdpa_sim: endian-ness for config space

2020-07-16 Thread Jason Wang
On 2020/7/16 下午1:42, Michael S. Tsirkin wrote: On Wed, Jul 15, 2020 at 10:02:32PM +0800, Jason Wang wrote: On 2020/7/15 下午9:58, Michael S. Tsirkin wrote: VDPA sim stores config space as native endian, but that is wrong: modern guests expect LE. I coded up the following to fix it up

Re: [PATCH RFC don't apply] vdpa_sim: endian-ness for config space

2020-07-15 Thread Jason Wang
On 2020/7/15 下午9:58, Michael S. Tsirkin wrote: VDPA sim stores config space as native endian, but that is wrong: modern guests expect LE. I coded up the following to fix it up, but it is wrong too: vdpasim_create is called before guest features are known. So what should we do? New ioctl to

Re: [PATCH v7 2/2] s390: virtio: PV needs VIRTIO I/O device protection

2020-07-15 Thread Jason Wang
On 2020/7/15 下午5:50, Michael S. Tsirkin wrote: On Wed, Jul 15, 2020 at 10:31:09AM +0200, Pierre Morel wrote: If protected virtualization is active on s390, the virtio queues are not accessible to the host, unless VIRTIO_F_IOMMU_PLATFORM has been negotiated. Use the new

Re: [PATCH v7 0/2] s390: virtio: let arch validate VIRTIO features

2020-07-15 Thread Jason Wang
changed please can I get back your acked-by with these changes? Yes. Acked-by: Jason Wang Thanks 2) Rewording for warning messages Regards, Pierre Pierre Morel (2): virtio: let arch validate VIRTIO features s390: virtio: PV needs VIRTIO I/O device protection arch/s390/mm

Re: [PATCH] virtio_balloon: clear modern features under legacy

2020-07-12 Thread Jason Wang
-by: Jason Wang

Re: [PATCH] virtio_ring: sparse warning fixup

2020-07-12 Thread Jason Wang
); \ + mb(); \ + } \ +} while (0) \ struct virtio_device; struct virtqueue; Acked-by: Jason Wang

Re: [PATCH] vhost/scsi: fix up req type endian-ness

2020-07-12 Thread Jason Wang
virtio_scsi_ctrl_tmf_req); Acked-by: Jason Wang

Re: [PATCH] virtio_balloon: fix sparse warning

2020-07-12 Thread Jason Wang
_active, sizeof(vb->cmd_id_active)); err = virtqueue_add_outbuf(vq, , 1, >cmd_id_active, GFP_KERNEL); Acked-by: Jason Wang

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

2020-07-10 Thread Jason Wang
On 2020/7/10 下午1:39, Eugenio Perez Martin wrote: It is allocated 1 thread in lcore 1 (F_THREAD=1) which belongs to the same NUMA as testpmd. Actually, it is the testpmd master core, so it should be a good idea to move it to another lcore of the same NUMA node. Is this enough for pktgen to

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

2020-07-09 Thread Jason Wang
On 2020/7/10 上午1:37, Michael S. Tsirkin wrote: On Thu, Jul 09, 2020 at 06:46:13PM +0200, Eugenio Perez Martin wrote: On Wed, Jul 1, 2020 at 4:10 PM Jason Wang wrote: On 2020/7/1 下午9:04, Eugenio Perez Martin wrote: On Wed, Jul 1, 2020 at 2:40 PM Jason Wang wrote: On 2020/7/1 下午6:43

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

2020-07-09 Thread Jason Wang
On 2020/7/8 下午9:13, Kishon Vijay Abraham I wrote: Hi Jason, On 7/8/2020 4:52 PM, Jason Wang wrote: On 2020/7/7 下午10:45, Kishon Vijay Abraham I wrote: Hi Jason, On 7/7/2020 3:17 PM, Jason Wang wrote: On 2020/7/6 下午5:32, Kishon Vijay Abraham I wrote: Hi Jason, On 7/3/2020 12:46 PM, Jason

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

2020-07-08 Thread Jason Wang
On 2020/7/7 下午10:45, Kishon Vijay Abraham I wrote: Hi Jason, On 7/7/2020 3:17 PM, Jason Wang wrote: On 2020/7/6 下午5:32, Kishon Vijay Abraham I wrote: Hi Jason, On 7/3/2020 12:46 PM, Jason Wang wrote: On 2020/7/2 下午9:35, Kishon Vijay Abraham I wrote: Hi Jason, On 7/2/2020 3:40 PM, Jason

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

2020-07-07 Thread Jason Wang
On 2020/7/6 下午5:32, Kishon Vijay Abraham I wrote: Hi Jason, On 7/3/2020 12:46 PM, Jason Wang wrote: On 2020/7/2 下午9:35, Kishon Vijay Abraham I wrote: Hi Jason, On 7/2/2020 3:40 PM, Jason Wang wrote: On 2020/7/2 下午5:51, Michael S. Tsirkin wrote: On Thu, Jul 02, 2020 at 01:51:21PM +0530

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

2020-07-03 Thread Jason Wang
On 2020/7/2 下午9:35, Kishon Vijay Abraham I wrote: Hi Jason, On 7/2/2020 3:40 PM, Jason Wang wrote: On 2020/7/2 下午5:51, Michael S. Tsirkin wrote: On Thu, Jul 02, 2020 at 01:51:21PM +0530, Kishon Vijay Abraham I wrote: This series enhances Linux Vhost support to enable SoC-to-SoC

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

2020-07-02 Thread Jason Wang
On 2020/7/2 下午5:51, Michael S. Tsirkin wrote: On Thu, Jul 02, 2020 at 01:51:21PM +0530, Kishon Vijay Abraham I wrote: This series enhances Linux Vhost support to enable SoC-to-SoC communication over MMIO. This series enables rpmsg communication between two SoCs using both PCIe RC<->EP and

Re: [PATCH 2/2] virtio-mmio: Reject invalid IRQ 0 command line argument

2020-07-01 Thread Jason Wang
tform: Clarify that IRQ 0 is invalid") Signed-off-by: Bjorn Helgaas Cc: Michael S. Tsirkin Cc: Jason Wang Cc: virtualizat...@lists.linux-foundation.org --- drivers/virtio/virtio_mmio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_mmio.c

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

2020-07-01 Thread Jason Wang
On 2020/7/1 下午9:04, Eugenio Perez Martin wrote: On Wed, Jul 1, 2020 at 2:40 PM Jason Wang wrote: On 2020/7/1 下午6:43, Eugenio Perez Martin wrote: On Tue, Jun 23, 2020 at 6:15 PM Eugenio Perez Martin wrote: On Mon, Jun 22, 2020 at 6:29 PM Michael S. Tsirkin wrote: On Mon, Jun 22, 2020

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

2020-07-01 Thread Jason Wang
On 2020/7/1 下午6:43, Eugenio Perez Martin wrote: On Tue, Jun 23, 2020 at 6:15 PM Eugenio Perez Martin wrote: On Mon, Jun 22, 2020 at 6:29 PM Michael S. Tsirkin wrote: On Mon, Jun 22, 2020 at 06:11:21PM +0200, Eugenio Perez Martin wrote: On Mon, Jun 22, 2020 at 5:55 PM Michael S. Tsirkin

[PATCH 5/5] vdpasim: support batch updating

2020-07-01 Thread Jason Wang
. Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 40 +--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index c7334cc65bb2..a7a0962ed8a8 100644 --- a/drivers/vdpa

[PATCH 4/5] vhost-vdpa: support IOTLB batching hints

2020-07-01 Thread Jason Wang
require set_map(), no behavior changes. This capability is advertised via VHOST_BACKEND_F_IOTLB_BATCH capability. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 30 +++--- include/uapi/linux/vhost.h | 2 ++ include/uapi/linux/vhost_types.h | 11

[PATCH 3/5] vhost-vdpa: support get/set backend features

2020-07-01 Thread Jason Wang
This patch makes userspace can get and set backend features to vhost-vdpa. Signed-off-by: Cindy Lu Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index db4c9cb44c61

[PATCH 2/5] vhost: generialize backend features setting/getting

2020-07-01 Thread Jason Wang
Move the backend features setting/getting from net.c to vhost.c to be reused by vhost-vdpa. Signed-off-by: Jason Wang --- drivers/vhost/net.c | 18 ++ drivers/vhost/vhost.c | 15 +++ drivers/vhost/vhost.h | 2 ++ 3 files changed, 19 insertions(+), 16 deletions

[PATCH 1/5] vhost-vdpa: refine ioctl pre-processing

2020-07-01 Thread Jason Wang
Switch to use 'switch' to make the codes more easier to be extended. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index 77a0c9fb6cc3..db4c9cb44c61 100644 --- a/drivers

[PATCH 0/5]

2020-07-01 Thread Jason Wang
to get best performance. Note, this only impacts the devices that want its own DMA translation (less times of set_map() call). For other type of devices, there's no changes in the behaviour. Changes from RFCV1: - tweak the comments per Michael's request Jason Wang (5): vhost-vdpa: refi

Re: [PATCH] vhost: Fix documentation

2020-06-29 Thread Jason Wang
On 2020/6/30 下午1:29, Eli Cohen wrote: Fix documentation to match actual function prototypes "end" used instead of "last". Fix that. Signed-off-by: Eli Cohen --- Acked-by: Jason Wang Thanks drivers/vhost/iotlb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 dele

Re: [PATCH RFC 4/5] vhost-vdpa: support IOTLB batching hints

2020-06-29 Thread Jason Wang
On 2020/6/29 下午11:49, Michael S. Tsirkin wrote: On Mon, Jun 29, 2020 at 05:26:03PM +0800, Jason Wang wrote: On 2020/6/28 下午5:58, Michael S. Tsirkin wrote: On Thu, Jun 18, 2020 at 01:56:25PM +0800, Jason Wang wrote: This patches extend the vhost IOTLB API to accept batch updating hints form

Re: [PATCH RFC 4/5] vhost-vdpa: support IOTLB batching hints

2020-06-29 Thread Jason Wang
On 2020/6/28 下午5:58, Michael S. Tsirkin wrote: On Thu, Jun 18, 2020 at 01:56:25PM +0800, Jason Wang wrote: This patches extend the vhost IOTLB API to accept batch updating hints form userspace. When userspace wants update the device IOTLB in a batch, it may do: 1) Write vhost_iotlb_msg

Re: [PATCH v2 2/2] virtio: virtio_has_iommu_quirk -> virtio_has_dma_quirk

2020-06-28 Thread Jason Wang
k * @vdev: the device */ -static inline bool virtio_has_iommu_quirk(const struct virtio_device *vdev) +static inline bool virtio_has_dma_quirk(const struct virtio_device *vdev) { /* * Note the reverse polarity of the quirk feature (compared to most Acked-by: Jason Wang

Re: [PATCH] virtio: VIRTIO_F_IOMMU_PLATFORM -> VIRTIO_F_ACCESS_PLATFORM

2020-06-28 Thread Jason Wang
* other features), this is for compatibility with legacy systems. */ - return !virtio_has_feature(vdev, VIRTIO_F_IOMMU_PLATFORM); + return !virtio_has_feature(vdev, VIRTIO_F_ACCESS_PLATFORM); } static inline bool virtio_is_little_endian(struct virtio_device *vdev) Acked-by: Jason Wang

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

2020-06-23 Thread Jason Wang
On 2020/6/23 下午3:00, Eugenio Perez Martin wrote: On Tue, Jun 23, 2020 at 4:51 AM Jason Wang wrote: On 2020/6/23 上午12:00, Michael S. Tsirkin wrote: On Wed, Jun 17, 2020 at 11:19:26AM +0800, Jason Wang wrote: On 2020/6/11 下午7:34, Michael S. Tsirkin wrote: static void

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

2020-06-22 Thread Jason Wang
On 2020/6/23 上午12:00, Michael S. Tsirkin wrote: On Wed, Jun 17, 2020 at 11:19:26AM +0800, Jason Wang wrote: On 2020/6/11 下午7:34, Michael S. Tsirkin wrote: static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq) { kfree(vq->descs); @@ -394,6 +400,9 @@ static l

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

2020-06-22 Thread Jason Wang
On 2020/6/20 上午2:07, Eugenio Perez Martin wrote: On Mon, Jun 15, 2020 at 2:28 PM Eugenio Perez Martin wrote: On Thu, Jun 11, 2020 at 5:22 PM Konrad Rzeszutek Wilk wrote: On Thu, Jun 11, 2020 at 07:34:19AM -0400, Michael S. Tsirkin wrote: As testing shows no performance change, switch to

Re: [PATCH] virtio-mem: Fix build error due to improper use 'select'

2020-06-19 Thread Jason Wang
r provides access to virtio-mem paravirtualized memory devices, allowing to hotplug and hotunplug memory. Acked-by: Jason Wang

[PATCH RFC 5/5] vdpasim: support batch updating

2020-06-17 Thread Jason Wang
. Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 40 +--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index c7334cc65bb2..a7a0962ed8a8 100644 --- a/drivers/vdpa

[PATCH RFC 4/5] vhost-vdpa: support IOTLB batching hints

2020-06-17 Thread Jason Wang
require set_map(), no behavior changes. This capability is advertised via VHOST_BACKEND_F_IOTLB_BATCH capability. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 30 +++--- include/uapi/linux/vhost.h | 2 ++ include/uapi/linux/vhost_types.h | 7

[PATCH RFC 3/5] vhost-vdpa: support get/set backend features

2020-06-17 Thread Jason Wang
This patch makes userspace can get and set backend features to vhost-vdpa. Signed-off-by: Cindy Lu Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index db4c9cb44c61

[PATCH RFC 2/5] vhost: generialize backend features setting/getting

2020-06-17 Thread Jason Wang
Move the backend features setting/getting from net.c to vhost.c to be reused by vhost-vdpa. Signed-off-by: Jason Wang --- drivers/vhost/net.c | 18 ++ drivers/vhost/vhost.c | 15 +++ drivers/vhost/vhost.h | 2 ++ 3 files changed, 19 insertions(+), 16 deletions

[PATCH RFC 1/5] vhost-vdpa: refine ioctl pre-processing

2020-06-17 Thread Jason Wang
Switch to use 'switch' to make the codes more easier to be extended. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index 77a0c9fb6cc3..db4c9cb44c61 100644 --- a/drivers

[PATCH RFC 0/5] support batched IOTLB updating in vhost-vdpa

2020-06-17 Thread Jason Wang
to get best performance. Note, this only impact the devices that want its own DMA translation. For other type of device, no changes in behaviour. Please reivew. Jason Wang (5): vhost-vdpa: refine ioctl pre-processing vhost: generialize backend features setting/getting vhost-vdpa: sup

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

2020-06-16 Thread Jason Wang
In order to let userspace work correctly, get_iova_range() is a must for the device that has its own DMA translation logic. Signed-off-by: Jason Wang --- drivers/vdpa/vdpa.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c index de211ef3738c

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

2020-06-16 Thread Jason Wang
. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 27 +++ include/uapi/linux/vhost.h | 4 include/uapi/linux/vhost_types.h | 5 + 3 files changed, 36 insertions(+) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index 77a0c9fb6cc3

[PATCH 2/4] vdpa_sim: implement get_iova_range bus operation

2020-06-16 Thread Jason Wang
This patch implements get_iova_range method for vdpa_sim. Since vdpa_sim is a software device, simply advertise a [0ULL, ~0ULL] range. Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c

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

2020-06-16 Thread Jason Wang
is enabled, determine a valid guest address width Please review. Thanks Jason Wang (4): vdpa: introduce config op to get valid iova range vdpa_sim: implement get_iova_range bus operation vdpa: get_iova_range() is mandatory for device specific DMA translation vhost: vdpa: report iova

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

2020-06-16 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 | 14 ++ 1 file changed, 14 insertions(+) diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h index 239db794357c..b7633ed2500c 100644 --- a/include

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

2020-06-16 Thread Jason Wang
On 2020/6/11 下午7:34, Michael S. Tsirkin wrote: static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq) { kfree(vq->descs); @@ -394,6 +400,9 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) for (i = 0; i < dev->nvqs; ++i) { vq = dev->vqs[i];

Re: [PATCH v2 1/1] s390: virtio: let arch accept devices without IOMMU feature

2020-06-16 Thread Jason Wang
VIRTIO_F_IOMMU_PLATFORM. Signed-off-by: Pierre Morel Acked-by: Jason Wang --- arch/s390/mm/init.c | 6 ++ drivers/virtio/virtio.c | 9 + include/linux/virtio.h | 2 ++ 3 files changed, 17 insertions(+) diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c index 87b2d024e75a

Re: [PATCH] s390: protvirt: virtio: Refuse device without IOMMU

2020-06-14 Thread Jason Wang
On 2020/6/12 下午7:38, Pierre Morel wrote: On 2020-06-12 11:21, Pierre Morel wrote: On 2020-06-11 05:10, Jason Wang wrote: On 2020/6/10 下午9:11, Pierre Morel wrote: Protected Virtualisation protects the memory of the guest and do not allow a the host to access all of its memory. Let's

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

2020-06-14 Thread Jason Wang
On 2020/6/11 下午5:06, Michael S. Tsirkin wrote: On Thu, Jun 11, 2020 at 11:02:57AM +0800, Jason Wang wrote: On 2020/6/10 下午7:05, Michael S. Tsirkin wrote: +EXPORT_SYMBOL_GPL(vhost_get_vq_desc); /* Reverse the effect of vhost_get_vq_desc. Useful for error handling. */ void

Re: [PATCH] s390: protvirt: virtio: Refuse device without IOMMU

2020-06-10 Thread Jason Wang
On 2020/6/10 下午9:11, Pierre Morel wrote: Protected Virtualisation protects the memory of the guest and do not allow a the host to access all of its memory. Let's refuse a VIRTIO device which does not use IOMMU protected access. Signed-off-by: Pierre Morel ---

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

2020-06-10 Thread Jason Wang
On 2020/6/10 下午7:05, Michael S. Tsirkin wrote: +EXPORT_SYMBOL_GPL(vhost_get_vq_desc); /* Reverse the effect of vhost_get_vq_desc. Useful for error handling. */ void vhost_discard_vq_desc(struct vhost_virtqueue *vq, int n) { + unfetch_descs(vq); vq->last_avail_idx -= n;

Re: [PATCH V3] vdpa: introduce virtio pci driver

2020-06-10 Thread Jason Wang
On 2020/6/10 下午4:51, Michael S. Tsirkin wrote: On Wed, Jun 10, 2020 at 04:25:06PM +0800, Jason Wang wrote: + +#define VP_VDPA_FEATURES \ + ((1ULL << VIRTIO_F_ANY_LAYOUT)| \ This is presumably for transitional devices only. In fact looking at code it seems tha

Re: [PATCH V3] vdpa: introduce virtio pci driver

2020-06-10 Thread Jason Wang
On 2020/6/10 下午3:08, Michael S. Tsirkin wrote: On Wed, Jun 10, 2020 at 02:52:17PM +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 for developing new features for both software vDPA

[PATCH V3] vdpa: introduce virtio pci driver

2020-06-10 Thread Jason Wang
the driver is mainly for testing and development for vDPA features, it can only be bound via dynamic ids to make sure it's not conflict with the drivers like virtio-pci or IFCVF. Signed-off-by: Jason Wang --- Changes from V2: - rebase on vhost.git vhost branch --- drivers/vdpa/Kconfig

Re: [PATCH RESEND V2] vdpa: introduce virtio pci driver

2020-06-10 Thread Jason Wang
On 2020/6/10 下午2:21, Michael S. Tsirkin wrote: On Wed, Jun 10, 2020 at 02:16:26PM +0800, Jason Wang wrote: On 2020/6/10 下午2:07, Michael S. Tsirkin wrote: On Wed, Jun 10, 2020 at 01:49:51PM +0800, Jason Wang wrote: This patch introduce a vDPA driver for virtio-pci device. It bridges

Re: [PATCH RESEND V2] vdpa: introduce virtio pci driver

2020-06-10 Thread Jason Wang
On 2020/6/10 下午2:07, Michael S. Tsirkin wrote: On Wed, Jun 10, 2020 at 01:49:51PM +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 for developing new features for both software vDPA

[PATCH RESEND V2] vdpa: introduce virtio pci driver

2020-06-09 Thread Jason Wang
the driver is mainly for testing and development for vDPA features, it can only be bound via dynamic ids to make sure it's not conflict with the drivers like virtio-pci or IFCVF. Signed-off-by: Jason Wang --- Changes since V1: - use NULL id_table to allow dynamic ids only - squash the doorbell

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

2020-06-09 Thread Jason Wang
On 2020/6/10 下午12:47, Michael S. Tsirkin wrote: On Wed, Jun 10, 2020 at 11:59:20AM +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 for developing new features for both software vDPA

[PATCH V2] vdpa: introduce virtio pci driver

2020-06-09 Thread Jason Wang
the driver is mainly for testing and development for vDPA features, it can only be bound via dynamic ids to make sure it's not conflict with the drivers like virtio-pci or IFCVF. Signed-off-by: Jason Wang --- Changes since V1: - use NULL id_table to allow dynamic ids only - squash the doorbell

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

2020-06-09 Thread Jason Wang
On 2020/6/8 下午8:52, Michael S. Tsirkin wrote: As testing shows no performance change, switch to that now. Signed-off-by: Michael S. Tsirkin Signed-off-by: Eugenio Pérez Link: https://lore.kernel.org/r/20200401183118.8334-3-epere...@redhat.com Signed-off-by: Michael S. Tsirkin ---

Re: [PATCH] vhost/test: fix up after API change

2020-06-08 Thread Jason Wang
On 2020/6/9 下午1:53, Jason Wang wrote: On 2020/6/8 下午8:42, Michael S. Tsirkin wrote: Pass a flag to request kernel thread use. Fixes: 01fcb1cbc88e ("vhost: allow device that does not depend on vhost worker") Signed-off-by: Michael S. Tsirkin ---   drivers/vhost/test.c | 2 +

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-08 Thread Jason Wang
On 2020/6/8 下午9:29, Michael S. Tsirkin wrote: On Mon, Jun 08, 2020 at 06:07:36PM +0800, Jason Wang wrote: On 2020/6/8 下午5:54, Michael S. Tsirkin wrote: On Mon, Jun 08, 2020 at 05:46:52PM +0800, Jason Wang wrote: On 2020/6/8 下午5:45, Michael S. Tsirkin wrote: On Mon, Jun 08, 2020 at 05:43

Re: [PATCH] vhost/test: fix up after API change

2020-06-08 Thread Jason Wang
ta = n; Acked-by: Jason Wang Just to confirm, have you queued the doorbell mapping patches already? Or you expect I squash this into v2 of doorbell mapping series? Thanks

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-08 Thread Jason Wang
On 2020/6/8 下午5:54, Michael S. Tsirkin wrote: On Mon, Jun 08, 2020 at 05:46:52PM +0800, Jason Wang wrote: On 2020/6/8 下午5:45, Michael S. Tsirkin wrote: On Mon, Jun 08, 2020 at 05:43:58PM +0800, Jason Wang wrote: Looking at pci_match_one_device() it checks both subvendor and subdevice

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-08 Thread Jason Wang
On 2020/6/8 下午5:45, Michael S. Tsirkin wrote: On Mon, Jun 08, 2020 at 05:43:58PM +0800, Jason Wang wrote: Looking at pci_match_one_device() it checks both subvendor and subdevice there. Thanks But IIUC there is no guarantee that driver with a specific subvendor matches in presence

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-08 Thread Jason Wang
On 2020/6/8 下午5:31, Michael S. Tsirkin wrote: On Mon, Jun 08, 2020 at 05:18:44PM +0800, Jason Wang wrote: On 2020/6/8 下午2:32, Michael S. Tsirkin wrote: On Mon, Jun 08, 2020 at 11:32:31AM +0800, Jason Wang wrote: On 2020/6/7 下午9:51, Michael S. Tsirkin wrote: On Fri, Jun 05, 2020 at 04:54

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-08 Thread Jason Wang
On 2020/6/8 下午2:32, Michael S. Tsirkin wrote: On Mon, Jun 08, 2020 at 11:32:31AM +0800, Jason Wang wrote: On 2020/6/7 下午9:51, Michael S. Tsirkin wrote: On Fri, Jun 05, 2020 at 04:54:17PM +0800, Jason Wang wrote: On 2020/6/2 下午3:08, Jason Wang wrote: +static const struct pci_device_id

Re: [PATCH] virtio-mem: drop unnecessary initialization

2020-06-08 Thread Jason Wang
o_mem *vm) static int virtio_mem_probe(struct virtio_device *vdev) { struct virtio_mem *vm; - int rc = -EINVAL; + int rc; BUILD_BUG_ON(sizeof(struct virtio_mem_req) != 24); BUILD_BUG_ON(sizeof(struct virtio_mem_resp) != 10); Acked-by: Jason Wang

Re: [PATCH RFC v5 13/13] vhost: drop head based APIs

2020-06-07 Thread Jason Wang
On 2020/6/7 下午10:11, Michael S. Tsirkin wrote: Everyone's using buf APIs, no need for head based ones anymore. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/vhost.c | 36 drivers/vhost/vhost.h | 12 2 files changed, 8 insertions(+),

Re: [PATCH RFC 03/13] vhost: batching fetches

2020-06-07 Thread Jason Wang
On 2020/6/7 下午9:57, Michael S. Tsirkin wrote: On Fri, Jun 05, 2020 at 11:40:17AM +0800, Jason Wang wrote: On 2020/6/4 下午4:59, Michael S. Tsirkin wrote: On Wed, Jun 03, 2020 at 03:27:39PM +0800, Jason Wang wrote: On 2020/6/2 下午9:06, Michael S. Tsirkin wrote: With this patch applied, new

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-07 Thread Jason Wang
On 2020/6/7 下午9:51, Michael S. Tsirkin wrote: On Fri, Jun 05, 2020 at 04:54:17PM +0800, Jason Wang wrote: On 2020/6/2 下午3:08, Jason Wang wrote: +static const struct pci_device_id vp_vdpa_id_table[] = { +    { PCI_DEVICE(PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_ANY_ID) }, +    { 0 } +}; This looks

Re: [PATCH RFC] uaccess: user_access_begin_after_access_ok()

2020-06-05 Thread Jason Wang
On 2020/6/5 上午12:49, Michael S. Tsirkin wrote: 2. Second argument to translate_desc is a GPA, isn't it? No, it's IOVA, this function will be called only when IOTLB is enabled. Thanks Right IOVA. Point stands how does it make sense to cast a userspace pointer to an IOVA? I guess it's just

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-05 Thread Jason Wang
On 2020/6/2 下午3:08, Jason Wang wrote: +static const struct pci_device_id vp_vdpa_id_table[] = { +    { PCI_DEVICE(PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_ANY_ID) }, +    { 0 } +}; This looks like it'll create a mess with either virtio pci or vdpa being loaded at random. Maybe just don't specify

Re: [PATCH RFC 03/13] vhost: batching fetches

2020-06-04 Thread Jason Wang
On 2020/6/4 下午4:59, Michael S. Tsirkin wrote: On Wed, Jun 03, 2020 at 03:27:39PM +0800, Jason Wang wrote: On 2020/6/2 下午9:06, Michael S. Tsirkin wrote: With this patch applied, new and old code perform identically. Lots of extra optimizations are now possible, e.g. we can fetch multiple

Re: [PATCH RFC 07/13] vhost: format-independent API for used buffers

2020-06-04 Thread Jason Wang
On 2020/6/4 下午5:03, Michael S. Tsirkin wrote: static bool vhost_notify(struct vhost_dev *dev, struct vhost_virtqueue *vq) { __u16 old, new; diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index a67bda9792ec..6c10e99ff334 100644 --- a/drivers/vhost/vhost.h +++

Re: [PATCH RFC] uaccess: user_access_begin_after_access_ok()

2020-06-04 Thread Jason Wang
On 2020/6/4 上午12:52, Al Viro wrote: On Wed, Jun 03, 2020 at 01:29:00AM -0400, Michael S. Tsirkin wrote: On Wed, Jun 03, 2020 at 02:48:15AM +0100, Al Viro wrote: On Tue, Jun 02, 2020 at 04:45:05AM -0400, Michael S. Tsirkin wrote: So vhost needs to poke at userspace *a lot* in a quick

Re: [PATCH RFC 01/13] vhost: option to fetch descriptors through an independent struct

2020-06-03 Thread Jason Wang
On 2020/6/3 下午5:48, Michael S. Tsirkin wrote: On Wed, Jun 03, 2020 at 03:13:56PM +0800, Jason Wang wrote: On 2020/6/2 下午9:05, Michael S. Tsirkin wrote: [...] + +static int fetch_indirect_descs(struct vhost_virtqueue *vq, + struct vhost_desc *indirect

Re: [PATCH RFC 08/13] vhost/net: convert to new API: heads->bufs

2020-06-03 Thread Jason Wang
On 2020/6/2 下午9:06, Michael S. Tsirkin wrote: Convert vhost net to use the new format-agnostic API. In particular, don't poke at vq internals such as the heads array. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/net.c | 153 +++- 1 file

Re: [PATCH RFC 07/13] vhost: format-independent API for used buffers

2020-06-03 Thread Jason Wang
On 2020/6/2 下午9:06, Michael S. Tsirkin wrote: Add a new API that doesn't assume used ring, heads, etc. For now, we keep the old APIs around to make it easier to convert drivers. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/vhost.c | 52 ++-

Re: [PATCH RFC 04/13] vhost: cleanup fetch_buf return code handling

2020-06-03 Thread Jason Wang
On 2020/6/2 下午9:06, Michael S. Tsirkin wrote: Return code of fetch_buf is confusing, so callers resort to tricks to get to sane values. Let's switch to something standard: 0 empty, >0 non-empty, <0 error. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/vhost.c | 24

Re: [PATCH RFC 03/13] vhost: batching fetches

2020-06-03 Thread Jason Wang
On 2020/6/2 下午9:06, Michael S. Tsirkin wrote: With this patch applied, new and old code perform identically. Lots of extra optimizations are now possible, e.g. we can fetch multiple heads with copy_from/to_user now. We can get rid of maintaining the log array. Etc etc. Signed-off-by:

Re: [PATCH RFC 02/13] vhost: use batched version by default

2020-06-03 Thread Jason Wang
On 2020/6/2 下午9:05, Michael S. Tsirkin wrote: As testing shows no performance change, switch to that now. Signed-off-by: Michael S. Tsirkin Signed-off-by: Eugenio Pérez Link: https://lore.kernel.org/r/20200401183118.8334-3-epere...@redhat.com Signed-off-by: Michael S. Tsirkin ---

Re: [PATCH RFC 01/13] vhost: option to fetch descriptors through an independent struct

2020-06-03 Thread Jason Wang
On 2020/6/2 下午9:05, Michael S. Tsirkin wrote: The idea is to support multiple ring formats by converting to a format-independent array of descriptors. This costs extra cycles, but we gain in ability to fetch a batch of descriptors in one go, which is good for code cache locality. When used,

Re: [PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap

2020-06-03 Thread Jason Wang
On 2020/6/3 下午2:34, Michael S. Tsirkin wrote: On Wed, Jun 03, 2020 at 12:18:44PM +0800, Jason Wang wrote: On 2020/6/2 下午9:31, Michael S. Tsirkin wrote: On Tue, Jun 02, 2020 at 02:49:38PM +0800, Jason Wang wrote: On 2020/6/2 下午12:56, Michael S. Tsirkin wrote: On Tue, Jun 02, 2020 at 03:22

Re: [PATCH RFC] uaccess: user_access_begin_after_access_ok()

2020-06-03 Thread Jason Wang
On 2020/6/3 下午2:30, Michael S. Tsirkin wrote: On Wed, Jun 03, 2020 at 02:23:08PM +0800, Jason Wang wrote: BTW now I re-read it I don't understand __vhost_get_user_slow: static void __user *__vhost_get_user_slow(struct vhost_virtqueue *vq, void

Re: [PATCH RFC] uaccess: user_access_begin_after_access_ok()

2020-06-03 Thread Jason Wang
On 2020/6/3 下午1:46, Michael S. Tsirkin wrote: On Wed, Jun 03, 2020 at 01:18:54PM +0800, Jason Wang wrote: On 2020/6/3 下午12:18, Al Viro wrote: On Wed, Jun 03, 2020 at 11:57:11AM +0800, Jason Wang wrote: How widely do you hope to stretch the user_access areas, anyway? To have best

Re: [PATCH RFC] uaccess: user_access_begin_after_access_ok()

2020-06-02 Thread Jason Wang
On 2020/6/3 下午12:18, Al Viro wrote: On Wed, Jun 03, 2020 at 11:57:11AM +0800, Jason Wang wrote: How widely do you hope to stretch the user_access areas, anyway? To have best performance for small packets like 64B, if possible, we want to disable STAC not only for the metadata access done

<    3   4   5   6   7   8   9   10   11   12   >