Re: [External] Re: [RFC v2 09/13] vduse: Add support for processing vhost iotlb message

2020-12-23 Thread Jason Wang
On 2020/12/23 下午8:14, Yongji Xie wrote: On Wed, Dec 23, 2020 at 5:05 PM Jason Wang wrote: On 2020/12/22 下午10:52, Xie Yongji wrote: To support vhost-vdpa bus driver, we need a way to share the vhost-vdpa backend process's memory with the userspace VDUSE process. This patch tries to

Re: [RFC v2 06/13] vduse: Introduce VDUSE - vDPA Device in Userspace

2020-12-23 Thread Jason Wang
On 2020/12/23 下午10:17, Yongji Xie wrote: On Wed, Dec 23, 2020 at 4:08 PM Jason Wang wrote: On 2020/12/22 下午10:52, Xie Yongji wrote: This VDUSE driver enables implementing vDPA devices in userspace. Both control path and data path of vDPA devices will be able to be handled in userspace. In

Re: [PATCH net v4 2/2] vhost_net: fix tx queue stuck when sendmsg fails

2020-12-23 Thread Jason Wang
On 2020/12/24 上午10:25, wangyunjian wrote: From: Yunjian Wang Currently the driver doesn't drop a packet which can't be sent by tun (e.g bad packet). In this case, the driver will always process the same packet lead to the tx queue stuck. To fix this issue: 1. in the case of persistent failur

Re: [PATCH net v4 2/2] vhost_net: fix tx queue stuck when sendmsg fails

2020-12-23 Thread Jason Wang
On 2020/12/24 下午12:37, wangyunjian wrote: -Original Message- From: Jason Wang [mailto:jasow...@redhat.com] Sent: Thursday, December 24, 2020 11:10 AM To: wangyunjian ; netdev@vger.kernel.org; m...@redhat.com; willemdebruijn.ker...@gmail.com Cc: virtualizat...@lists.linux-foundation.org

Re: [PATCH net v4 2/2] vhost_net: fix tx queue stuck when sendmsg fails

2020-12-24 Thread Jason Wang
On 2020/12/24 下午5:09, wangyunjian wrote: -EAGAIN and -ENOBFS are fine. But I don't see how -ENOMEM can be returned. The tun_build_skb() and tun_napi_alloc_frags() return -ENOMEM when memory allocation fails. Thanks You're right. So I think we need check them all. In the future, we need th

Re: [PATCH net v2] tun: fix return value when the number of iovs exceeds MAX_SKB_FRAGS

2020-12-24 Thread Jason Wang
(); skb = napi_get_frags(&tfile->napi); Acked-by: Jason Wang

Re: [PATCH net v4 1/2] vhost_net: fix ubuf refcount incorrectly when sendmsg fails

2020-12-24 Thread Jason Wang
issue, we only call vhost_net_ubuf_put() when vq->heads[nvq->desc].len == VHOST_DMA_IN_PROGRESS. Fixes: 0690899b4d45 ("tun: experimental zero copy tx support") Signed-off-by: Yunjian Wang Acked-by: Willem de Bruijn Acked-by: Michael S. Tsirkin Acked-by: Jason Wang --- dri

Re: [RFC v2 09/13] vduse: Add support for processing vhost iotlb message

2020-12-24 Thread Jason Wang
On 2020/12/24 下午3:37, Yongji Xie wrote: On Thu, Dec 24, 2020 at 10:41 AM Jason Wang wrote: On 2020/12/23 下午8:14, Yongji Xie wrote: On Wed, Dec 23, 2020 at 5:05 PM Jason Wang wrote: On 2020/12/22 下午10:52, Xie Yongji wrote: To support vhost-vdpa bus driver, we need a way to share the

Re: [RFC v2 06/13] vduse: Introduce VDUSE - vDPA Device in Userspace

2020-12-24 Thread Jason Wang
On 2020/12/24 下午4:34, Yongji Xie wrote: Yes, the disadvantage is the performance. But it should be simpler (I guess) and we know it can succeed. Yes, another advantage is that we can support the VM using anonymous memory. Exactly. I think I can try this in v3. And the MMU-based IOMMU

Re: [RFC v2 09/13] vduse: Add support for processing vhost iotlb message

2020-12-24 Thread Jason Wang
On 2020/12/25 上午10:37, Yongji Xie wrote: On Thu, Dec 24, 2020 at 3:37 PM Yongji Xie wrote: On Thu, Dec 24, 2020 at 10:41 AM Jason Wang wrote: On 2020/12/23 下午8:14, Yongji Xie wrote: On Wed, Dec 23, 2020 at 5:05 PM Jason Wang wrote: On 2020/12/22 下午10:52, Xie Yongji wrote: To support

Re: [RFC v2 09/13] vduse: Add support for processing vhost iotlb message

2020-12-27 Thread Jason Wang
On 2020/12/25 下午6:31, Yongji Xie wrote: On Fri, Dec 25, 2020 at 2:58 PM Jason Wang wrote: On 2020/12/24 下午3:37, Yongji Xie wrote: On Thu, Dec 24, 2020 at 10:41 AM Jason Wang wrote: On 2020/12/23 下午8:14, Yongji Xie wrote: On Wed, Dec 23, 2020 at 5:05 PM Jason Wang wrote: On 2020/12/22

Re: [RFC v2 09/13] vduse: Add support for processing vhost iotlb message

2020-12-28 Thread Jason Wang
On 2020/12/28 下午4:14, Yongji Xie wrote: I see. So all the above two questions are because VHOST_IOTLB_INVALIDATE is expected to be synchronous. This need to be solved by tweaking the current VDUSE API or we can re-visit to go with descriptors relaying first. Actually all vdpa related operatio

Re: [RFC v2 09/13] vduse: Add support for processing vhost iotlb message

2020-12-29 Thread Jason Wang
- Original Message - > On Mon, Dec 28, 2020 at 4:43 PM Jason Wang wrote: > > > > > > On 2020/12/28 下午4:14, Yongji Xie wrote: > > >> I see. So all the above two questions are because VHOST_IOTLB_INVALIDATE > > >> is expected to be synchr

Re: [PATCH rfc 2/3] virtio-net: support receive timestamp

2020-12-29 Thread Jason Wang
- Original Message - > On Mon, Dec 28, 2020 at 7:55 PM Michael S. Tsirkin wrote: > > > > On Mon, Dec 28, 2020 at 02:30:31PM -0500, Willem de Bruijn wrote: > > > On Mon, Dec 28, 2020 at 12:29 PM Michael S. Tsirkin > > > wrote: > > > > > > > > On Mon, Dec 28, 2020 at 11:22:32AM -0500, Wi

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

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

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

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

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

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

Re: [RFC v2 09/13] vduse: Add support for processing vhost iotlb message

2020-12-29 Thread Jason Wang
On 2020/12/29 下午6:26, Yongji Xie wrote: On Tue, Dec 29, 2020 at 5:11 PM Jason Wang wrote: - Original Message - On Mon, Dec 28, 2020 at 4:43 PM Jason Wang wrote: On 2020/12/28 下午4:14, Yongji Xie wrote: I see. So all the above two questions are because VHOST_IOTLB_INVALIDATE is

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

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

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

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

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

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

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

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

Re: [PATCH rfc 2/3] virtio-net: support receive timestamp

2020-12-30 Thread Jason Wang
On 2020/12/29 下午10:20, Willem de Bruijn wrote: On Tue, Dec 29, 2020 at 4:23 AM Jason Wang wrote: - Original Message - On Mon, Dec 28, 2020 at 7:55 PM Michael S. Tsirkin wrote: On Mon, Dec 28, 2020 at 02:30:31PM -0500, Willem de Bruijn wrote: On Mon, Dec 28, 2020 at 12:29 PM

Re: [RFC v2 09/13] vduse: Add support for processing vhost iotlb message

2020-12-30 Thread Jason Wang
On 2020/12/30 下午3:09, Yongji Xie wrote: On Wed, Dec 30, 2020 at 2:11 PM Jason Wang wrote: On 2020/12/29 下午6:26, Yongji Xie wrote: On Tue, Dec 29, 2020 at 5:11 PM Jason Wang wrote: - Original Message - On Mon, Dec 28, 2020 at 4:43 PM Jason Wang wrote: On 2020/12/28 下午4:14

Re: [PATCH rfc 2/3] virtio-net: support receive timestamp

2020-12-30 Thread Jason Wang
On 2020/12/29 上午8:57, Willem de Bruijn wrote: On Mon, Dec 28, 2020 at 5:59 PM Jakub Kicinski wrote: On Mon, 28 Dec 2020 11:22:32 -0500 Willem de Bruijn wrote: From: Willem de Bruijn Add optional PTP hardware timestamp offload for virtio-net. Accurate RTT measurement requires timestamps cl

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

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

Re: [RFC v2 09/13] vduse: Add support for processing vhost iotlb message

2020-12-30 Thread Jason Wang
On 2020/12/30 下午6:12, Yongji Xie wrote: On Wed, Dec 30, 2020 at 4:41 PM Jason Wang wrote: On 2020/12/30 下午3:09, Yongji Xie wrote: On Wed, Dec 30, 2020 at 2:11 PM Jason Wang wrote: On 2020/12/29 下午6:26, Yongji Xie wrote: On Tue, Dec 29, 2020 at 5:11 PM Jason Wang wrote: - Original

Re: [RFC v2 09/13] vduse: Add support for processing vhost iotlb message

2020-12-30 Thread Jason Wang
On 2020/12/31 下午1:15, Yongji Xie wrote: On Thu, Dec 31, 2020 at 10:49 AM Jason Wang wrote: On 2020/12/30 下午6:12, Yongji Xie wrote: On Wed, Dec 30, 2020 at 4:41 PM Jason Wang wrote: On 2020/12/30 下午3:09, Yongji Xie wrote: On Wed, Dec 30, 2020 at 2:11 PM Jason Wang wrote: On 2020/12/29

Re: [RFC v2 09/13] vduse: Add support for processing vhost iotlb message

2020-12-30 Thread Jason Wang
On 2020/12/31 下午2:52, Yongji Xie wrote: On Thu, Dec 31, 2020 at 1:50 PM Jason Wang wrote: On 2020/12/31 下午1:15, Yongji Xie wrote: On Thu, Dec 31, 2020 at 10:49 AM Jason Wang wrote: On 2020/12/30 下午6:12, Yongji Xie wrote: On Wed, Dec 30, 2020 at 4:41 PM Jason Wang wrote: On 2020/12/30

Re: [PATCH linux-next v2 1/7] vdpa_sim_net: Make mac address array static

2021-01-03 Thread Jason Wang
ESC(macaddr, "Ethernet MAC address"); -u8 macaddr_buf[ETH_ALEN]; +static u8 macaddr_buf[ETH_ALEN]; static struct vdpasim *vdpasim_net_dev; Acked-by: Jason Wang

Re: [PATCH linux-next v2 4/7] vdpa: Define vdpa mgmt device, ops and a netlink interface

2021-01-03 Thread Jason Wang
: supported_classes: net Example of showing vdpa management device in JSON format. $ vdpa mgmtdev show -jp { "show": { "vdpasim_net": { "supported_classes": [ "net" ] } } } Signed-off-by: Parav Pandit Review

Re: [PATCH linux-next v2 7/7] vdpa_sim_net: Add support for user supported devices

2021-01-03 Thread Jason Wang
On 2021/1/4 上午11:31, Parav Pandit wrote: static int __init vdpasim_net_init(void) { int ret = 0; @@ -176,6 +264,8 @@ static int __init vdpasim_net_init(void) if (default_device) ret = vdpasim_net_default_dev_register(); + else + ret = vdpas

Re: [PATCH linux-next v2 7/7] vdpa_sim_net: Add support for user supported devices

2021-01-04 Thread Jason Wang
On 2021/1/4 下午3:21, Parav Pandit wrote: From: Jason Wang Sent: Monday, January 4, 2021 12:35 PM On 2021/1/4 上午11:31, Parav Pandit wrote: static int __init vdpasim_net_init(void) { int ret = 0; @@ -176,6 +264,8 @@ static int __init vdpasim_net_init(void) if

Re: [PATCH linux-next v2 4/7] vdpa: Define vdpa mgmt device, ops and a netlink interface

2021-01-04 Thread Jason Wang
On 2021/1/4 下午3:24, Parav Pandit wrote: From: Jason Wang Sent: Monday, January 4, 2021 12:33 PM On 2021/1/4 上午11:31, Parav Pandit wrote: To add one or more VDPA devices, define a management device which allows adding or removing vdpa device. A management device defines set of callbacks to

Re: [PATCH 06/21] vdpa: introduce virtqueue groups

2021-01-04 Thread Jason Wang
On 2021/1/4 下午6:04, Stefan Hajnoczi wrote: On Wed, Dec 16, 2020 at 02:48:03PM +0800, Jason Wang wrote: This patch introduces virtqueue groups to vDPA device. The virtqueue group is the minimal set of virtqueues that must share an address space. And the adddress space identifier could only be

Re: [PATCH linux-next v2 4/7] vdpa: Define vdpa mgmt device, ops and a netlink interface

2021-01-05 Thread Jason Wang
On 2021/1/5 下午2:33, Parav Pandit wrote: From: Jason Wang Sent: Tuesday, January 5, 2021 9:40 AM On 2021/1/4 下午3:24, Parav Pandit wrote: From: Jason Wang Sent: Monday, January 4, 2021 12:33 PM On 2021/1/4 上午11:31, Parav Pandit wrote: To add one or more VDPA devices, define a management

Re: [PATCH netdev 0/5] virtio-net support xdp socket zero copy xmit

2021-01-05 Thread Jason Wang
On 2021/1/5 下午5:11, Xuan Zhuo wrote: The first patch made some adjustments to xsk. Thanks a lot for the work. It's rather interesting. The second patch itself can be used as an independent patch to solve the problem that XDP may fail to load when the number of queues is insufficient.

Re: [PATCH netdev 0/5] virtio-net support xdp socket zero copy xmit

2021-01-05 Thread Jason Wang
On 2021/1/5 下午8:42, Xuan Zhuo wrote: On Tue, 5 Jan 2021 17:32:19 +0800, Jason Wang wrote: On 2021/1/5 下午5:11, Xuan Zhuo wrote: The first patch made some adjustments to xsk. Thanks a lot for the work. It's rather interesting. The second patch itself can be used as an independent

Re: [PATCH netdev 0/5] virtio-net support xdp socket zero copy xmit

2021-01-05 Thread Jason Wang
On 2021/1/6 上午10:55, Xuan Zhuo wrote: On Wed, 6 Jan 2021 10:46:43 +0800, Jason Wang wrote: On 2021/1/5 下午8:42, Xuan Zhuo wrote: On Tue, 5 Jan 2021 17:32:19 +0800, Jason Wang wrote: On 2021/1/5 下午5:11, Xuan Zhuo wrote: The first patch made some adjustments to xsk. Thanks a lot for the

Re: [PATCH] vdpa/mlx5: Fix memory key MTT population

2021-01-06 Thread Jason Wang
On 2021/1/6 下午5:05, Eli Cohen wrote: map_direct_mr() assumed that the number of scatter/gather entries returned by dma_map_sg_attrs() was equal to the number of segments in the sgl list. This led to wrong population of the mkey object. Fix this by properly referring to the returned value. In a

Re: [PATCH v1] vdpa/mlx5: Fix memory key MTT population

2021-01-08 Thread Jason Wang
each s/g entry. In addition, get rid of fill_sg() which effect is overwritten by populate_mtts(). Fixes: 94abbccdf291 ("vdpa/mlx5: Add shared memory registration code") Signed-off-by: Eli Cohen --- V0->V1: 1. Fix typos 2. Improve changelog Acked-by: Jason Wang drivers/vdpa

Re: [PATCH net-next 0/2] Introduce XDP_FLAGS_NO_TX flag

2021-01-11 Thread Jason Wang
On 2021/1/9 上午10:49, Charlie Somerville wrote: This patch series introduces a new flag XDP_FLAGS_NO_TX which prevents the allocation of additional send queues for XDP programs. This part I don't understand. Is such flag a must? I think the answer is probably not. Why not simply do: 1) if

Re: [PATCH 21/21] vdpasim: control virtqueue support

2021-01-11 Thread Jason Wang
On 2021/1/11 下午8:26, Eli Cohen wrote: On Wed, Dec 16, 2020 at 02:48:18PM +0800, Jason Wang wrote: This patch introduces the control virtqueue support for vDPA simulator. This is a requirement for supporting advanced features like multiqueue. A requirement for control virtqueue is to isolate

Re: [PATCH v1] vhost_vdpa: fix the problem in vhost_vdpa_set_config_call

2021-01-11 Thread Jason Wang
t;issue" Fixes: 776f395004d82 ("vhost_vdpa: Support config interrupt in vdpa") Acked-by: Jason Wang Please post a V2 with the above fixed and cc stable. Thanks Signed-off-by: Cindy Lu --- drivers/vhost/vdpa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/

Re: [PATCH net] vdpa/mlx5: Fix miss to set VIRTIO_NET_S_LINK_UP for virtio_net_config

2020-10-19 Thread Jason Wang
ll issue pointed out by Jakub. Acked-by: Jason Wang

Re: [PATCH net v2] Revert "virtio-net: ethtool configurable RXCSUM"

2020-10-19 Thread Jason Wang
On 2020/10/20 上午1:32, Michael S. Tsirkin wrote: This reverts commit 3618ad2a7c0e78e4258386394d5d5f92a3dbccf8. When the device does not have a control vq (e.g. when using a version of QEMU based on upstream v0.10 or older, or when specifying ctrl_vq=off,ctrl_rx=off,ctrl_vlan=off,ctrl_rx_extra=o

Re: [PATCH 1/2] KVM: not register a IRQ bypass producer if unsupported or disabled

2020-10-19 Thread Jason Wang
On 2020/10/19 下午5:06, Zhenzhong Duan wrote: If Post interrupt is disabled due to hardware limit or forcely disabled by "intremap=nopost" parameter, return -EINVAL so that the legacy mode IRQ isn't registered as IRQ bypass producer. Is there any side effect if it was still registered? Wit

Re: [PATCH 2/2] KVM: not link irqfd with a fake IRQ bypass producer

2020-10-19 Thread Jason Wang
On 2020/10/19 下午5:06, Zhenzhong Duan wrote: In case failure to setup Post interrupt for an IRQ, it make no sense to assign irqfd->producer to the producer. This change makes code more robust. It's better to describe what issue we will get without this patch. Thanks Signed-off-by: Zhenz

Re: [PATCH net] vdpa/mlx5: Fix miss to set VIRTIO_NET_S_LINK_UP for virtio_net_config

2020-10-20 Thread Jason Wang
On 2020/10/20 下午3:44, Eli Cohen wrote: On Tue, Oct 20, 2020 at 10:03:00AM +0800, Jason Wang wrote: On 2020/10/19 下午5:07, we...@ucloud.cn wrote: From: wenxu Qemu get virtio_net_config from the vdpa driver. So The vdpa driver should set the VIRTIO_NET_S_LINK_UP flag to virtio_net_config like

Re: [PATCH v4] Revert "virtio-net: ethtool configurable RXCSUM"

2020-10-21 Thread Jason Wang
have a control vq, everything breaks. Revert the original commit for now. Cc: Tonghao Zhang Cc: Willem de Bruijn Fixes: 3618ad2a7c0e7 ("virtio-net: ethtool configurable RXCSUM") Reported-by: kernel test robot Signed-off-by: Michael S. Tsirkin --- Acked-by: Jason Wang Same patch

Re: [PATCH] vdpa: handle irq bypass register failure case

2020-10-25 Thread Jason Wang
ck(&vq->call_ctx.ctx_lock); } Acked-by: Jason Wang

Re: [PATCH net] vhost_vdpa: Return -EFUALT if copy_from_user() fails

2020-10-25 Thread Jason Wang
-vdpa: fix backend feature ioctls") Signed-off-by: Dan Carpenter Acked-by: Michael S. Tsirkin Needed for stable I guess. Agree. Acked-by: Jason Wang --- drivers/vhost/vdpa.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/vhost/vdpa.c b/drive

Re: [PATCH] vhost: Use mutex to protect vq_irq setup

2020-10-29 Thread Jason Wang
On 2020/10/28 下午10:20, Eli Cohen wrote: Both irq_bypass_register_producer() and irq_bypass_unregister_producer() require process context to run. Change the call context lock from spinlock to mutex to protect the setup process to avoid deadlocks. Fixes: 265a0ad8731d ("vhost: introduce vhost_vri

Re: [PATCH] vhost: Use mutex to protect vq_irq setup

2020-10-29 Thread Jason Wang
On 2020/10/29 下午3:37, Eli Cohen wrote: On Thu, Oct 29, 2020 at 03:03:24PM +0800, Jason Wang wrote: On 2020/10/28 下午10:20, Eli Cohen wrote: Both irq_bypass_register_producer() and irq_bypass_unregister_producer() require process context to run. Change the call context lock from spinlock to

Re: [PATCH] vhost: Use mutex to protect vq_irq setup

2020-10-29 Thread Jason Wang
On 2020/10/29 下午3:50, Eli Cohen wrote: On Thu, Oct 29, 2020 at 03:39:24PM +0800, Jason Wang wrote: On 2020/10/29 下午3:37, Eli Cohen wrote: On Thu, Oct 29, 2020 at 03:03:24PM +0800, Jason Wang wrote: On 2020/10/28 下午10:20, Eli Cohen wrote: Both irq_bypass_register_producer() and

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

2020-10-30 Thread Jason Wang
On 2020/10/30 上午1:43, Stefano Garzarella wrote: This patch enables the IOTLB API support for vhost-vsock devices, allowing the userspace to emulate an IOMMU for the guest. These changes were made following vhost-net, in details this patch: - exposes VIRTIO_F_ACCESS_PLATFORM feature and inits t

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

2020-10-30 Thread Jason Wang
On 2020/10/30 下午6:54, Stefano Garzarella wrote: On Fri, Oct 30, 2020 at 06:02:18PM +0800, Jason Wang wrote: On 2020/10/30 上午1:43, Stefano Garzarella wrote: This patch enables the IOTLB API support for vhost-vsock devices, allowing the userspace to emulate an IOMMU for the guest. These

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

2020-11-03 Thread Jason Wang
On 2020/11/3 上午1:11, Stefano Garzarella wrote: On Fri, Oct 30, 2020 at 07:44:43PM +0800, Jason Wang wrote: On 2020/10/30 下午6:54, Stefano Garzarella wrote: On Fri, Oct 30, 2020 at 06:02:18PM +0800, Jason Wang wrote: On 2020/10/30 上午1:43, Stefano Garzarella wrote: This patch enables the

Re: [PATCH net-next v4 09/10] virtio-net: xsk zero copy xmit implement wakeup and xmit

2021-04-18 Thread Jason Wang
在 2021/4/16 下午2:29, Xuan Zhuo 写道: On Fri, 16 Apr 2021 13:35:33 +0800, Jason Wang wrote: 在 2021/4/15 下午6:27, Xuan Zhuo 写道: On Wed, 14 Apr 2021 13:46:45 +0800, Jason Wang wrote: 在 2021/4/13 上午11:15, Xuan Zhuo 写道: This patch implements the core part of xsk zerocopy xmit. When the user

Re: [PATCH net-next v3] virtio-net: page_to_skb() use build_skb when there's sufficient tailroom

2021-04-18 Thread Jason Wang
received quantity displayed by sar -n DEV 1: no build_skb: 956864.00 rxpck/s build_skb:1158465.00 rxpck/s I suggess to test the case of XDP_PASS in this case as well. Signed-off-by: Xuan Zhuo Suggested-by: Jason Wang --- v3: fix the truesize when headroom > 0 v2: conflict resol

Re: [PATCH V3 1/3] vDPA/ifcvf: deduce VIRTIO device ID when probe

2021-04-18 Thread Jason Wang
在 2021/4/16 下午3:16, Zhu Lingshan 写道: This commit deduces VIRTIO device ID as device type when probe, then ifcvf_vdpa_get_device_id() can simply return the ID. ifcvf_vdpa_get_features() and ifcvf_vdpa_get_config_size() can work properly based on the device ID. Signed-off-by: Zhu Lingshan ---

Re: [PATCH V3 2/3] vDPA/ifcvf: enable Intel C5000X-PL virtio-block for vDPA

2021-04-18 Thread Jason Wang
在 2021/4/16 下午3:16, Zhu Lingshan 写道: This commit enabled Intel FPGA SmartNIC C5000X-PL virtio-block for vDPA. Signed-off-by: Zhu Lingshan Acked-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_base.h | 8 +++- drivers/vdpa/ifcvf/ifcvf_main.c | 19 ++- 2 files

Re: [PATCH V3 3/3] vDPA/ifcvf: get_config_size should return dev specific config size

2021-04-18 Thread Jason Wang
在 2021/4/16 下午3:16, Zhu Lingshan 写道: get_config_size() should return the size based on the decected device type. Signed-off-by: Zhu Lingshan Acked-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_main.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff

Re: [PATCH net-next v3] virtio-net: page_to_skb() use build_skb when there's sufficient tailroom

2021-04-19 Thread Jason Wang
of the machine is 100%, we observe the received quantity displayed by sar -n DEV 1: no build_skb:  956864.00 rxpck/s build_skb:    1158465.00 rxpck/s Signed-off-by: Xuan Zhuo Suggested-by: Jason Wang --- v3: fix the truesize when headroom > 0 v2: conflict resolution drivers/n

Re: [PATCH net-next v3] virtio-net: page_to_skb() use build_skb when there's sufficient tailroom

2021-04-19 Thread Jason Wang
在 2021/4/20 上午10:38, Jason Wang 写道: : +    /* hdr_valid means no XDP, so we can copy the vnet header */ +    if (hdr_valid) { +    hdr = skb_vnet_hdr(skb); +    memcpy(hdr, hdr_p, hdr_len); and hdr_p is dereferenced here. Right, I tend to recover the way to copy hdr and set meta

Re: [PATCH net-next v3] virtio-net: page_to_skb() use build_skb when there's sufficient tailroom

2021-04-19 Thread Jason Wang
在 2021/4/20 上午12:48, David Ahern 写道: On 4/16/21 2:16 AM, Xuan Zhuo wrote: In page_to_skb(), if we have enough tailroom to save skb_shared_info, we can use build_skb to create skb directly. No need to alloc for additional space. And it can save a 'frags slot', which is very friendly to GRO. He

Re: [PATCH V4 1/3] vDPA/ifcvf: deduce VIRTIO device ID when probe

2021-04-19 Thread Jason Wang
Acked-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_base.h | 1 + drivers/vdpa/ifcvf/ifcvf_main.c | 27 +++ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/drivers/vdpa/ifcvf/ifcvf_base.h b/drivers/vdpa/ifcvf/ifcvf_base.h index b2eeb16b9c2c

Re: [PATCH net-next v2 2/5] virtio-net: separate rx/tx coalescing moderation cmds

2023-11-08 Thread Jason Wang
On Thu, Nov 2, 2023 at 9:10 PM Heng Qi wrote: > > This patch separates the rx and tx global coalescing moderation > commands to support netdim switches in subsequent patches. > > Signed-off-by: Heng Qi Acked-by: Jason Wang Thanks > --- > v1->v2: > - Add '

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

2023-11-08 Thread Jason Wang
On Thu, Nov 2, 2023 at 9:10 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 > --- > v1->v2: > - Improved the judgmen

Re: [PATCH net-next v2 5/5] virtio-net: return -EOPNOTSUPP for adaptive-tx

2023-11-08 Thread Jason Wang
On Thu, Nov 2, 2023 at 9:10 PM Heng Qi wrote: > > We do not currently support tx dim, so respond to -EOPNOTSUPP. > > Signed-off-by: Heng Qi > --- > v1->v2: > - Use -EOPNOTSUPP instead of specific implementation. > > drivers/net/virtio_net.c | 29 ++--- > 1 file changed, 2

Re: [PATCH net-next v2 04/21] virtio_net: move core structures to virtio_net.h

2023-11-08 Thread Jason Wang
Xuan Zhuo > --- Acked-by: Jason Wang Thanks

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

2023-11-08 Thread Jason Wang
On Tue, Nov 7, 2023 at 11:13 AM Xuan Zhuo wrote: > > We move some structures to the header file, but these structures do not > prefixed with virtnet. This patch adds virtnet for these. > > Signed-off-by: Xuan Zhuo > --- Acked-by: Jason Wang Thanks

Re: [PATCH net-next v2 08/21] virtio_net: sq support premapped mode

2023-11-08 Thread Jason Wang
On Tue, Nov 7, 2023 at 11:12 AM 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 net-next v2 08/21] virtio_net: sq support premapped mode

2023-11-13 Thread Jason Wang
On Thu, Nov 9, 2023 at 7:06 PM Xuan Zhuo wrote: > > On Thu, 9 Nov 2023 14:37:38 +0800, Jason Wang wrote: > > On Tue, Nov 7, 2023 at 11:12 AM Xuan Zhuo > > wrote: > > > > > > If the xsk is enabling, the xsk tx will share the send queue. > > > But

Re: [PATCH net-next v2 08/21] virtio_net: sq support premapped mode

2023-11-13 Thread Jason Wang
On Tue, Nov 14, 2023 at 11:42 AM Xuan Zhuo wrote: > > On Tue, 14 Nov 2023 11:26:42 +0800, Jason Wang wrote: > > On Thu, Nov 9, 2023 at 7:06 PM Xuan Zhuo wrote: > > > > > > On Thu, 9 Nov 2023 14:37:38 +0800, Jason Wang wrote: > > > > On Tue, Nov 7,

Re: [PATCH net-next v2 08/21] virtio_net: sq support premapped mode

2023-11-13 Thread Jason Wang
On Tue, Nov 14, 2023 at 11:59 AM Xuan Zhuo wrote: > > On Tue, 14 Nov 2023 11:55:52 +0800, Jason Wang wrote: > > On Tue, Nov 14, 2023 at 11:42 AM Xuan Zhuo > > wrote: > > > > > > On Tue, 14 Nov 2023 11:26:42 +0800, Jason Wang > > > wrote: >

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

2023-11-21 Thread Jason Wang
On Mon, Nov 20, 2023 at 8:38 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 > --- > v2->v3: > - Some minor modifica

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

2023-11-21 Thread Jason Wang
On Wed, Nov 22, 2023 at 1:52 PM Jason Wang wrote: > > On Mon, Nov 20, 2023 at 8:38 PM Heng Qi wrote: > > > > By comparing the traffic information in the complete napi processes, > > let the virtio-net driver automatically adjust the coalescing > > moderation pa

Re: [PATCH net-next v6 4/5] virtio-net: add spin lock for ctrl cmd access

2023-12-05 Thread Jason Wang
On Tue, Dec 5, 2023 at 4:02 PM Heng Qi wrote: > > Currently access to ctrl cmd is globally protected via rtnl_lock and works > fine. But if dim work's access to ctrl cmd also holds rtnl_lock, deadlock > may occur due to cancel_work_sync for dim work. Can you explain why? > Therefore, treating >

Re: [PATCH net-next v6 4/5] virtio-net: add spin lock for ctrl cmd access

2023-12-06 Thread Jason Wang
On Tue, Dec 5, 2023 at 7:06 PM Heng Qi wrote: > > > > 在 2023/12/5 下午4:35, Jason Wang 写道: > > On Tue, Dec 5, 2023 at 4:02 PM Heng Qi wrote: > >> Currently access to ctrl cmd is globally protected via rtnl_lock and works > >> fine. But if dim work'

Re: [PATCH net-next v6 4/5] virtio-net: add spin lock for ctrl cmd access

2023-12-06 Thread Jason Wang
On Wed, Dec 6, 2023 at 9:03 PM Heng Qi wrote: > > > > 在 2023/12/6 下午8:27, Paolo Abeni 写道: > > On Tue, 2023-12-05 at 19:05 +0800, Heng Qi wrote: > >> 在 2023/12/5 下午4:35, Jason Wang 写道: > >>> On Tue, Dec 5, 2023 at 4:02 PM Heng Qi wrote: > >>>&

Re: [PATCH net-next v6 4/5] virtio-net: add spin lock for ctrl cmd access

2023-12-06 Thread Jason Wang
On Thu, Dec 7, 2023 at 12:47 PM Heng Qi wrote: > > > > 在 2023/12/7 下午12:19, Jason Wang 写道: > > On Wed, Dec 6, 2023 at 9:03 PM Heng Qi wrote: > >> > >> > >> 在 2023/12/6 下午8:27, Paolo Abeni 写道: > >>> On Tue, 2023-12-05 at 19:05 +0800

Re: [PATCH net-next] virtio-net: switch napi_tx without downing nic

2023-12-21 Thread Jason Wang
On Thu, Dec 21, 2023 at 11:06 PM Willem de Bruijn wrote: > > Heng Qi wrote: > > > > > > 在 2023/12/20 下午10:45, Willem de Bruijn 写道: > > > Heng Qi wrote: > > >> virtio-net has two ways to switch napi_tx: one is through the > > >> module parameter, and the other is through coalescing parameter > > >>

Re: [PATCH net-next] virtio-net: switch napi_tx without downing nic

2023-12-24 Thread Jason Wang
On Fri, Dec 22, 2023 at 4:14 PM Michael S. Tsirkin wrote: > > On Fri, Dec 22, 2023 at 10:35:07AM +0800, Jason Wang wrote: > > On Thu, Dec 21, 2023 at 11:06 PM Willem de Bruijn > > wrote: > > > > > > Heng Qi wrote: > > > > > > > > >

Re: [PATCH net-next] virtio-net: switch napi_tx without downing nic

2023-12-24 Thread Jason Wang
On Mon, Dec 25, 2023 at 10:25 AM Jason Xing wrote: > > Hello Jason, > On Fri, Dec 22, 2023 at 10:36 AM Jason Wang wrote: > > > > On Thu, Dec 21, 2023 at 11:06 PM Willem de Bruijn > > wrote: > > > > > > Heng Qi wrote: > > > >

Re: [PATCH net-next] virtio-net: switch napi_tx without downing nic

2023-12-24 Thread Jason Wang
On Mon, Dec 25, 2023 at 2:34 PM Jason Xing wrote: > > On Mon, Dec 25, 2023 at 12:14 PM Jason Wang wrote: > > > > On Mon, Dec 25, 2023 at 10:25 AM Jason Xing > > wrote: > > > > > > Hello Jason, > > > On Fri, Dec 22, 2023 at 10:36 AM Jason Wang

Re: [PATCH net-next] virtio-net: switch napi_tx without downing nic

2023-12-24 Thread Jason Wang
On Mon, Dec 25, 2023 at 2:44 PM Jason Wang wrote: > > On Mon, Dec 25, 2023 at 2:34 PM Jason Xing wrote: > > > > On Mon, Dec 25, 2023 at 12:14 PM Jason Wang wrote: > > > > > > On Mon, Dec 25, 2023 at 10:25 AM Jason Xing > > > wrote: > > >

Re: [PATCH net-next] virtio-net: switch napi_tx without downing nic

2023-12-25 Thread Jason Wang
On Mon, Dec 25, 2023 at 4:03 PM Michael S. Tsirkin wrote: > > On Mon, Dec 25, 2023 at 12:12:48PM +0800, Jason Wang wrote: > > On Fri, Dec 22, 2023 at 4:14 PM Michael S. Tsirkin wrote: > > > > > > On Fri, Dec 22, 2023 at 10:35:07AM +0800, Jason Wang wrote: > >

Re: [PATCH v2] virtio_net: fix missing dma unmap for resize

2024-01-03 Thread Jason Wang
> do > > > ethtool -G ens4 rx 128 > > > ethtool -G ens4 rx 256 > > > free -m > > > done > > > > > > Fixes: 295525e29a5b ("virtio_net: merge dma operations when filling > > > mergeable buffers") > > > Signed-off-by: Xuan Zhuo > > > > Michael, Jason, looks good? Worth pushing it to v6.7? > > I'd say yes. > > Acked-by: Michael S. Tsirkin Acked-by: Jason Wang Thanks >

Re: [PATCH net-next v3 00/27] virtio-net: support AF_XDP zero copy

2024-01-10 Thread Jason Wang
On Fri, Dec 29, 2023 at 3:31 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: [PATCH net-next v3 06/27] virtio_ring: introduce virtqueue_get_buf_ctx_dma()

2024-01-11 Thread Jason Wang
On Fri, Dec 29, 2023 at 3:31 PM Xuan Zhuo wrote: > > introduce virtqueue_get_buf_ctx_dma() to collect the dma info when > get buf from virtio core for premapped mode. > > If the virtio queue is premapped mode, the virtio-net send buf may > have many desc. Every desc dma address need to be unmap. S

Re: [PATCH 1/1] virtio_net: Add timeout handler to avoid kernel hang

2024-01-14 Thread Jason Wang
On Mon, Jan 15, 2024 at 9:35 AM Zhu Yanjun wrote: > > From: Zhu Yanjun > > Some devices emulate the virtio_net hardwares. When virtio_net > driver sends commands to the emulated hardware, normally the > hardware needs time to response. Sometimes the time is very > long. Thus, the following will a

Re: [PATCH 1/1] virtio_net: Add timeout handler to avoid kernel hang

2024-01-21 Thread Jason Wang
On Mon, Jan 15, 2024 at 6:22 PM Zhu Yanjun wrote: > > > 在 2024/1/15 10:20, Jason Wang 写道: > > On Mon, Jan 15, 2024 at 9:35 AM Zhu Yanjun wrote: > > From: Zhu Yanjun > > Some devices emulate the virtio_net hardwares. When virtio_net > driver sends commands to the e

Re: [PATCH 1/1] virtio_net: Add timeout handler to avoid kernel hang

2024-01-21 Thread Jason Wang
On Fri, Jan 19, 2024 at 10:27 PM Heng Qi wrote: > > > > 在 2024/1/18 下午8:01, Zhu Yanjun 写道: > > > > 在 2024/1/16 20:04, Paolo Abeni 写道: > >> On Mon, 2024-01-15 at 09:29 +0800, Zhu Yanjun wrote: > >>> From: Zhu Yanjun > >>> > >>> Some devices emulate the virtio_net hardwares. When virtio_net > >>> d

Re: [PATCH 1/1] virtio_net: Add timeout handler to avoid kernel hang

2024-01-21 Thread Jason Wang
On Mon, Jan 22, 2024 at 10:12 AM Zhu Yanjun wrote: > > > 在 2024/1/20 1:29, Andrew Lunn 写道: > >while (!virtqueue_get_buf(vi->cvq, &tmp) && > > - !virtqueue_is_broken(vi->cvq)) > > + !virtqueue_is_broken(vi->cvq)) { > > +if (timeout) > > +

Re: [PATCH 1/1] virtio_net: Add timeout handler to avoid kernel hang

2024-01-21 Thread Jason Wang
On Mon, Jan 22, 2024 at 12:00 PM Xuan Zhuo wrote: > > On Mon, 22 Jan 2024 11:14:30 +0800, Jason Wang wrote: > > On Mon, Jan 22, 2024 at 10:12 AM Zhu Yanjun wrote: > > > > > > > > > 在 2024/1/20 1:29, Andrew Lunn 写道: > > > >

Re: [PATCH net-next v3 06/27] virtio_ring: introduce virtqueue_get_buf_ctx_dma()

2024-01-21 Thread Jason Wang
On Tue, Jan 16, 2024 at 3:47 PM Xuan Zhuo wrote: > > On Thu, 11 Jan 2024 16:34:09 +0800, Jason Wang wrote: > > On Fri, Dec 29, 2023 at 3:31 PM Xuan Zhuo > > wrote: > > > > > > introduce virtqueue_get_buf_ctx_dma() to collect the dma info when > > >

Re: [PATCH net-next 00/17] virtio-net: support AF_XDP zero copy (3/3)

2024-01-21 Thread Jason Wang
On Wed, Jan 17, 2024 at 1:58 PM Xuan Zhuo wrote: > > On Tue, 16 Jan 2024 07:07:05 -0800, Jakub Kicinski wrote: > > On Tue, 16 Jan 2024 13:37:30 +0100 Paolo Abeni wrote: > > > For future submission it would be better if you split this series in > > > smaller chunks: the maximum size allowed is 15

Re: [PATCH net-next v3 06/27] virtio_ring: introduce virtqueue_get_buf_ctx_dma()

2024-01-21 Thread Jason Wang
On Mon, Jan 22, 2024 at 2:12 PM Xuan Zhuo wrote: > > On Mon, 22 Jan 2024 12:18:51 +0800, Jason Wang wrote: > > On Tue, Jan 16, 2024 at 3:47 PM Xuan Zhuo > > wrote: > > > > > > On Thu, 11 Jan 2024 16:34:09 +0800, Jason Wang > > > wrote: >

Re: [PATCH 1/1] virtio_net: Add timeout handler to avoid kernel hang

2024-01-21 Thread Jason Wang
On Mon, Jan 22, 2024 at 2:20 PM Xuan Zhuo wrote: > > On Mon, 22 Jan 2024 12:16:27 +0800, Jason Wang wrote: > > On Mon, Jan 22, 2024 at 12:00 PM Xuan Zhuo > > wrote: > > > > > > On Mon, 22 Jan 2024 11:14:30 +0800, Jason Wang > > > wrote: > &

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