Re: [RFC v1 3/8] vhost: Add 3 new uapi to support iommufd

2023-11-05 Thread Jason Wang
On Sat, Nov 4, 2023 at 1:17 AM Cindy Lu wrote: > > VHOST_VDPA_SET_IOMMU_FD: bind the device to iommufd device > > VDPA_DEVICE_ATTACH_IOMMUFD_AS: Attach a vdpa device to an iommufd > address space specified by IOAS id. > > VDPA_DEVICE_DETACH_IOMMUFD_AS: Detach a vdpa device > from the iommufd

Re: [RFC v1 3/8] vhost: Add 3 new uapi to support iommufd

2023-11-05 Thread Jason Wang
On Sat, Nov 4, 2023 at 1:17 AM Cindy Lu wrote: > > VHOST_VDPA_SET_IOMMU_FD: bind the device to iommufd device > > VDPA_DEVICE_ATTACH_IOMMUFD_AS: Attach a vdpa device to an iommufd > address space specified by IOAS id. > > VDPA_DEVICE_DETACH_IOMMUFD_AS: Detach a vdpa device > from the iommufd

Re: [RFC v1 8/8] iommu: expose the function iommu_device_use_default_domain

2023-11-05 Thread Jason Wang
On Sat, Nov 4, 2023 at 1:18 AM Cindy Lu wrote: > > Expose the function iommu_device_use_default_domain() and > iommu_device_unuse_default_domain(), > While vdpa bind the iommufd device and detach the iommu device, > vdpa need to call the function > iommu_device_unuse_default_domain() to release

Re: [RFC v1 7/8] vp_vdpa::Add support for iommufd

2023-11-05 Thread Jason Wang
On Sat, Nov 4, 2023 at 1:17 AM Cindy Lu wrote: > > Add new vdpa_config_ops function to support iommufd > > Signed-off-by: Cindy Lu > --- > drivers/vdpa/virtio_pci/vp_vdpa.c | 4 > 1 file changed, 4 insertions(+) > > diff --git a/drivers/vdpa/virtio_pci/vp_vdpa.c >

Re: [RFC v1 0/8] vhost-vdpa: add support for iommufd

2023-11-05 Thread Jason Wang
On Sat, Nov 4, 2023 at 1:16 AM Cindy Lu wrote: > > > Hi All > This code provides the iommufd support for vdpa device > This code fixes the bugs from the last version and also add the asid support. > rebase on kernel > v6,6-rc3 > Test passed in the physical device (vp_vdpa), but there are still

Re: [PATCH V2] vdpa/mlx5: preserve CVQ vringh index

2023-11-02 Thread Jason Wang
NG_BASE > > > > To fix, restore the value of cvq->vring.last_avail_idx after calling > > vringh_init_iotlb. > > > > Fixes tag missing? +1 > > Apart from that, > > Acked-by: Eugenio Pérez With the fix tag added. Acked-by: Jason Wang Thanks >

Re: [PATCH net-next 0/5] virtio-net: support dynamic coalescing moderation

2023-11-01 Thread Jason Wang
On Wed, Nov 1, 2023 at 5:38 PM Heng Qi wrote: > > > > 在 2023/10/25 上午9:18, Jason Wang 写道: > > On Tue, Oct 24, 2023 at 8:03 PM Heng Qi wrote: > >> > >> > >> 在 2023/10/12 下午4:29, Jason Wang 写道: > >>> On Thu, Oct 12, 2023 at 3:44 PM Heng Qi

Re: [PATCH net-next 0/5] virtio-net: support dynamic coalescing moderation

2023-11-01 Thread Jason Wang
On Wed, Nov 1, 2023 at 7:03 PM Heng Qi wrote: > > > > 在 2023/10/25 下午1:53, Michael S. Tsirkin 写道: > > On Wed, Oct 25, 2023 at 09:18:27AM +0800, Jason Wang wrote: > >> On Tue, Oct 24, 2023 at 8:03 PM Heng Qi wrote: > >>> > >>> > >>>

Re: [PATCH net-next 4/5] virtio-net: support rx netdim

2023-11-01 Thread Jason Wang
On Wed, Nov 1, 2023 at 6:55 PM Heng Qi wrote: > > > > 在 2023/10/25 上午11:34, Jason Wang 写道: > > On Thu, Oct 12, 2023 at 3:44 PM Heng Qi wrote: > >> By comparing the traffic information in the complete napi processes, > >> let the virtio-net driver

Re: [PATCH net-XXX] vhost-vdpa: fix use after free in vhost_vdpa_probe()

2023-10-31 Thread Jason Wang
host-vdpa: Call ida_simple_remove() when failed") > Signed-off-by: Dan Carpenter Acked-by: Jason Wang Thanks > --- > drivers/vhost/vdpa.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c > index 9a2343c45df0..1aa67729e18

Re: [PATCH] virtio_pci: move structure to a header

2023-10-31 Thread Jason Wang
of the existing structure > staying unchanged. Add a warning to avoid using sizeof. > > Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Thanks > --- > drivers/virtio/virtio_pci_modern_dev.c | 7 --- > include/linux/virtio_pci_modern.h | 7 --- > include

Re: [PATCH] vdpa_sim_blk: allocate the buffer zeroed

2023-10-31 Thread Jason Wang
s > > completely zeroed out. > > > > Fixes: abebb16254b3 ("vdpa_sim_blk: support shared backend") > > Suggested-by: Qing Wang > > Acked-by: Eugenio Pérez Acked-by: Jason Wang Thanks > > > Signed-off-by: Stefano Garzarella > > --- > > drivers

Re: [RFC] vdpa/mlx5: preserve CVQ vringh index

2023-10-30 Thread Jason Wang
On Mon, Oct 30, 2023 at 10:06 PM Steven Sistare wrote: > > On 10/27/2023 2:31 AM, Jason Wang wrote: > > On Fri, Oct 27, 2023 at 4:07 AM Steve Sistare > > wrote: > >> > >> mlx5_vdpa does not preserve userland's view of vring base for the control

Re: [RFC] vdpa/mlx5: preserve CVQ vringh index

2023-10-27 Thread Jason Wang
On Fri, Oct 27, 2023 at 4:07 AM Steve Sistare wrote: > > mlx5_vdpa does not preserve userland's view of vring base for the control > queue in the following sequence: > > ioctl VHOST_SET_VRING_BASE > ioctl VHOST_VDPA_SET_STATUS VIRTIO_CONFIG_S_DRIVER_OK > mlx5_vdpa_set_status() >

Re: [PATCH net-next 5/5] virtio-net: support tx netdim

2023-10-24 Thread Jason Wang
On Thu, Oct 12, 2023 at 3:44 PM Heng Qi wrote: > > Similar to rx netdim, this patch supports adaptive tx > coalescing moderation for the virtio-net. > > Signed-off-by: Heng Qi > --- > drivers/net/virtio_net.c | 143 --- > 1 file changed, 119 insertions(+), 24

Re: [PATCH net-next 4/5] virtio-net: support rx netdim

2023-10-24 Thread Jason Wang
On Thu, Oct 12, 2023 at 3:44 PM Heng Qi wrote: > > By comparing the traffic information in the complete napi processes, > let the virtio-net driver automatically adjust the coalescing > moderation parameters of each receive queue. > > Signed-off-by: Heng Qi > --- > drivers/net/virtio_net.c |

Re: [PATCH net-next 3/5] virtio-net: extract virtqueue coalescig cmd for reuse

2023-10-24 Thread Jason Wang
On Thu, Oct 12, 2023 at 3:44 PM Heng Qi wrote: > > Extract commands to set virtqueue coalescing parameters for reuse > by ethtool -Q, vq resize and netdim. > > Signed-off-by: Heng Qi Acked-by: Jason Wang Thanks > --- > drivers/n

Re: [PATCH net-next 1/5] virtio-net: returns whether napi is complete

2023-10-24 Thread Jason Wang
rsa. > > Signed-off-by: Heng Qi Acked-by: Jason Wang Thanks > --- > drivers/net/virtio_net.c | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > index a52fd743504a..cf5d2ef4bd24 100644 &

Re: [PATCH net-next 0/5] virtio-net: support dynamic coalescing moderation

2023-10-24 Thread Jason Wang
On Tue, Oct 24, 2023 at 8:03 PM Heng Qi wrote: > > > > 在 2023/10/12 下午4:29, Jason Wang 写道: > > On Thu, Oct 12, 2023 at 3:44 PM Heng Qi wrote: > >> Now, virtio-net already supports per-queue moderation parameter > >> setting. Based on this, we use th

Re: [PATCH v4 5/7] vhost-vdpa: clean iotlb map during reset for older userspace

2023-10-24 Thread Jason Wang
On Wed, Oct 25, 2023 at 12:25 AM Si-Wei Liu wrote: > > > > On 10/24/2023 9:21 AM, Si-Wei Liu wrote: > > > > > > On 10/23/2023 10:45 PM, Jason Wang wrote: > >> On Sat, Oct 21, 2023 at 5:28 PM Si-Wei Liu > >> wrote: > >>> Usin

Re: [PATCH v4 5/7] vhost-vdpa: clean iotlb map during reset for older userspace

2023-10-23 Thread Jason Wang
On Sat, Oct 21, 2023 at 5:28 PM Si-Wei Liu wrote: > > Using .compat_reset op from the previous patch, the buggy .reset > behaviour can be kept as-is on older userspace apps, which don't ack the > IOTLB_PERSIST backend feature. As this compatibility quirk is limited to > those drivers that used to

Re: [RFC] vhost: vmap virtio descriptor table kernel/kvm

2023-10-23 Thread Jason Wang
pace one to avoid things like spec barriers or SMAP. I've tried this in the past: commit 7f466032dc9e5a61217f22ea34b2df932786bbfc (HEAD) Author: Jason Wang Date: Fri May 24 04:12:18 2019 -0400 vhost: access vq metadata through kernel virtual address It was noticed that the copy_to/f

Re: [PATCH v4 0/7] vdpa: decouple reset of iotlb mapping from device reset

2023-10-22 Thread Jason Wang
Hi Si-Wei: On Sat, Oct 21, 2023 at 5:28 PM Si-Wei Liu wrote: > > In order to reduce needlessly high setup and teardown cost > of iotlb mapping during live migration, it's crucial to > decouple the vhost-vdpa iotlb abstraction from the virtio > device life cycle, i.e. iotlb mappings should be

Re: [PATCH v4 4/4] vduse: Add LSM hooks to check Virtio device type

2023-10-22 Thread Jason Wang
On Fri, Oct 20, 2023 at 11:58 PM Maxime Coquelin wrote: > > This patch introduces LSM hooks for devices creation, > destruction and opening operations, checking the > application is allowed to perform these operations for > the Virtio device type. > > Signed-off-by: Maxime Coquelin > --- Hi

Re: [PATCH v4 3/4] vduse: Temporarily disable control queue features

2023-10-22 Thread Jason Wang
On Fri, Oct 20, 2023 at 11:58 PM Maxime Coquelin wrote: > > Virtio-net driver control queue implementation is not safe > when used with VDUSE. If the VDUSE application does not > reply to control queue messages, it currently ends up > hanging the kernel thread sending this command. > > Some work

Re: [PATCH net-next v1 04/19] virtio_net: move to virtio_net.h

2023-10-20 Thread Jason Wang
On Thu, Oct 19, 2023 at 3:20 PM Xuan Zhuo wrote: > > On Thu, 19 Oct 2023 14:12:55 +0800, Jason Wang wrote: > > On Mon, Oct 16, 2023 at 8:00 PM Xuan Zhuo > > wrote: > > > > > > Move some structure definitions and inline functions into the > > > vir

Re: [PATCH net-next v1 18/19] virtio_net: update tx timeout record

2023-10-20 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:01 PM Xuan Zhuo wrote: > > If send queue sent some packets, we update the tx timeout > record to prevent the tx timeout. > > Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Thanks > --- > drivers/net/virtio/xsk.c | 10 ++ > 1 fil

Re: [PATCH net-next v1 16/19] virtio_net: xsk: rx: introduce receive_xsk() to recv xsk buffer

2023-10-20 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:01 PM Xuan Zhuo wrote: > > Implementing the logic of xsk rx. If this packet is not for XSK > determined in XDP, then we need to copy once to generate a SKB. > If it is for XSK, it is a zerocopy receive packet process. > > Signed-off-by: Xuan Zhuo > --- >

Re: [PATCH net-next v1 15/19] virtio_net: xsk: rx: introduce add_recvbuf_xsk()

2023-10-20 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:01 PM Xuan Zhuo wrote: > > Implement the logic of filling vq with XSK buffer. > > Signed-off-by: Xuan Zhuo > --- > drivers/net/virtio/main.c | 13 +++ > drivers/net/virtio/virtio_net.h | 5 +++ > drivers/net/virtio/xsk.c| 66

Re: [PATCH net-next v1 14/19] virtio_net: xsk: tx: virtnet_sq_free_unused_buf() check xsk buffer

2023-10-20 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:01 PM Xuan Zhuo wrote: > > virtnet_sq_free_unused_buf() check xsk buffer. > > Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Thanks > --- > drivers/net/virtio/main.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff

Re: [PATCH net-next v1 12/19] virtio_net: xsk: tx: support wakeup

2023-10-20 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:01 PM Xuan Zhuo wrote: > > xsk wakeup is used to trigger the logic for xsk xmit by xsk framework or > user. > > Virtio-Net does not support to actively generate an interruption, so it > tries to trigger tx NAPI on the tx interrupt cpu. > > Consider the effect of cache.

Re: [PATCH net-next v1 11/19] virtio_net: xsk: tx: support tx

2023-10-20 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:01 PM Xuan Zhuo wrote: > > The driver's tx napi is very important for XSK. It is responsible for > obtaining data from the XSK queue and sending it out. > > At the beginning, we need to trigger tx napi. > > Signed-off-by: Xuan Zhuo > --- > drivers/net/virtio/main.c

Re: [PATCH net-next v1 10/19] virtio_net: xsk: prevent disable tx napi

2023-10-20 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:01 PM Xuan Zhuo wrote: > > Since xsk's TX queue is consumed by TX NAPI, if sq is bound to xsk, then > we must stop tx napi from being disabled. > > Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Thanks > --- > drivers/net/virtio/main.c | 10

Re: [PATCH net-next v1 09/19] virtio_net: xsk: bind/unbind xsk

2023-10-20 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:01 PM Xuan Zhuo wrote: > > This patch implement the logic of bind/unbind xsk pool to sq and rq. > > Signed-off-by: Xuan Zhuo > --- > drivers/net/virtio/Makefile | 2 +- > drivers/net/virtio/main.c | 10 +- > drivers/net/virtio/virtio_net.h | 18 >

Re: [PATCH net-next v1 08/19] virtio_net: sq support premapped mode

2023-10-20 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:01 PM Xuan Zhuo wrote: > > If the xsk is enabling, the xsk tx will share the send queue. > But the xsk requires that the send queue use the premapped mode. > So the send queue must support premapped mode. > > Signed-off-by: Xuan Zhuo > --- > drivers/net/virtio/main.c

Re: [PATCH 2/4] vhost-vdpa: reset vendor specific mapping to initial state in .release

2023-10-19 Thread Jason Wang
On Fri, Oct 20, 2023 at 6:28 AM Si-Wei Liu wrote: > > > > On 10/19/2023 7:39 AM, Eugenio Perez Martin wrote: > > On Thu, Oct 19, 2023 at 10:27 AM Jason Wang wrote: > >> On Thu, Oct 19, 2023 at 2:47 PM Si-Wei Liu wrote: > >>> > >>> > >

Re: [PATCH 2/4] vhost-vdpa: reset vendor specific mapping to initial state in .release

2023-10-19 Thread Jason Wang
On Thu, Oct 19, 2023 at 2:47 PM Si-Wei Liu wrote: > > > > On 10/18/2023 7:53 PM, Jason Wang wrote: > > On Wed, Oct 18, 2023 at 4:49 PM Si-Wei Liu wrote: > >> > >> > >> On 10/18/2023 12:00 AM, Jason Wang wrote: > >>>> Unfortunat

Re: [PATCH net-next v1 07/19] virtio_net: separate virtnet_tx_resize()

2023-10-19 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:00 PM Xuan Zhuo wrote: > > This patch separates two sub-functions from virtnet_tx_resize(): > > * virtnet_tx_pause > * virtnet_tx_resume > > Then the subsequent virtnet_tx_reset() can share these two functions. > > Signed-off-by: Xuan Zhuo Ac

Re: [PATCH net-next v1 06/19] virtio_net: separate virtnet_rx_resize()

2023-10-19 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:00 PM Xuan Zhuo wrote: > > This patch separates two sub-functions from virtnet_rx_resize(): > > * virtnet_rx_pause > * virtnet_rx_resume > > Then the subsequent reset rx for xsk can share these two functions. > > Signed-off-by: Xuan Zhuo Ac

Re: [PATCH net-next v1 05/19] virtio_net: add prefix virtnet to all struct/api inside virtio_net.h

2023-10-19 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:01 PM Xuan Zhuo wrote: > > We move some structures and APIs to the header file, but these > structures and APIs do not prefixed with virtnet. This patch adds > virtnet for these. What's the benefit of doing this? AFAIK virtio-net is the only user for virtio-net.h?

Re: [PATCH net-next v1 04/19] virtio_net: move to virtio_net.h

2023-10-19 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:00 PM Xuan Zhuo wrote: > > Move some structure definitions and inline functions into the > virtio_net.h file. Some of the functions are not inline one before the moving. I'm not sure what's the criteria to choose the function to be moved. > > Signed-off-by: Xuan Zhuo

Re: [PATCH net-next v1 03/19] virtio_net: independent directory

2023-10-19 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:01 PM Xuan Zhuo wrote: > > Create a separate directory for virtio-net. AF_XDP support will be added > later, then a separate xsk.c file will be added, so we should create a > directory for virtio-net. > > Signed-off-by: Xuan Zhuo Acked-by: J

Re: [PATCH net-next v1 02/19] virtio_net: unify the code for recycling the xmit ptr

2023-10-18 Thread Jason Wang
er old xmit ptr. > > Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Thanks > --- > drivers/net/virtio_net.c | 76 +--- > 1 file changed, 33 insertions(+), 43 deletions(-) > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c >

Re: [PATCH net-next v1 01/19] virtio_net: rename free_old_xmit_skbs to free_old_xmit

2023-10-18 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:00 PM Xuan Zhuo wrote: > > Since free_old_xmit_skbs not only deals with skb, but also xdp frame and > subsequent added xsk, so change the name of this function to > free_old_xmit. > > Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Thanks &g

Re: [PATCH 2/4] vhost-vdpa: reset vendor specific mapping to initial state in .release

2023-10-18 Thread Jason Wang
On Wed, Oct 18, 2023 at 4:49 PM Si-Wei Liu wrote: > > > > On 10/18/2023 12:00 AM, Jason Wang wrote: > >> Unfortunately, it's a must to stick to ABI. I agree it's a mess but we > >> don't have a better choice. Or we can fail the probe if userspace > >> doesn'

Re: [PATCH 2/4] vhost-vdpa: reset vendor specific mapping to initial state in .release

2023-10-18 Thread Jason Wang
On Thu, Oct 19, 2023 at 7:21 AM Si-Wei Liu wrote: > > > > On 10/18/2023 4:14 AM, Eugenio Perez Martin wrote: > > On Wed, Oct 18, 2023 at 10:44 AM Si-Wei Liu wrote: > >> > >> > >> On 10/17/2023 10:27 PM, Jason Wang wrote: > >&g

Re: [PATCH 2/4] vhost-vdpa: reset vendor specific mapping to initial state in .release

2023-10-18 Thread Jason Wang
On Wed, Oct 18, 2023 at 1:27 PM Jason Wang wrote: > > On Wed, Oct 18, 2023 at 12:36 PM Si-Wei Liu wrote: > > > > > > > > On 10/16/2023 7:35 PM, Jason Wang wrote: > > > On Tue, Oct 17, 2023 at 4:30 AM Si-Wei Liu wrote: > > >> > > &g

Re: [PATCH 2/4] vhost-vdpa: reset vendor specific mapping to initial state in .release

2023-10-17 Thread Jason Wang
On Wed, Oct 18, 2023 at 12:36 PM Si-Wei Liu wrote: > > > > On 10/16/2023 7:35 PM, Jason Wang wrote: > > On Tue, Oct 17, 2023 at 4:30 AM Si-Wei Liu wrote: > >> > >> > >> On 10/16/2023 4:28 AM, Eugenio Perez Martin wrote: > >>> On Mon, Oct

Re: [PATCH net-next v1 00/19] virtio-net: support AF_XDP zero copy

2023-10-17 Thread Jason Wang
On Wed, Oct 18, 2023 at 11:38 AM Xuan Zhuo wrote: > > On Tue, 17 Oct 2023 19:19:41 +0800, Xuan Zhuo > wrote: > > On Tue, 17 Oct 2023 14:43:33 +0800, Xuan Zhuo > > wrote: > > > On Tue, 17 Oct 2023 14:26:01 +0800, Jason Wang > > > wrote: > >

Re: [PATCH net-next v1 00/19] virtio-net: support AF_XDP zero copy

2023-10-17 Thread Jason Wang
On Tue, Oct 17, 2023 at 7:28 PM Xuan Zhuo wrote: > > On Tue, 17 Oct 2023 14:43:33 +0800, Xuan Zhuo > wrote: > > On Tue, 17 Oct 2023 14:26:01 +0800, Jason Wang wrote: > > > On Tue, Oct 17, 2023 at 2:17 PM Xuan Zhuo > > > wrote: > > > > > >

Re: [PATCH net-next v1 00/19] virtio-net: support AF_XDP zero copy

2023-10-17 Thread Jason Wang
On Tue, Oct 17, 2023 at 3:00 PM Xuan Zhuo wrote: > > On Tue, 17 Oct 2023 14:26:01 +0800, Jason Wang wrote: > > On Tue, Oct 17, 2023 at 2:17 PM Xuan Zhuo > > wrote: > > > > > > On Tue, 17 Oct 2023 13:27:47 +0800, Jason Wang > > > wrote: > &

Re: [PATCH net-next v1 00/19] virtio-net: support AF_XDP zero copy

2023-10-17 Thread Jason Wang
On Tue, Oct 17, 2023 at 2:17 PM Xuan Zhuo wrote: > > On Tue, 17 Oct 2023 13:27:47 +0800, Jason Wang wrote: > > On Tue, Oct 17, 2023 at 11:28 AM Jason Wang wrote: > > > > > > On Tue, Oct 17, 2023 at 11:26 AM Xuan Zhuo > > > wrote: > > > > >

Re: [PATCH net-next v1 00/19] virtio-net: support AF_XDP zero copy

2023-10-16 Thread Jason Wang
On Tue, Oct 17, 2023 at 11:28 AM Jason Wang wrote: > > On Tue, Oct 17, 2023 at 11:26 AM Xuan Zhuo wrote: > > > > On Tue, 17 Oct 2023 11:20:41 +0800, Jason Wang wrote: > > > On Tue, Oct 17, 2023 at 11:11 AM Xuan Zhuo > > > wrote: > > > > > &

Re: [PATCH net-next v1 00/19] virtio-net: support AF_XDP zero copy

2023-10-16 Thread Jason Wang
On Tue, Oct 17, 2023 at 11:26 AM Xuan Zhuo wrote: > > On Tue, 17 Oct 2023 11:20:41 +0800, Jason Wang wrote: > > On Tue, Oct 17, 2023 at 11:11 AM Xuan Zhuo > > wrote: > > > > > > On Tue, 17 Oct 2023 10:53:44 +0800, Jason Wang > > > wrote: >

Re: [PATCH net-next v1 00/19] virtio-net: support AF_XDP zero copy

2023-10-16 Thread Jason Wang
On Tue, Oct 17, 2023 at 11:11 AM Xuan Zhuo wrote: > > On Tue, 17 Oct 2023 10:53:44 +0800, Jason Wang wrote: > > On Mon, Oct 16, 2023 at 8:00 PM Xuan Zhuo > > wrote: > > > > > > ## AF_XDP > > > > > > XDP socket(AF_XDP) is an excellent bypas

Re: [PATCH net-next v1 00/19] virtio-net: support AF_XDP zero copy

2023-10-16 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:00 PM Xuan Zhuo wrote: > > ## AF_XDP > > XDP socket(AF_XDP) is an excellent bypass kernel network framework. The zero > copy feature of xsk (XDP socket) needs to be supported by the driver. The > performance of zero copy is very good. mlx5 and intel ixgbe already support

Re: [RFC PATCH v2 1/7] bpf: Introduce BPF_PROG_TYPE_VNET_HASH

2023-10-16 Thread Jason Wang
On Tue, Oct 17, 2023 at 7:53 AM Alexei Starovoitov wrote: > > On Sun, Oct 15, 2023 at 10:10 AM Akihiko Odaki > wrote: > > > > On 2023/10/16 1:07, Alexei Starovoitov wrote: > > > On Sun, Oct 15, 2023 at 7:17 AM Akihiko Odaki > > > wrote: > > >> > > >> diff --git a/include/uapi/linux/bpf.h

Re: [PATCH 2/4] vhost-vdpa: reset vendor specific mapping to initial state in .release

2023-10-16 Thread Jason Wang
On Tue, Oct 17, 2023 at 4:30 AM Si-Wei Liu wrote: > > > > On 10/16/2023 4:28 AM, Eugenio Perez Martin wrote: > > On Mon, Oct 16, 2023 at 8:33 AM Jason Wang wrote: > >> On Fri, Oct 13, 2023 at 3:36 PM Si-Wei Liu wrote: > >>> > >>> > >>&

Re: [PATCH 2/4] vhost-vdpa: reset vendor specific mapping to initial state in .release

2023-10-16 Thread Jason Wang
On Fri, Oct 13, 2023 at 3:36 PM Si-Wei Liu wrote: > > > > On 10/12/2023 8:01 PM, Jason Wang wrote: > > On Tue, Oct 10, 2023 at 5:05 PM Si-Wei Liu wrote: > >> Devices with on-chip IOMMU or vendor specific IOTLB implementation > >> may need to restore iotlb map

Re: [PATCH 1/4] vdpa: introduce .reset_map operation callback

2023-10-15 Thread Jason Wang
On Fri, Oct 13, 2023 at 3:36 PM Si-Wei Liu wrote: > > > > On 10/12/2023 7:49 PM, Jason Wang wrote: > > On Tue, Oct 10, 2023 at 5:05 PM Si-Wei Liu wrote: > >> Device specific IOMMU parent driver who wishes to see mapping to be > >> decoupled from virtio or

Re: [PATCH 4/4] vdpa/mlx5: implement .reset_map driver op

2023-10-12 Thread Jason Wang
On Tue, Oct 10, 2023 at 5:05 PM Si-Wei Liu wrote: > > Since commit 6f5312f80183 ("vdpa/mlx5: Add support for running with > virtio_vdpa"), mlx5_vdpa starts with preallocate 1:1 DMA MR at device > creation time. This 1:1 DMA MR will be implicitly destroyed while > the first .set_map call is

Re: [PATCH 2/4] vhost-vdpa: reset vendor specific mapping to initial state in .release

2023-10-12 Thread Jason Wang
On Tue, Oct 10, 2023 at 5:05 PM Si-Wei Liu wrote: > > Devices with on-chip IOMMU or vendor specific IOTLB implementation > may need to restore iotlb mapping to the initial or default state > using the .reset_map op, as it's desirable for some parent devices > to solely manipulate mappings by its

Re: [PATCH 1/4] vdpa: introduce .reset_map operation callback

2023-10-12 Thread Jason Wang
a > * Returns integer: success (0) or error (< 0) > + * @reset_map: Reset device memory mapping to the default > + * state (optional) I think we need to mention that this is a must for parents that use set_m

Re: [PATCH net-next 0/5] virtio-net: support dynamic coalescing moderation

2023-10-12 Thread Jason Wang
On Thu, Oct 12, 2023 at 4:29 PM Jason Wang wrote: > > On Thu, Oct 12, 2023 at 3:44 PM Heng Qi wrote: > > > > Now, virtio-net already supports per-queue moderation parameter > > setting. Based on this, we use the netdim library of linux to support > > dynamic coales

Re: Report a possible vhost bug in stable branches

2023-10-12 Thread Jason Wang
On Thu, Oct 12, 2023 at 6:44 PM Xianting Tian wrote: > > > 在 2023/10/12 下午3:55, Jason Wang 写道: > > On Thu, Oct 12, 2023 at 9:43 AM Xianting Tian > > wrote: > >> cgroup attach work and dev flush work will both be added to dev work > >> list in vh

Re: [PATCH net-next 0/5] virtio-net: support dynamic coalescing moderation

2023-10-12 Thread Jason Wang
On Thu, Oct 12, 2023 at 3:44 PM Heng Qi wrote: > > Now, virtio-net already supports per-queue moderation parameter > setting. Based on this, we use the netdim library of linux to support > dynamic coalescing moderation for virtio-net. > > Due to hardware scheduling issues, we only tested rx dim.

Re: Report a possible vhost bug in stable branches

2023-10-12 Thread Jason Wang
On Thu, Oct 12, 2023 at 9:43 AM Xianting Tian wrote: > > cgroup attach work and dev flush work will both be added to dev work > list in vhost_attach_cgroups() when set dev owner: > static int vhost_attach_cgroups(struct vhost_dev *dev) > { > struct

Re: [PATCH vhost 00/22] virtio-net: support AF_XDP zero copy

2023-10-12 Thread Jason Wang
On Thu, Oct 12, 2023 at 9:58 AM Xuan Zhuo wrote: > > On Wed, 11 Oct 2023 10:00:57 -0700, Jakub Kicinski wrote: > > On Wed, 11 Oct 2023 17:27:06 +0800 Xuan Zhuo wrote: > > > ## AF_XDP > > > > > > XDP socket(AF_XDP) is an excellent bypass kernel network framework. The > > > zero > > > copy

Re: [PATCH vhost v3 3/4] virtio_pci: add check for common cfg size

2023-10-10 Thread Jason Wang
On Tue, Oct 10, 2023 at 3:58 PM Xuan Zhuo wrote: > > On Tue, 10 Oct 2023 14:41:39 +0800, Jason Wang wrote: > > On Tue, Oct 10, 2023 at 11:11 AM Xuan Zhuo > > wrote: > > > > > > Some buggy devices, the common cfg size may not match the features. > > >

Re: [RFC PATCH 5/7] tun: Introduce virtio-net hashing feature

2023-10-10 Thread Jason Wang
On Tue, Oct 10, 2023 at 2:19 PM Akihiko Odaki wrote: > > On 2023/10/10 15:00, Jason Wang wrote: > > On Tue, Oct 10, 2023 at 1:51 PM Akihiko Odaki > > wrote: > >> > >> On 2023/10/10 14:45, Jason Wang wrote: > >>> On Tue, Oct 10, 2023 at 9:52 AM Ak

Re: [PATCH 2/2] virtio-mmio: Support multiple interrupts per device

2023-10-10 Thread Jason Wang
On Sat, Sep 30, 2023 at 4:46 AM Jakub Sitnicki wrote: > > Some virtual devices, such as the virtio network device, can use multiple > virtqueues (or multiple pairs of virtqueues in the case of a vNIC). In such > case, when there are multiple vCPUs present, it is possible to process > virtqueue

Re: [PATCH vhost v3 1/4] virtio: add definition of VIRTIO_F_NOTIF_CONFIG_DATA feature bit

2023-10-10 Thread Jason Wang
n available buffer notifications. > > It comes from here: > https://github.com/oasis-tcs/virtio-spec/issues/89 > > Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Thanks > --- > include/uapi/linux/virtio_config.h | 5 + > 1 file changed, 5 insertions(+) > > diff --git a

Re: [PATCH vhost v3 2/4] virtio_pci: fix the common cfg map size

2023-10-10 Thread Jason Wang
tio_pci_common_cfg, but some feature(such > as the _F_RING_RESET) needs the virtio_pci_modern_common_cfg, so this > commit changes the size to the size of virtio_pci_modern_common_cfg. > > Fixes: 0b50cece0b78 ("virtio_pci: introduce helper to get/set queue reset") > Sign

Re: [PATCH vhost v3 3/4] virtio_pci: add check for common cfg size

2023-10-10 Thread Jason Wang
On Tue, Oct 10, 2023 at 11:11 AM Xuan Zhuo wrote: > > Some buggy devices, the common cfg size may not match the features. > > This patch checks the common cfg size for the > features(VIRTIO_F_NOTIF_CONFIG_DATA, VIRTIO_F_RING_RESET). When the > common cfg size does not match the corresponding

Re: [PATCH vhost v3 16/16] vdpa/mlx5: Update cvq iotlb mapping on ASID change

2023-10-10 Thread Jason Wang
; > This patch adds support for the above mentioned flow by saving the iotlb > on each .set_map and updating the cvq iotlb with it on a cvq group change. > > Acked-by: Eugenio Pérez > Signed-off-by: Dragos Tatulea > --- Acked-by: Jason Wang Thanks __

Re: [PATCH vhost v3 15/16] vdpa/mlx5: Make iotlb helper functions more generic

2023-10-10 Thread Jason Wang
On Mon, Oct 9, 2023 at 7:25 PM Dragos Tatulea wrote: > > They will be used in a follow-up patch. > > For dup_iotlb, avoid the src == dst case. This is an error. > > Acked-by: Eugenio Pérez > Signed-off-by: Dragos Tatulea Acked-by

Re: [PATCH vhost v3 14/16] vdpa/mlx5: Enable hw support for vq descriptor mapping

2023-10-10 Thread Jason Wang
on > for ASID 1. > > This patch fills in both the vq data and vq descriptor mkeys based on > group ASID mapping. > > The feature is signaled to the vdpa core through the presence of the > .get_vq_desc_group op. > > Acked-by: Eugenio Pérez > Signed-off-by: D

Re: [PATCH vhost v3 13/16] vdpa/mlx5: Introduce mr for vq descriptor

2023-10-10 Thread Jason Wang
ll add hardware support for mapping the vq descriptors. > > Acked-by: Eugenio Pérez > Signed-off-by: Dragos Tatulea > --- Acked-by: Jason Wang Thanks ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.

Re: [PATCH vhost v3 12/16] vdpa/mlx5: Improve mr update flow

2023-10-10 Thread Jason Wang
be NULL when not initialized. > > Acked-by: Eugenio Pérez > Signed-off-by: Dragos Tatulea > --- Acked-by: Jason Wang Thanks ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH vhost v3 11/16] vdpa/mlx5: Move mr mutex out of mr struct

2023-10-10 Thread Jason Wang
e appropriate name. > > Signed-off-by: Dragos Tatulea > Acked-by: Eugenio Pérez Acked-by: Jason Wang Thanks ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH vhost v3 10/16] vdpa/mlx5: Allow creation/deletion of any given mr struct

2023-10-10 Thread Jason Wang
parameter anymore. The > check is done in the caller instead (mlx5_set_map). > > This change is needed for a followup patch which will introduce an > additional mr for the vq descriptor data. > > Signed-off-by: Dragos Tatulea > Acked-by: Eugeni

Re: [RFC PATCH 5/7] tun: Introduce virtio-net hashing feature

2023-10-10 Thread Jason Wang
On Tue, Oct 10, 2023 at 1:51 PM Akihiko Odaki wrote: > > On 2023/10/10 14:45, Jason Wang wrote: > > On Tue, Oct 10, 2023 at 9:52 AM Akihiko Odaki > > wrote: > >> > >> On 2023/10/09 19:44, Willem de Bruijn wrote: > >>> On Mon, Oc

Re: [RFC PATCH 5/7] tun: Introduce virtio-net hashing feature

2023-10-09 Thread Jason Wang
On Tue, Oct 10, 2023 at 9:52 AM Akihiko Odaki wrote: > > On 2023/10/09 19:44, Willem de Bruijn wrote: > > On Mon, Oct 9, 2023 at 3:12 AM Akihiko Odaki > > wrote: > >> > >> On 2023/10/09 19:06, Willem de Bruijn wrote: > >>> On Mon, Oct 9, 2023 at 3:02 AM Akihiko Odaki > >>> wrote: > >

Re: [PATCH 09/16] vdpa/mlx5: Allow creation/deletion of any given mr struct

2023-10-09 Thread Jason Wang
On Sun, Oct 8, 2023 at 8:05 PM Dragos Tatulea wrote: > > On Sun, 2023-10-08 at 12:25 +0800, Jason Wang wrote: > > On Tue, Sep 26, 2023 at 3:21 PM Dragos Tatulea wrote: > > > > > > On Tue, 2023-09-26 at 12:44 +0800, Jason Wang wrote: > > > > On T

Re: [PATCH] vduse: make vduse_class constant

2023-10-07 Thread Jason Wang
ated at runtime. > > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Xuan Zhuo > Cc: Xie Yongji > Signed-off-by: Greg Kroah-Hartman Acked-by: Jason Wang Thanks > --- > drivers/vdpa/vdpa_user/vduse_dev.c | 40 -- > 1 file

Re: [PATCH net-next v4 2/2] virtio-net: add cond_resched() to the command waiting loop

2023-10-07 Thread Jason Wang
gt; On Fri, Jul 21, 2023 at 04:37:00PM +0200, Maxime Coquelin wrote: > >>>>>> > >>>>>> > >>>>>> On 7/20/23 23:02, Michael S. Tsirkin wrote: > >>>>>>> On Thu, Jul 20, 2023 at 01:26:20PM -0700, Shannon Nelson wrote: > >>

Re: [PATCH net v2 5/6] virtio-net: fix the vq coalescing setting for vq resize

2023-10-07 Thread Jason Wang
*/ > >> +err = virtnet_send_ctrl_coal_vq_cmd(vi, txq2vq(i), > >> + > >> vi->intr_coal_tx.max_usecs, > >> + > >> vi

Re: [PATCH net v2 4/6] virtio-net: fix per queue coalescing parameter setting

2023-10-07 Thread Jason Wang
ot;) > Reported-by: Xiaoming Zhao > Cc: Gavin Li > Signed-off-by: Heng Qi Acked-by: Jason Wang Thanks > --- > v1->v2: > 1. Remove useless comments. > > drivers/net/virtio_net.c | 36 > 1 file changed, 16 insertions(+), 2

Re: [RFC v2 3/4] vduse: update the vq_info in ioctl

2023-10-07 Thread Jason Wang
On Fri, Sep 29, 2023 at 5:12 PM Maxime Coquelin wrote: > > > > On 9/12/23 09:39, Jason Wang wrote: > > On Tue, Sep 12, 2023 at 11:00 AM Cindy Lu wrote: > >> > >> In VDUSE_VQ_GET_INFO, the driver will sync the last_avail_idx > >> with reconnect info, A

Re: [PATCH vhost] virtio_net: fix the missing of the dma cpu sync

2023-10-07 Thread Jason Wang
ffers") > Reported-by: Michael Roth > Closes: http://lore.kernel.org/all/20230926130451.axgodaa6tvwqs...@amd.com > Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Thanks > --- > drivers/net/virtio_net.c | 14 +++--- > 1 file changed, 7 insertions(+), 7 deletions(-) &g

Re: [PATCH 1/2] tools/virtio: Add dma sync api for virtio test

2023-10-07 Thread Jason Wang
On Tue, Sep 26, 2023 at 1:00 PM wrote: > > From: Liming Wu > > Fixes: 8bd2f71054bd ("virtio_ring: introduce dma sync api for virtqueue") > also add dma sync api for virtio test. > > Signed-off-by: Liming Wu Acked-by: Jason Wang Thanks > --- >

Re: [PATCH 2/2] tools/virtio: Add hints when module is not installed

2023-10-07 Thread Jason Wang
On Tue, Sep 26, 2023 at 1:00 PM wrote: > > From: Liming Wu > > Need to insmod vhost_test.ko before run virtio_test. > Give some hints to users. > > Signed-off-by: Liming Wu > --- > tools/virtio/virtio_test.c | 4 > 1 file changed, 4 insertions(+) > > diff --git

Re: [PATCH 2/2] virtio_pci: add build offset check for the new common cfg items

2023-10-07 Thread Jason Wang
On Mon, Sep 25, 2023 at 11:58 AM Xuan Zhuo wrote: > > Add checks to the check_offsets(void) for queue_notify_data and > queue_reset. > > Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Thanks > --- > drivers/virtio/virtio_pci_modern_dev.c | 4 > 1 file changed,

Re: [PATCH 1/2] virtio_pci: fix the common map size and add check for vq-reset

2023-10-07 Thread Jason Wang
On Mon, Sep 25, 2023 at 11:58 AM Xuan Zhuo wrote: > > Now, the function vp_modern_map_capability() takes the size parameter, > which corresponds to the size of virtio_pci_common_cfg. As a result, the > pci_iomap_range() function maps the memory area for > virtio_pci_common_cfg. > > However, if

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-10-07 Thread Jason Wang
On Tue, Sep 26, 2023 at 7:49 PM Michael S. Tsirkin wrote: > > On Tue, Sep 26, 2023 at 10:32:39AM +0800, Jason Wang wrote: > > It's the implementation details in legacy. The device needs to make > > sure (reset) the driver can work (is done before get_status return). > &

Re: [PATCH 09/16] vdpa/mlx5: Allow creation/deletion of any given mr struct

2023-10-07 Thread Jason Wang
On Tue, Sep 26, 2023 at 3:21 PM Dragos Tatulea wrote: > > On Tue, 2023-09-26 at 12:44 +0800, Jason Wang wrote: > > On Tue, Sep 12, 2023 at 9:02 PM Dragos Tatulea wrote: > > > > > > This patch adapts the mr creation/deletion code to be able to work with > >

Re: [PATCH 09/16] vdpa/mlx5: Allow creation/deletion of any given mr struct

2023-09-25 Thread Jason Wang
On Tue, Sep 12, 2023 at 9:02 PM Dragos Tatulea wrote: > > This patch adapts the mr creation/deletion code to be able to work with > any given mr struct pointer. All the APIs are adapted to take an extra > parameter for the mr. > > mlx5_vdpa_create/delete_mr doesn't need a ASID parameter anymore.

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-25 Thread Jason Wang
On Mon, Sep 25, 2023 at 8:26 PM Jason Gunthorpe wrote: > > On Mon, Sep 25, 2023 at 10:34:54AM +0800, Jason Wang wrote: > > > > Cloud vendors will similarly use DPUs to create a PCI functions that > > > meet the cloud vendor's internal specification. > > >

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-25 Thread Jason Wang
On Tue, Sep 26, 2023 at 11:45 AM Parav Pandit wrote: > > > > > From: Michael S. Tsirkin > > Sent: Tuesday, September 26, 2023 12:06 AM > > > One can thinkably do that wait in hardware, though. Just defer completion > > until > > read is done. > > > Once OASIS does such new interface and if some

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-25 Thread Jason Wang
On Tue, Sep 26, 2023 at 12:01 PM Parav Pandit wrote: > > > > > From: Jason Wang > > Sent: Tuesday, September 26, 2023 8:03 AM > > > > It's the implementation details in legacy. The device needs to make sure > > (reset) > > the driver can work (is

  1   2   3   4   5   6   7   8   9   10   >