Re: [PATCH v3 01/10] vdpa: Provide interface to read driver features

2021-12-20 Thread Jason Wang
r_features to return the negotiated features and > add implementation to all the upstream drivers. > > Signed-off-by: Eli Cohen Acked-by: Jason Wang > --- > drivers/vdpa/alibaba/eni_vdpa.c| 16 > drivers/vdpa/ifcvf/ifcvf_main.c

Re: [PATCH v3 02/10] vdpa/mlx5: Distribute RX virtqueues in RQT object

2021-12-20 Thread Jason Wang
> than the number of rx virtqueues. Distribute them in the available > entries such that some virtqueus may be referenced twice. > > This allows to configure any number of virtqueue pairs when multiqueue > is used. > > Reviewed-by: Si-Wei Liu > Signed-off-by: Eli Cohen >

Re: [PATCH v3 03/10] vdpa: Read device configuration only if FEATURES_OK

2021-12-20 Thread Jason Wang
On Sun, Dec 19, 2021 at 10:03 PM Eli Cohen wrote: > > Avoid reading device configuration during feature negotiation. Read > device status and verify that VIRTIO_CONFIG_S_FEATURES_OK is set. > Otherwise, return -EAGAIN. > > Signed-off-by: Eli Cohen > --- > drivers/vdpa/vdpa.c | 7 +++ > 1 fil

Re: [PATCH v3 04/10] vdpa: Allow to configure max data virtqueues

2021-12-20 Thread Jason Wang
On Sun, Dec 19, 2021 at 10:03 PM Eli Cohen wrote: > > Add netlink support to configure the max virtqueue pairs for a device. > At least one pair is required. The maximum is dictated by the device. > > Signed-off-by: Eli Cohen Acked-by: Jason Wang > > --- > V2

Re: [PATCH v3 07/10] vdpa: Add support for returning device configuration information

2021-12-20 Thread Jason Wang
On Sun, Dec 19, 2021 at 10:03 PM Eli Cohen wrote: > > Add netlink attribute to store the negotiated features. This can be used > by userspace to get the current state of the vdpa instance. > > Example: > $ vdpa dev config show vdpa-a > vdpa-a: mac 00:00:00:00:88:88 link up link_announce false max_

Re: [PATCH v3 09/10] vdpa/mlx5: Configure max supported virtqueues

2021-12-20 Thread Jason Wang
在 2021/12/19 下午10:02, Eli Cohen 写道: Configure max supported virtqueues on the management device. This info can be retrieved using: $ vdpa dev show vdpa-a: type network mgmtdev auxiliary/mlx5_core.sf.1 vendor_id \ max_vqp 3 max_vq_size 256 max_supported_vqs 256 I still think we s

Re: [PATCH v3 10/10] vdpa: Use BIT_ULL for bit operations

2021-12-20 Thread Jason Wang
On Sun, Dec 19, 2021 at 10:03 PM Eli Cohen wrote: > > All masks in this file are 64 bits. Change BIT to BIT_ULL. > > Other occurences use (1 << val) which yields a 32 bit value. Change them > to use BIT_ULL too. > It looks to me the patch was squashed with vendor specific stats extension unexpect

Re: [PATCH v3 03/10] vdpa: Read device configuration only if FEATURES_OK

2021-12-20 Thread Jason Wang
On Tue, Dec 21, 2021 at 2:17 PM Eli Cohen wrote: > > On Tue, Dec 21, 2021 at 01:51:32PM +0800, Jason Wang wrote: > > On Sun, Dec 19, 2021 at 10:03 PM Eli Cohen wrote: > > > > > > Avoid reading device configuration during feature negotiation. Read >

Re: [PATCH v3 07/10] vdpa: Add support for returning device configuration information

2021-12-20 Thread Jason Wang
On Tue, Dec 21, 2021 at 3:04 PM Eli Cohen wrote: > > On Tue, Dec 21, 2021 at 08:20:32AM +0200, Eli Cohen wrote: > > On Tue, Dec 21, 2021 at 01:57:54PM +0800, Jason Wang wrote: > > > On Sun, Dec 19, 2021 at 10:03 PM Eli Cohen wrote: > > > > > > > >

Re: [PATCH v3 09/10] vdpa/mlx5: Configure max supported virtqueues

2021-12-20 Thread Jason Wang
On Tue, Dec 21, 2021 at 2:23 PM Eli Cohen wrote: > > On Tue, Dec 21, 2021 at 02:04:39PM +0800, Jason Wang wrote: > > > > 在 2021/12/19 下午10:02, Eli Cohen 写道: > > > Configure max supported virtqueues on the management device. This info > > > can be retrieve

Re: [PATCH v3 03/10] vdpa: Read device configuration only if FEATURES_OKg

2021-12-21 Thread Jason Wang
On Tue, Dec 21, 2021 at 5:00 PM Eli Cohen wrote: > > On Tue, Dec 21, 2021 at 03:51:47PM +0800, Jason Wang wrote: > > On Tue, Dec 21, 2021 at 2:17 PM Eli Cohen wrote: > > > > > > On Tue, Dec 21, 2021 at 01:51:32PM +0800, Jason Wang wrote: > > > > On Sun,

Re: [PATCH v5 10/13] vdpa: Support reporting max device virtqueues

2021-12-22 Thread Jason Wang
On Thu, Dec 23, 2021 at 3:25 AM Si-Wei Liu wrote: > > > > On 12/21/2021 11:54 PM, Eli Cohen wrote: > > On Tue, Dec 21, 2021 at 11:29:36PM -0800, Si-Wei Liu wrote: > >> > >> On 12/21/2021 11:10 PM, Eli Cohen wrote: > >>> On Wed, Dec 22, 2021 at 09:03:37AM +0200, Parav Pandit wrote: > > From: El

Re: [PATCH] virtio/virtio_pci_legacy_dev: ensure the correct return value

2021-12-22 Thread Jason Wang
On Wed, Dec 22, 2021 at 7:21 PM Peng Hao wrote: > > When pci_iomap return NULL, the return value is zero. > > Signed-off-by: Peng Hao > --- Acked-by: Jason Wang > drivers/virtio/virtio_pci_legacy_dev.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >

Re: [PATCH] vdpa/mlx5: Fix wrong configuration of virtio_version_1_0

2022-01-03 Thread Jason Wang
> > eth_frame_offload_type)) > > - MLX5_SET(virtio_q, vq_ctx, virtio_version_1_0, 1); > > > > err = mlx5_cmd_exec(ndev->mvdev.mdev, in, inlen, out, sizeof(out)); > > if (err) > > -- > > 2.34.1 > > Reviewed-by: Parav Pandit > Acked-by: Jason Wang ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH] virtio_ring: Check null pointer

2022-01-03 Thread Jason Wang
0644 > --- a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -991,7 +991,12 @@ static int virtqueue_add_indirect_packed(struct > vring_virtqueue *vq, > dma_addr_t addr; > > head = vq->packed.next_avail_idx; > + Unnecessary changes. Oth

Re: [PATCH v2] vdpa: regist vhost-vdpa dev class

2022-01-03 Thread Jason Wang
On Fri, Dec 24, 2021 at 3:13 PM Yi Wang wrote: > > From: Zhang Min > > Some applications like kata-containers need to acquire MAJOR/MINOR/DEVNAME > for devInfo [1], so regist vhost-vdpa dev class to expose uevent. Hi: I think we need to be more verbose here e.g: 1) why can't we get major/minor

Re: [PATCH] vhost/test: fix memory leak of vhost virtqueues

2022-01-03 Thread Jason Wang
ned-off-by: Xianting Tian Acked-by: Jason Wang > > --- > > drivers/vhost/test.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/vhost/test.c b/drivers/vhost/test.c > > index a09dedc79..05740cba1 100644 > > --- a/drivers/

Re: [PATCH v2] virtio_ring: Check null pointer

2022-01-04 Thread Jason Wang
On Tue, Jan 4, 2022 at 11:13 PM Jiasheng Jiang wrote: > > As the alloc_indirect_packed() returns kmalloc_array() that could > allocation fail and return null pointer, it should be check in order to > prevent the dereference of null pointer. > > Fixes: 1ce9e6055fa0 ("virtio_ring: introduce packed r

Re:

2022-01-04 Thread Jason Wang
On Wed, Dec 29, 2021 at 5:31 PM Wu Zongyong wrote: > > linux-ker...@vger.kernel.org > Bcc: > Subject: Should we call vdpa_config_ops->get_vq_num_{max,min} with a > virtqueue index? > Reply-To: Wu Zongyong > > Hi jason, > > AFAIK, a virtio device may have multiple virtqueues of diffrent sizes. >

Re:

2022-01-04 Thread Jason Wang
On Wed, Jan 5, 2022 at 2:05 PM Jason Wang wrote: > > On Wed, Dec 29, 2021 at 5:31 PM Wu Zongyong > wrote: > > > > linux-ker...@vger.kernel.org > > Bcc: > > Subject: Should we call vdpa_config_ops->get_vq_num_{max,min} with a > > virtqueue index? &

Re: [PATCH] virtio_ring: mark ring unused on error

2022-01-06 Thread Jason Wang
tion. > > Fixes: fc6d70f40b3d ("virtio_ring: check desc == NULL when using indirect > with packed") > Cc: "Xuan Zhuo" > Cc: Jiasheng Jiang > Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang > --- > drivers/virtio/virtio_ring.c | 4 +++- > 1 file ch

Re: [PATCH] virtio-pci: fix memory leak of vp_dev

2022-01-06 Thread Jason Wang
On Thu, Jan 6, 2022 at 4:31 PM Xianting Tian wrote: > > In virtio_pci_probe(), vp_dev will not be freed if it goes to > "err_register" branch. fix it > > Signed-off-by: Xianting Tian So we had this: commit 33635bd976fb4c3ccf0cfbb81a8d29bb87760607 Author: weiping zhang Date: Thu Dec 21 20:40:

Re: [PATCH v7 03/14] vdpa: Sync calls set/get config/status with cf_mutex

2022-01-06 Thread Jason Wang
在 2022/1/7 上午8:33, Si-Wei Liu 写道: On 1/5/2022 3:46 AM, Eli Cohen wrote: Add wrappers to get/set status and protect these operations with cf_mutex to serialize these operations with respect to get/set config operations. Signed-off-by: Eli Cohen ---   drivers/vdpa/vdpa.c  | 19 +++

Re: [PATCH v7 04/14] vdpa: Read device configuration only if FEATURES_OK

2022-01-06 Thread Jason Wang
: Eli Cohen Acked-by: Jason Wang --- v5 -> v6: 1. Use cf_mutex to serialize the entire operations --- drivers/vdpa/vdpa.c | 45 + 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c in

Re: [PATCH v7 07/14] vdpa/mlx5: Support configuring max data virtqueue

2022-01-06 Thread Jason Wang
在 2022/1/7 上午9:50, Si-Wei Liu 写道: On 1/6/2022 5:27 PM, Si-Wei Liu wrote: On 1/5/2022 3:46 AM, Eli Cohen wrote: Check whether the max number of data virtqueue pairs was provided when a adding a new device and verify the new value does not exceed device capabilities. In addition, change th

Re: [PATCH v7 08/14] vdpa: Add support for returning device configuration information

2022-01-06 Thread Jason Wang
": false, "max_vq_pairs": 16, "mtu": 1500, "negotiated_features": [ "CSUM","GUEST_CSUM","MTU","MAC","HOST_TSO4","HOST_TSO6","STATUS","CTRL_VQ",&

Re: [PATCH v7 11/14] vdpa/mlx5: Report max device capabilities

2022-01-06 Thread Jason Wang
   dev_features CSUM GUEST_CSUM MTU HOST_TSO4 HOST_TSO6 STATUS CTRL_VQ MQ \     CTRL_MAC_ADDR VERSION_1 ACCESS_PLATFORM Signed-off-by: Eli Cohen Reviewed-by: Si-Wei Liu Acked-by: Jason Wang --- v6 -> v7: 1. Add supported features   drivers/vdpa/mlx5/net/mlx5_vnet.c |

Re: [PATCH v7 12/14] vdpa/vdpa_sim: Configure max supported virtqueues

2022-01-06 Thread Jason Wang
在 2022/1/5 下午7:46, Eli Cohen 写道: Configure max supported virtqueues on the management device. Signed-off-by: Eli Cohen Acked-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim_net.c b/drivers

Re: [PATCH v7 13/14] vdpa: Use BIT_ULL for bit operations

2022-01-06 Thread Jason Wang
在 2022/1/5 下午7:46, Eli Cohen 写道: All masks in this file are 64 bits. Change BIT to BIT_ULL. Other occurences use (1 << val) which yields a 32 bit value. Change them to use BIT_ULL too. Reviewed-by: Si-Wei Liu Signed-off-by: Eli Cohen Acked-by: Jason Wang --- drivers/vdpa/

Re: [PATCH v7 14/14] vdpa/vdpa_sim_net: Report max device capabilities

2022-01-06 Thread Jason Wang
Cohen Acked-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim_net.c b/drivers/vdpa/vdpa_sim/vdpa_sim_net.c index 46aabc73263a..d5324f6fd8c7 100644 --- a/drivers/vdpa/vdpa_sim/vdpa_sim_net.c +++ b

Re: [PATCH] vdpa/mlx5: fix endian-ness for max vqs

2022-01-09 Thread Jason Wang
c: "Eli Cohen" > Reported-by: kernel test robot > Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang > --- > drivers/vdpa/mlx5/net/mlx5_vnet.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c >

Re: [PATCH v7 03/14] vdpa: Sync calls set/get config/status with cf_mutex

2022-01-09 Thread Jason Wang
在 2022/1/8 上午9:23, Si-Wei Liu 写道: On 1/6/2022 9:08 PM, Jason Wang wrote: 在 2022/1/7 上午8:33, Si-Wei Liu 写道: On 1/5/2022 3:46 AM, Eli Cohen wrote: Add wrappers to get/set status and protect these operations with cf_mutex to serialize these operations with respect to get/set config

Re: [PATCH] virtio: Simplify DMA setting

2022-01-09 Thread Jason Wang
在 2022/1/8 下午3:08, Christophe JAILLET 写道: As stated in [1], dma_set_mask() with a 64-bit mask will never fail if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. I'd expect to be more verbose here. E.g I see dma_supported() who has a brunch of

Re: [PATCH 1/6] virtio: rename vring_unmap_state_packed() to vring_unmap_extra_packed()

2022-01-09 Thread Jason Wang
在 2022/1/7 下午2:33, Xuan Zhuo 写道: The actual parameter handled by vring_unmap_state_packed() is that vring_desc_extra, so this function should use "extra" instead of "state". Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_ring.c | 17 ++

Re: [PATCH 2/6] virtio: split: alloc indirect desc with extra

2022-01-09 Thread Jason Wang
在 2022/1/7 下午2:33, Xuan Zhuo 写道: In the scenario where indirect is not used, each desc corresponds to an extra, which is used to record information such as dma, flags, and next. In the scenario of using indirect, the assigned desc does not have the corresponding extra record dma information, an

Re: [PATCH 4/6] virtio: split: virtqueue_add_split() support dma address

2022-01-09 Thread Jason Wang
在 2022/1/7 下午2:33, Xuan Zhuo 写道: virtqueue_add_split() only supports virtual addresses, dma is completed in virtqueue_add_split(). In some scenarios (such as the AF_XDP scenario), the memory is allocated and DMA is completed in advance, so it is necessary for us to support passing the DMA addre

Re: [PATCH v7 00/14] Allow for configuring max number of virtqueue pairs

2022-01-09 Thread Jason Wang
On Mon, Jan 10, 2022 at 3:04 PM Michael S. Tsirkin wrote: > > On Wed, Jan 05, 2022 at 01:46:32PM +0200, Eli Cohen wrote: > > Allow the user to configure the max number of virtqueue pairs for a vdpa > > instance. The user can then control the actual number of virtqueue pairs > > using ethtool. > >

Re: [PATCH 2/6] virtio: split: alloc indirect desc with extra

2022-01-09 Thread Jason Wang
On Mon, Jan 10, 2022 at 3:24 PM Xuan Zhuo wrote: > > On Mon, 10 Jan 2022 14:43:39 +0800, Jason Wang wrote: > > > > 在 2022/1/7 下午2:33, Xuan Zhuo 写道: > > > In the scenario where indirect is not used, each desc corresponds to an > > > extra, which is used to r

Re: [PATCH 2/6] virtio: split: alloc indirect desc with extra

2022-01-10 Thread Jason Wang
On Mon, Jan 10, 2022 at 3:59 PM Xuan Zhuo wrote: > > On Mon, 10 Jan 2022 15:41:27 +0800, Jason Wang wrote: > > On Mon, Jan 10, 2022 at 3:24 PM Xuan Zhuo > > wrote: > > > > > > On Mon, 10 Jan 2022 14:43:39 +0800, Jason Wang > > > wrote: &g

Re: [PATCH 2/6] virtio: split: alloc indirect desc with extra

2022-01-10 Thread Jason Wang
On Mon, Jan 10, 2022 at 5:29 PM Xuan Zhuo wrote: > > On Mon, 10 Jan 2022 16:54:58 +0800, Jason Wang wrote: > > On Mon, Jan 10, 2022 at 3:59 PM Xuan Zhuo > > wrote: > > > > > > On Mon, 10 Jan 2022 15:41:27 +0800, Jason Wang > > > wrote: >

Re: [PATCH 0/6] virtio: support advance DMA

2022-01-10 Thread Jason Wang
On Mon, Jan 10, 2022 at 5:59 PM Michael S. Tsirkin wrote: > > On Fri, Jan 07, 2022 at 02:33:00PM +0800, Xuan Zhuo wrote: > > virtqueue_add() only supports virtual addresses, dma is completed in > > virtqueue_add(). > > > > In some scenarios (such as the AF_XDP scenario), DMA is completed in > > a

Re: [PATCH 2/4] drivers/net/virtio_net: Added basic RSS support.

2022-01-10 Thread Jason Wang
在 2022/1/10 上午5:06, Andrew Melnychenko 写道: Added features for RSS. Added initialization, RXHASH feature and ethtool ops. By default RSS/RXHASH is disabled. Virtio RSS "IPv6 extensions" hashes disabled. Added ethtools ops to set key and indirection table. Signed-off-by: Andrew Melnychenko ---

Re: [PATCH 3/4] drivers/net/virtio_net: Added RSS hash report.

2022-01-10 Thread Jason Wang
在 2022/1/10 上午5:06, Andrew Melnychenko 写道: Added features for RSS hash report. If hash is provided - it sets to skb. Added checks if rss and/or hash are enabled together. Signed-off-by: Andrew Melnychenko --- drivers/net/virtio_net.c | 56 ++-- 1 file cha

Re: [PATCH 4/4] drivers/net/virtio_net: Added RSS hash report control.

2022-01-10 Thread Jason Wang
在 2022/1/10 上午5:06, Andrew Melnychenko 写道: Now it's possible to control supported hashflows. Also added hashflow set/get callbacks. Also, disabling RXH_IP_SRC/DST for TCP would disable then for UDP. TCP and UDP supports only: ethtool -U eth0 rx-flow-hash tcp4 sd RXH_IP_SRC + RXH_IP_DST etht

Re: [PATCH] virtio_vdpa: Support surprise removal of virtio vdpa device

2022-01-10 Thread Jason Wang
val > > Signed-off-by: dongsheng li Acked-by: Jason Wang > --- > drivers/virtio/virtio_vdpa.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c > index 4a9ddb44b2a7..fd930409d190 100644 > --- a/drivers/virtio/vi

Re: [PATCH v7 03/14] vdpa: Sync calls set/get config/status with cf_mutex

2022-01-10 Thread Jason Wang
On Tue, Jan 11, 2022 at 9:30 AM Si-Wei Liu wrote: > > > > On 1/9/2022 10:05 PM, Jason Wang wrote: > > > > 在 2022/1/8 上午9:23, Si-Wei Liu 写道: > >> > >> > >> On 1/6/2022 9:08 PM, Jason Wang wrote: > >>> > >>> 在 2022/1/7 上午8:3

Re: RE: [PATCH 0/6] virtio: support advance DMA

2022-01-11 Thread Jason Wang
On Tue, Jan 11, 2022 at 4:17 PM Xuan Zhuo wrote: > > On Tue, 11 Jan 2022 08:04:05 +, Karlsson, Magnus > wrote: > > > > > > > -Original Message- > > > From: Xuan Zhuo > > > Sent: Tuesday, January 11, 2022 7:17 AM > >

Re: [PATCH v7 07/14] vdpa/mlx5: Support configuring max data virtqueue

2022-01-11 Thread Jason Wang
On Tue, Jan 11, 2022 at 3:34 PM Eli Cohen wrote: > > On Mon, Jan 10, 2022 at 05:00:34PM -0800, Si-Wei Liu wrote: > > > > > > On 1/9/2022 6:10 AM, Eli Cohen wrote: > > > On Thu, Jan 06, 2022 at 05:50:24PM -0800, Si-Wei Liu wrote: > > > > > > > > On 1/6/2022 5:27 PM, Si-Wei Liu wrote: > > > > > > >

Re: [PATCH] virtio_vdpa: Support surprise removal of virtio vdpa device

2022-01-11 Thread Jason Wang
On Tue, Jan 11, 2022 at 7:52 PM Michael S. Tsirkin wrote: > > On Tue, Jan 11, 2022 at 11:36:42AM +0800, 李东升 wrote: > > When virtio vdpa device removed, the abnormal damage of the device cannot be > > perceived normally, which will cause problems similar to: > > > > 43bb40c5b926 > > > Should includ

Re: [PATCH 4/4] vdpa/mlx5: Fix tracking of current number of VQs

2022-01-11 Thread Jason Wang
On Wed, Jan 12, 2022 at 6:15 AM Si-Wei Liu wrote: > > > > On 1/11/2022 10:34 AM, Eli Cohen wrote: > > Modify the code such that ndev->cur_num_vqs better reflects the actual > > number of data virtqueues. The value can be accurately realized after > > features have been negotiated. > > > > This is

Re: [PATCH 1/4] vdpa: Avoid taking cf_mutex lock on get status

2022-01-11 Thread Jason Wang
ot;) > Signed-off-by: Eli Cohen Acked-by: Jason Wang > --- > drivers/vdpa/vdpa.c | 11 --- > drivers/vhost/vdpa.c | 5 +++-- > include/linux/vdpa.h | 1 - > 3 files changed, 3 insertions(+), 14 deletions(-) > > diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa

Re: [PATCH 2/4] vdpa: Protect vdpa reset with cf_mutex

2022-01-11 Thread Jason Wang
nly if FEATURES_OK") > Signed-off-by: Eli Cohen Acked-by: Jason Wang > --- > drivers/vhost/vdpa.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c > index 0ed6cbadb52d..851539807bc9 100644 > ---

Re: [PATCH 3/4] vdpa/mlx5: Fix is_index_valid() to refer to features

2022-01-11 Thread Jason Wang
eration was called features were already > clear, I got get_vq_state() call which caused out array bounds > access since is_index_valid() reported the index value. > > So this is more of not hit a bug since the call shouldn't have been made > first place. > > Sig

Re: [PATCH 4/4] vdpa/mlx5: Fix tracking of current number of VQs

2022-01-11 Thread Jason Wang
hen modifying the RQT object if > the cur_num_vqs bears invalid value. > > No issue was actually encountered but this also makes the code more > readable. > > Fixes: c5a5cd3d3217 ("vdpa/mlx5: Support configuring max data virtqueue") > Signed-off-by: Eli Cohen A

Re: [PATCH v7 07/14] vdpa/mlx5: Support configuring max data virtqueue

2022-01-11 Thread Jason Wang
On Tue, Jan 11, 2022 at 8:06 PM Michael S. Tsirkin wrote: > > On Tue, Jan 11, 2022 at 04:28:58PM +0800, Jason Wang wrote: > > On Tue, Jan 11, 2022 at 3:34 PM Eli Cohen wrote: > > > > > > On Mon, Jan 10, 2022 at 05:00:34PM -0800, Si-Wei Liu wrote: > > > >

Re: [PATCH 2/4] vdpa/mlx5: Fix is_index_valid() to refer to features

2022-01-11 Thread Jason Wang
On Tue, Jan 11, 2022 at 8:11 PM Michael S. Tsirkin wrote: > > On Tue, Jan 11, 2022 at 01:31:28AM -0800, Si-Wei Liu wrote: > > > > > > On 1/10/2022 11:22 PM, Eli Cohen wrote: > > > Make sure the decision whether an index received trough a callback is > > > valid or not consults the negotiated featu

Re: [PATCH 4/4] vdpa/mlx5: Fix tracking of current number of VQs

2022-01-11 Thread Jason Wang
On Wed, Jan 12, 2022 at 11:12 AM Si-Wei Liu wrote: > > > > On 1/11/2022 6:29 PM, Jason Wang wrote: > > On Wed, Jan 12, 2022 at 6:15 AM Si-Wei Liu wrote: > >> > >> > >> On 1/11/2022 10:34 AM, Eli Cohen wrote: > >>> Modify the co

Re: [PATCH] virtio_vdpa: Support surprise removal of virtio vdpa device

2022-01-11 Thread Jason Wang
On Wed, Jan 12, 2022 at 2:30 PM Michael S. Tsirkin wrote: > > On Wed, Jan 12, 2022 at 10:23:07AM +0800, Jason Wang wrote: > > On Tue, Jan 11, 2022 at 7:52 PM Michael S. Tsirkin wrote: > > > > > > On Tue, Jan 11, 2022 at 11:36:42AM +0800, 李东升 wrote: > > >

Re: [PATCH 2/3] vdpa/mlx5: set_features should nack MQ if no CTRL_VQ

2022-01-13 Thread Jason Wang
On Thu, Jan 13, 2022 at 4:09 PM Eli Cohen wrote: > > On Thu, Jan 13, 2022 at 12:10:50AM -0500, Si-Wei Liu wrote: > > Made corresponding change per spec: > > > > The device MUST NOT offer a feature which requires another feature > > which was not offered. > > > > Fixes: 52893733f2c5 ("vdpa/mlx5: Ad

Re: [PATCH] vhost: remove avail_event arg from vhost_update_avail_event()

2022-01-13 Thread Jason Wang
to clean up the code. > > Signed-off-by: Stefano Garzarella Acked-by: Jason Wang > --- > drivers/vhost/vhost.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > index 59edb5a1ffe2..ee171e663a18 1

Re: [RFC PATCH] vhost: cache avail index in vhost_enable_notify()

2022-01-13 Thread Jason Wang
On Thu, Jan 13, 2022 at 10:57 PM Stefano Garzarella wrote: > > In vhost_enable_notify() we enable the notifications and we read > the avail index to check if new buffers have become available in > the meantime. In this case, the device would go to re-read avail > index to access the descriptor. >

Re: [PATCH] virtio: unexport virtio_finalize_features

2022-01-16 Thread Jason Wang
在 2022/1/15 上午3:57, Michael S. Tsirkin 写道: virtio_finalize_features is only used internally within virtio. No reason to export it. Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang --- drivers/virtio/virtio.c | 3 +-- include/linux/virtio.h | 1 - 2 files changed, 1 insertion

Re: [PATCH] virtio: acknowledge all features before access

2022-01-16 Thread Jason Wang
在 2022/1/15 上午4:09, Michael S. Tsirkin 写道: The feature negotiation was designed in a way that makes it possible for devices to know which config fields will be accessed by drivers. This is broken since commit 404123c2db79 ("virtio: allow drivers to validate features") with fallout in at least b

Re: [PATCH] virtio_mem: break device on remove

2022-01-16 Thread Jason Wang
在 2022/1/15 上午5:43, Michael S. Tsirkin 写道: A common pattern for device reset is currently: vdev->config->reset(vdev); .. cleanup .. reset prevents new interrupts from arriving and waits for interrupt handlers to finish. However if - as is common - the handler queues a work request which is flu

Re: [PATCH v2 1/3] vdpa: factor out vdpa_set_features_unlocked for vdpa internal use

2022-01-16 Thread Jason Wang
ed-by: Eli Cohen Acked-by: Jason Wang --- drivers/vdpa/vdpa.c | 2 +- drivers/vhost/vdpa.c | 2 +- drivers/virtio/virtio_vdpa.c | 2 +- include/linux/vdpa.h | 18 -- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/drivers/vdpa/v

Re: [PATCH v2 2/3] vdpa/mlx5: should verify CTRL_VQ feature exists for MQ

2022-01-16 Thread Jason Wang
at it now does more than just validate the minimum features. verify_driver_features() is now used to accommodate various checks against the driver features for set_driver_features(). Signed-off-by: Si-Wei Liu Acked-by: Jason Wang --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 18

Re: [PATCH v2 3/3] vdpa/mlx5: add validation for VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET command

2022-01-16 Thread Jason Wang
panic due to uninitialized resource for the queues were there any bogus request sent down by untrusted driver. Tie up the loose ends there. Fixes: 52893733f2c5 ("vdpa/mlx5: Add multiqueue support") Signed-off-by: Si-Wei Liu Acked-by: Jason Wang --- drivers/vdpa/mlx5/net/mlx5_v

Re: [RFC 1/3] vdpa: support exposing the config size to userspace

2022-01-17 Thread Jason Wang
在 2022/1/17 下午5:29, Longpeng(Mike) 写道: From: Longpeng - GET_CONFIG_SIZE: the size of the virtio config space I think we need to be verbose here. And it would be better to quote what spec said: " The device MUST allow reading of any device-specific configuration field before FEATURES_OK

Re: [RFC 2/3] vdpa: support exposing the count of vqs to userspace

2022-01-17 Thread Jason Wang
在 2022/1/17 下午5:29, Longpeng(Mike) 写道: From: Longpeng - GET_VQS_COUNT: the count of virtqueues that exposed Signed-off-by: Longpeng --- drivers/vhost/vdpa.c | 13 + include/uapi/linux/vhost.h | 3 +++ 2 files changed, 16 insertions(+) diff --git a/drivers/vhost/vdpa.c

Re: [RFC 3/3] vdpasim_net: control virtqueue support

2022-01-17 Thread Jason Wang
在 2022/1/17 下午5:29, Longpeng(Mike) 写道: From: Longpeng Introduces the control virtqueue support for vdpasim_net, based on Jason's RFC [1]. [1] https://patchwork.kernel.org/project/kvm/patch/20200924032125.18619-25-jasow...@redhat.com/ I'd expect to implement the receive filter as well[1].

Re: [PATCH] tools/virtio: fix virtio_test execution

2022-01-18 Thread Jason Wang
On Tue, Jan 18, 2022 at 11:06 PM Stefano Garzarella wrote: > > virtio_test hangs on __vring_new_virtqueue() because `vqs_list_lock` > is not initialized. > > Let's initialize it in vdev_info_init(). > > Signed-off-by: Stefano Garzarella Acked-by: Jason Wang > ---

Re: [PATCH v2 2/2] virtio: acknowledge all features before access

2022-01-18 Thread Jason Wang
s understood by the OS and driver to the device. During this step the driver MAY read (but MUST NOT write) the device-specific configuration fields to check that it can support the device before accepting it. """ If it is, is this better to quote in the change log? Other than this, A

Re: [PATCH 1/6] virtio: pci: struct virtio_pci_common_cfg add queue_notify_data

2022-01-18 Thread Jason Wang
On Wed, Jan 19, 2022 at 10:35 AM Xuan Zhuo wrote: > > Add queue_notify_data in struct virtio_pci_common_cfg, which comes from > here https://github.com/oasis-tcs/virtio-spec/issues/89 > > Since I want to add queue_reset after it, I submitted this patch first. > > Signed-off-by: Xuan Zhuo > --- >

Re: [PATCH 4/6] virtio: queue_reset: pci: extract some functions for subsequent patches

2022-01-18 Thread Jason Wang
On Wed, Jan 19, 2022 at 10:35 AM Xuan Zhuo wrote: > > Add a vq_enable_vq_msix() function to enable a vq alone. > > Move irq's processing logic into vp_del_vq(), so that this function can > handle a vq's del operation independently. > > In the subsequent patches that supports queue reset, I have th

Re: [PATCH 5/6] virtio: queue_reset: pci: support VIRTIO_F_RING_RESET

2022-01-18 Thread Jason Wang
On Wed, Jan 19, 2022 at 10:35 AM Xuan Zhuo wrote: > > This patch implements virtio pci support for QUEUE RESET. > > Performing reset on a queue is divided into three steps: > > 1. reset_vq: notify the hardware queue to reset > 2. del_reset_vq: delete the reset queue > 3. enable_reset_vq: re-enable

Re: [PATCH 5/6] virtio: queue_reset: pci: support VIRTIO_F_RING_RESET

2022-01-18 Thread Jason Wang
On Wed, Jan 19, 2022 at 2:11 PM Jason Wang wrote: > > On Wed, Jan 19, 2022 at 10:35 AM Xuan Zhuo wrote: > > > > This patch implements virtio pci support for QUEUE RESET. > > > > Performing reset on a queue is divided into three steps: > > > > 1. reset_vq

Re: [PATCH 0/6] virtio pci support VIRTIO_F_RING_RESET

2022-01-18 Thread Jason Wang
On Wed, Jan 19, 2022 at 10:35 AM Xuan Zhuo wrote: > > The virtio spec already supports the virtio queue reset function. This patch > set > is to add this function to the kernel. The relevant virtio spec information is > here: > > https://github.com/oasis-tcs/virtio-spec/issues/124 > > virtio-

Re: [PATCH] vduse: Fix returning wrong type in vduse_domain_alloc_iova()

2022-01-24 Thread Jason Wang
) Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Xie Yongji Acked-by: Jason Wang --- drivers/vdpa/vdpa_user/iova_domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vdpa/vdpa_user/iova_domain.c b/drivers/vdpa/vdpa_user/iova_d

Re: [PATCH v2 1/4] drivers/net/virtio_net: Fixed padded vheader to use v1 with hash.

2022-01-26 Thread Jason Wang
在 2022/1/17 下午4:00, Andrew Melnychenko 写道: The header v1 provides additional info about RSS. Added changes to computing proper header length. In the next patches, the header may contain RSS hash info for the hash population. Signed-off-by: Andrew Melnychenko Acked-by: Jason Wang

Re: [PATCH v2 2/4] drivers/net/virtio_net: Added basic RSS support.

2022-01-26 Thread Jason Wang
在 2022/1/17 下午4:00, Andrew Melnychenko 写道: Added features for RSS. Added initialization, RXHASH feature and ethtool ops. By default RSS/RXHASH is disabled. Virtio RSS "IPv6 extensions" hashes disabled. Added ethtools ops to set key and indirection table. Signed-off-by: Andrew Melnychenko ---

Re: [PATCH v2 3/4] drivers/net/virtio_net: Added RSS hash report.

2022-01-27 Thread Jason Wang
在 2022/1/17 下午4:00, Andrew Melnychenko 写道: Added features for RSS hash report. If hash is provided - it sets to skb. Added checks if rss and/or hash are enabled together. Signed-off-by: Andrew Melnychenko --- drivers/net/virtio_net.c | 58 1 file cha

Re: [PATCH v2 4/4] drivers/net/virtio_net: Added RSS hash report control.

2022-01-27 Thread Jason Wang
htool -U eth0 rx-flow-hash tcp4 sdfn RXH_IP_SRC + RXH_IP_DST + RXH_L4_B_0_1 + RXH_L4_B_2_3 Signed-off-by: Andrew Melnychenko Acked-by: Jason Wang --- drivers/net/virtio_net.c | 141 ++- 1 file changed, 140 insertions(+), 1 deletion(-) diff --

Re: [PATCH] vhost: Make use of the helper macro kthread_run()

2022-01-27 Thread Jason Wang
On Thu, Jan 27, 2022 at 10:08 AM Yin Xiujiang wrote: > > Repalce kthread_create/wake_up_process() with kthread_run() > to simplify the code. > > Signed-off-by: Yin Xiujiang > --- > drivers/vhost/vhost.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/vhost/vhos

Re: [PATCH 21/31] util: Add iova_tree_alloc

2022-01-27 Thread Jason Wang
在 2022/1/28 上午11:57, Peter Xu 写道: On Thu, Jan 27, 2022 at 10:24:27AM +0100, Eugenio Perez Martin wrote: On Thu, Jan 27, 2022 at 9:06 AM Peter Xu wrote: On Tue, Jan 25, 2022 at 10:40:01AM +0100, Eugenio Perez Martin wrote: So I think that the first step to remove complexity from the old one i

Re: [PATCH 01/31] vdpa: Reorder virtio/vhost-vdpa.c functions

2022-01-27 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: vhost_vdpa_set_features and vhost_vdpa_init need to use vhost_vdpa_get_features in svq mode. vhost_vdpa_dev_start needs to use almost all _set_ functions: vhost_vdpa_set_vring_dev_kick, vhost_vdpa_set_vring_dev_call, vhost_vdpa_set_dev_vring_base and vhost_

Re: [PATCH 02/31] vhost: Add VhostShadowVirtqueue

2022-01-27 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: Vhost shadow virtqueue (SVQ) is an intermediate jump for virtqueue notifications and buffers, allowing qemu to track them. While qemu is forwarding the buffers and virtqueue changes, it is able to commit the memory it's being dirtied, the same way regular qe

Re: [PATCH 00/31] vDPA shadow virtqueue

2022-01-27 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: This series enables shadow virtqueue (SVQ) for vhost-vdpa devices. This is intended as a new method of tracking the memory the devices touch during a migration process: Instead of relay on vhost device's dirty logging capability, SVQ intercepts the VQ datapl

Re: [PATCH 03/31] vdpa: Add vhost_svq_get_dev_kick_notifier

2022-01-27 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: Is needed so vhost-vdpa knows the device's kick event fd. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 4 hw/virtio/vhost-shadow-virtqueue.c | 10 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/

Re: [PATCH 04/31] vdpa: Add vhost_svq_set_svq_kick_fd

2022-01-27 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: This function allows the vhost-vdpa backend to override kick_fd. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 1 + hw/virtio/vhost-shadow-virtqueue.c | 45 ++ 2 files changed, 46 insertions(+) diff

Re: [PATCH 05/31] vhost: Add Shadow VirtQueue kick forwarding capabilities

2022-01-27 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: At this mode no buffer forwarding will be performed in SVQ mode: Qemu will just forward the guest's kicks to the device. Also, host notifiers must be disabled at SVQ start, and they will not start if SVQ has been enabled when the device is stopped. This wil

Re: [PATCH 06/31] vhost: Route guest->host notification through shadow virtqueue

2022-01-27 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: At this moment no buffer forwarding will be performed in SVQ mode: Qemu just forward the guest's kicks to the device. This commit also set up SVQs in the vhost device. Host memory notifiers regions are left out for simplicity, and they will not be addressed

Re: [PATCH 07/31] vhost: dd vhost_svq_get_svq_call_notifier

2022-01-28 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: This allows vhost-vdpa device to retrieve device -> svq call eventfd. Signed-off-by: Eugenio Pérez What did 'dd' mean in the title? Thanks --- hw/virtio/vhost-shadow-virtqueue.h | 2 ++ hw/virtio/vhost-shadow-virtqueue.c | 12 2 fi

Re: [PATCH 09/31] vhost-vdpa: Take into account SVQ in vhost_vdpa_set_vring_call

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 18de14f0fb..029f98feee 100644 --- a/hw/virtio/vhost-vd

Re: [PATCH 11/31] vhost: Add vhost_svq_valid_device_features to shadow vq

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: This allows SVQ to negotiate features with the device. For the device, SVQ is a driver. While this function needs to bypass all non-transport features, it needs to disable the features that SVQ does not support when forwarding buffers. This includes packed v

Re: [PATCH 15/31] vdpa: Add vhost_svq_get_num

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: This reports the guest's visible SVQ effective length, not the device's one. I think we need to explain if there could be a case that the SVQ size is not equal to the device queue size. Thanks Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-sha

Re: [PATCH 16/31] vhost: pass queue index to vhost_vq_get_addr

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: Doing that way allows vhost backend to know what address to return. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 7b03efccec..64b9

Re: [PATCH 17/31] vdpa: adapt vhost_ops callbacks to svq

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: First half of the buffers forwarding part, preparing vhost-vdpa callbacks to SVQ to offer it. QEMU cannot enable it at this moment, so this is effectively dead code at the moment, but it helps to reduce patch size. Signed-off-by: Eugenio Pérez --- hw/vir

Re: [PATCH 18/31] vhost: Shadow virtqueue buffers forwarding

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: Initial version of shadow virtqueue that actually forward buffers. There is no iommu support at the moment, and that will be addressed in future patches of this series. Since all vhost-vdpa devices use forced IOMMU, this means that SVQ is not usable at this

Re: [PATCH 21/31] util: Add iova_tree_alloc

2022-01-29 Thread Jason Wang
在 2022/1/24 下午5:20, Eugenio Perez Martin 写道: On Mon, Jan 24, 2022 at 5:33 AM Peter Xu wrote: On Fri, Jan 21, 2022 at 09:27:23PM +0100, Eugenio Pérez wrote: +int iova_tree_alloc(IOVATree *tree, DMAMap *map, hwaddr iova_begin, I forgot to s/iova_tree_alloc/iova_tree_alloc_map/ here. +

Re: [PATCH 22/31] vhost: Add VhostIOVATree

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: This tree is able to look for a translated address from an IOVA address. At first glance it is similar to util/iova-tree. However, SVQ working on devices with limited IOVA space need more capabilities, So did the IOVA tree (e.g l2 vtd can only work in th

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