Re: [PATCH net] virtio-net: suppress bad irq warning for tx napi

2021-04-12 Thread David Miller
From: "Michael S. Tsirkin" Date: Mon, 12 Apr 2021 18:33:45 -0400 > On Mon, Apr 12, 2021 at 06:08:21PM -0400, Michael S. Tsirkin wrote: >> OK I started looking at this again. My idea is simple. >> A. disable callbacks before we try to drain skbs >> B. actually do disable callbacks even with event

Re: [Linux-kernel-mentees][PATCH 0/2] reorder members of structures in virtio_net for optimization

2020-10-02 Thread David Miller
From: Anant Thazhemadam Date: Wed, 30 Sep 2020 10:47:20 +0530 > The structures virtnet_info and receive_queue have byte holes in > middle, and their members could do with some rearranging > (order-of-declaration wise) in order to overcome this. > > Rearranging the members helps in: > *

Re: [PATCH net v2] virtio-net: don't disable guest csum when disable LRO

2020-09-29 Thread David Miller
From: xiangxia.m@gmail.com Date: Tue, 29 Sep 2020 09:58:06 +0800 > From: Tonghao Zhang > > Open vSwitch and Linux bridge will disable LRO of the interface > when this interface added to them. Now when disable the LRO, the > virtio-net csum is disable too. That drops the forwarding

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

2020-09-01 Thread David Miller
From: Yunsheng Lin Date: Tue, 1 Sep 2020 10:39:09 +0800 > "enable" should be "disable" when the function name is > vhost_disable_notify(), which does the disabling work. > > Signed-off-by: Yunsheng Lin Applied to 'net'. ___ Virtualization mailing

Re: [PATCH v3] virtio_vsock: Fix race condition in virtio_transport_recv_pkt

2020-05-30 Thread David Miller
From: Jia He Date: Sat, 30 May 2020 09:38:28 +0800 > When client on the host tries to connect(SOCK_STREAM, O_NONBLOCK) to the > server on the guest, there will be a panic on a ThunderX2 (armv8a server): ... > The race condition is as follows: > Task1Task2 > =

Re: [PATCH v2] virtio_net: fix lockdep warning on 32 bit

2020-05-07 Thread David Miller
From: "Michael S. Tsirkin" Date: Thu, 7 May 2020 03:25:56 -0400 > When we fill up a receive VQ, try_fill_recv currently tries to count > kicks using a 64 bit stats counter. Turns out, on a 32 bit kernel that > uses a seqcount. sequence counts are "lock" constructs where you need to > make sure

Re: [PATCH] virtio_net: fix lockdep warning on 32 bit

2020-05-06 Thread David Miller
From: "Michael S. Tsirkin" Date: Tue, 5 May 2020 20:01:31 -0400 > - u64_stats_update_end(>stats.syncp); > + u64_stats_update_end_irqrestore(>stats.syncp); Need to pass flags to this function. ___ Virtualization mailing list

Re: [PATCH net v2 0/2] vsock/virtio: fixes about packet delivery to monitoring devices

2020-04-27 Thread David Miller
From: Stefano Garzarella Date: Fri, 24 Apr 2020 17:08:28 +0200 > During the review of v1, Stefan pointed out an issue introduced by > that patch, where replies can appear in the packet capture before > the transmitted packet. > > While fixing my patch, reverting it and adding a new flag in >

Re: [PATCH RESEND] ptp: add VMware virtual PTP clock driver

2020-03-05 Thread David Miller
From: Vivek Thampi Date: Fri, 28 Feb 2020 05:32:46 + > Add a PTP clock driver called ptp_vmw, for guests running on VMware ESXi > hypervisor. The driver attaches to a VMware virtual device called > "precision clock" that provides a mechanism for querying host system time. > Similar to

Re: [PATCH RESEND] ptp: add VMware virtual PTP clock driver

2020-03-04 Thread David Miller
From: Vivek Thampi Date: Fri, 28 Feb 2020 05:32:46 + > Add a PTP clock driver called ptp_vmw, for guests running on VMware ESXi > hypervisor. The driver attaches to a VMware virtual device called > "precision clock" that provides a mechanism for querying host system time. > Similar to

Re: [PATCH net] vsock: fix potential deadlock in transport->release()

2020-02-27 Thread David Miller
From: Stefano Garzarella Date: Wed, 26 Feb 2020 11:58:18 +0100 > Some transports (hyperv, virtio) acquire the sock lock during the > .release() callback. > > In the vsock_stream_connect() we call vsock_assign_transport(); if > the socket was previously assigned to another transport, the >

Re: [PATCH v3] virtio: Work around frames incorrectly marked as gso

2020-02-26 Thread David Miller
From: anton.iva...@cambridgegreys.com Date: Mon, 24 Feb 2020 13:25:50 + > From: Anton Ivanov > > Some of the locally generated frames marked as GSO which > arrive at virtio_net_hdr_from_skb() have no GSO_TYPE, no > fragments (data_len = 0) and length significantly shorter > than the MTU

Re: [PATCH net-next 1/3] vsock: add network namespace support

2020-01-20 Thread David Miller
From: Stefano Garzarella Date: Thu, 16 Jan 2020 18:24:26 +0100 > This patch adds 'netns' module param to enable this new feature > (disabled by default), because it changes vsock's behavior with > network namespaces and could break existing applications. Sorry, no. I wonder if you can even

Re: [PATCH v2] virtio_net: CTRL_GUEST_OFFLOADS depends on CTRL_VQ

2020-01-09 Thread David Miller
From: "Michael S. Tsirkin" Date: Sun, 5 Jan 2020 08:22:07 -0500 > The only way for guest to control offloads (as enabled by > VIRTIO_NET_F_CTRL_GUEST_OFFLOADS) is by sending commands > through CTRL_VQ. So it does not make sense to > acknowledge VIRTIO_NET_F_CTRL_GUEST_OFFLOADS without >

Re: [PATCH net-next v3 00/11] VSOCK: add vsock_test test suite

2019-12-20 Thread David Miller
From: Stefano Garzarella Date: Wed, 18 Dec 2019 19:06:57 +0100 > The vsock_diag.ko module already has a test suite but the core AF_VSOCK > functionality has no tests. This patch series adds several test cases that > exercise AF_VSOCK SOCK_STREAM socket semantics (send/recv, connect/accept, >

Re: [PATCH net 0/2] vsock/virtio: fix null-pointer dereference and related precautions

2019-12-16 Thread David Miller
From: Stefano Garzarella Date: Fri, 13 Dec 2019 19:47:59 +0100 > This series mainly solves a possible null-pointer dereference in > virtio_transport_recv_listen() introduced with the multi-transport > support [PATCH 1]. > > PATCH 2 adds a WARN_ON check for the same potential issue > and a

Re: [PATCH net-next v12 0/3] netdev: ndo_tx_timeout cleanup

2019-12-12 Thread David Miller
From: "Michael S. Tsirkin" Date: Tue, 10 Dec 2019 09:23:47 -0500 > Yet another forward declaration I missed. Hopfully the last one ... > > A bunch of drivers want to know which tx queue triggered a timeout, > and virtio wants to do the same. > We actually have the info to hand, let's just pass

Re: [PATCH] vhost/vsock: accept only packets with the right dst_cid

2019-12-12 Thread David Miller
From: Stefano Garzarella Date: Thu, 12 Dec 2019 14:14:53 +0100 > On Thu, Dec 12, 2019 at 07:56:26AM -0500, Michael S. Tsirkin wrote: >> On Thu, Dec 12, 2019 at 01:36:24PM +0100, Stefano Garzarella wrote: >> I'd say it's better to backport to all stable releases where it applies, >> but yes it's

Re: [PATCH net-next v2 0/6] vsock: add local transport support

2019-12-11 Thread David Miller
From: Stefano Garzarella Date: Tue, 10 Dec 2019 11:43:01 +0100 > v2: > - style fixes [Dave] > - removed RCU sync and changed 'the_vsock_loopback' in a global >static variable [Stefan] > - use G2H transport when local transport is not loaded and remote cid >is VMADDR_CID_LOCAL [Stefan]

Re: [PATCH net-next v11 0/3] netdev: ndo_tx_timeout cleanup

2019-12-10 Thread David Miller
From: "Michael S. Tsirkin" Date: Tue, 10 Dec 2019 08:08:58 -0500 > Sorry about the churn, v10 was based on net - not on net-next > by mistake. Ugh sorry, I just saw this. vger is sending postings massively out of order today. Ignore my previous reply to #1 :-)

Re: [PATCH net-next v10 1/3] netdev: pass the stuck queue to the timeout handler

2019-12-10 Thread David Miller
Michael, please provide a proper introductory posting for your patch series just like everyone else does. Not only does it help people understand at a high level what the patch series is doing, how it is doing it, and why it is doing it that way. It also gives me a single email to reply to

Re: [PATCH net-next v9 0/3] netdev: ndo_tx_timeout cleanup

2019-12-09 Thread David Miller
From: "Michael S. Tsirkin" Date: Mon, 9 Dec 2019 11:28:57 -0500 > A bunch of drivers want to know which tx queue triggered a timeout, > and virtio wants to do the same. > We actually have the info to hand, let's just pass it on to drivers. > Note: tested with an experimental virtio patch by

Re: [PATCH] vhost/vsock: accept only packets with the right dst_cid

2019-12-07 Thread David Miller
From: Stefano Garzarella Date: Fri, 6 Dec 2019 15:39:12 +0100 > When we receive a new packet from the guest, we check if the > src_cid is correct, but we forgot to check the dst_cid. > > The host should accept only packets where dst_cid is > equal to the host CID. > > Signed-off-by: Stefano

Re: [net-next V3 0/2] drivers: net: virtio_net: implement

2019-11-27 Thread David Miller
From: "Michael S. Tsirkin" Date: Wed, 27 Nov 2019 06:38:35 -0500 > On Tue, Nov 26, 2019 at 02:06:30PM -0800, David Miller wrote: >> >> net-next is closed > > Could you merge this early when net-next reopens though? > This way I don't need to keep adding d

Re: [net-next V3 0/2] drivers: net: virtio_net: implement

2019-11-26 Thread David Miller
net-next is closed ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH] vsock/virtio: fix sock refcnt holding during the shutdown

2019-11-09 Thread David Miller
From: Stefano Garzarella Date: Fri, 8 Nov 2019 17:08:50 +0100 > The "42f5cda5eaf4" commit rightly set SOCK_DONE on peer shutdown, > but there is an issue if we receive the SHUTDOWN(RDWR) while the > virtio_transport_close_timeout() is scheduled. > In this case, when the timeout fires, the

Re: [PATCH net 0/2] vsock/virtio: make the credit mechanism more robust

2019-10-18 Thread David Miller
From: Stefano Garzarella Date: Thu, 17 Oct 2019 14:44:01 +0200 > This series makes the credit mechanism implemented in the > virtio-vsock devices more robust. > Patch 1 sends an update to the remote peer when the buf_alloc > change. > Patch 2 prevents a malicious peer (especially the guest) can

Re: [PATCH] vsock/virtio: remove unused 'work' field from 'struct virtio_vsock_pkt'

2019-10-15 Thread David Miller
From: Stefano Garzarella Date: Tue, 15 Oct 2019 17:00:51 +0200 > The 'work' field was introduced with commit 06a8fc78367d0 > ("VSOCK: Introduce virtio_vsock_common.ko") > but it is never used in the code, so we can remove it to save > memory allocated in the per-packet 'struct virtio_vsock_pkt'

Re: [PATCH net-next] net, uapi: fix -Wpointer-arith warnings

2019-10-04 Thread David Miller
From: Alexey Dobriyan Date: Thu, 3 Oct 2019 23:29:24 +0300 > Add casts to fix these warnings: > > ./usr/include/linux/netfilter_arp/arp_tables.h:200:19: error: pointer of type > 'void *' used in arithmetic [-Werror=pointer-arith] > ./usr/include/linux/netfilter_bridge/ebtables.h:197:19: error:

Re: [PATCH net-next v2] vsock/virtio: add support for MSG_PEEK

2019-10-01 Thread David Miller
From: Matias Ezequiel Vara Larsen Date: Mon, 30 Sep 2019 18:25:23 + > This patch adds support for MSG_PEEK. In such a case, packets are not > removed from the rx_queue and credit updates are not sent. > > Signed-off-by: Matias Ezequiel Vara Larsen > Reviewed-by: Stefano Garzarella >

Re: [PATCH net v3] vsock: Fix a lockdep warning in __vsock_release()

2019-10-01 Thread David Miller
From: Dexuan Cui Date: Mon, 30 Sep 2019 18:43:50 + > Lockdep is unhappy if two locks from the same class are held. > > Fix the below warning for hyperv and virtio sockets (vmci socket code > doesn't have the issue) by using lock_sock_nested() when __vsock_release() > is called recursively:

Re: [PATCH v2] vsock/virtio: add support for MSG_PEEK

2019-09-27 Thread David Miller
This is net-next material. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 0/2] Revert and rework on the metadata accelreation

2019-09-06 Thread David Miller
From: Jason Wang Date: Fri, 6 Sep 2019 18:02:35 +0800 > On 2019/9/5 下午9:59, Jason Gunthorpe wrote: >> I think you should apply the revert this cycle and rebase the other >> patch for next.. >> >> Jason > > Yes, the plan is to revert in this release cycle. Then you should reset patch #1 all by

Re: [PATCH net-next] vsock/virtio: a better comment on credit update

2019-09-05 Thread David Miller
From: "Michael S. Tsirkin" Date: Tue, 3 Sep 2019 03:38:16 -0400 > The comment we have is just repeating what the code does. > Include the *reason* for the condition instead. > > Cc: Stefano Garzarella > Signed-off-by: Michael S. Tsirkin Applied.

Re: [PATCH V5 0/9] Fixes for vhost metadata acceleration

2019-08-11 Thread David Miller
From: Jason Wang Date: Mon, 12 Aug 2019 10:44:51 +0800 > On 2019/8/11 上午1:52, Michael S. Tsirkin wrote: >> At this point how about we revert >> 7f466032dc9e5a61217f22ea34b2df932786bbfc >> for this release, and then re-apply a corrected version >> for the next one? > > If possible, consider

Re: [PATCH V4 0/9] Fixes for metadata accelreation

2019-08-08 Thread David Miller
From: Jason Wang Date: Wed, 7 Aug 2019 03:06:08 -0400 > This series try to fix several issues introduced by meta data > accelreation series. Please review. ... My impression is that patch #7 will be changed to use spinlocks so there will be a v5.

Re: [PATCH v5 12/29] compat_ioctl: move drivers to compat_ptr_ioctl

2019-07-30 Thread David Miller
From: Arnd Bergmann Date: Tue, 30 Jul 2019 21:50:28 +0200 > Each of these drivers has a copy of the same trivial helper function to > convert the pointer argument and then call the native ioctl handler. > > We now have a generic implementation of that, so use it. > > Acked-by: Greg

Re: [PATCH v3 0/3] vsock/virtio: several fixes in the .probe() and .remove()

2019-07-08 Thread David Miller
From: Stefano Garzarella Date: Fri, 5 Jul 2019 13:04:51 +0200 > During the review of "[PATCH] vsock/virtio: Initialize core virtio vsock > before registering the driver", Stefan pointed out some possible issues > in the .probe() and .remove() callbacks of the virtio-vsock driver. ... Series

Re: [PATCH net-next] vhost_net: disable zerocopy by default

2019-06-17 Thread David Miller
From: Jason Wang Date: Mon, 17 Jun 2019 05:20:54 -0400 > Vhost_net was known to suffer from HOL[1] issues which is not easy to > fix. Several downstream disable the feature by default. What's more, > the datapath was split and datacopy path got the support of batching > and XDP support recently

Re: [PATCH net-next] vsock: correct removal of socket from the list

2019-06-14 Thread David Miller
From: Sunil Muthuswamy Date: Thu, 13 Jun 2019 03:52:27 + > The current vsock code for removal of socket from the list is both > subject to race and inefficient. It takes the lock, checks whether > the socket is in the list, drops the lock and if the socket was on the > list, deletes it from

Re: [PATCH v3 2/5] vsock/virtio: fix locking for fwd_cnt and buf_alloc

2019-06-02 Thread David Miller
From: Stefano Garzarella Date: Fri, 31 May 2019 15:39:51 +0200 > @@ -434,7 +434,9 @@ void virtio_transport_set_buffer_size(struct vsock_sock > *vsk, u64 val) > if (val > vvs->buf_size_max) > vvs->buf_size_max = val; > vvs->buf_size = val; > +

Re: [PATCH net-next 0/6] vhost: accelerate metadata access

2019-05-30 Thread David Miller
From: "Michael S. Tsirkin" Date: Thu, 30 May 2019 14:13:28 -0400 > On Thu, May 30, 2019 at 11:07:30AM -0700, David Miller wrote: >> From: Jason Wang >> Date: Fri, 24 May 2019 04:12:12 -0400 >> >> > This series tries to access virtqueue metadata thr

Re: [PATCH net-next 0/6] vhost: accelerate metadata access

2019-05-30 Thread David Miller
From: Jason Wang Date: Fri, 24 May 2019 04:12:12 -0400 > This series tries to access virtqueue metadata through kernel virtual > address instead of copy_user() friends since they had too much > overheads like checks, spec barriers or even hardware feature > toggling like SMAP. This is done

Re: [PATCH 1/4] vsock/virtio: fix locking around 'the_virtio_vsock'

2019-05-29 Thread David Miller
From: Stefano Garzarella Date: Tue, 28 May 2019 12:56:20 +0200 > @@ -68,7 +68,13 @@ struct virtio_vsock { > > static struct virtio_vsock *virtio_vsock_get(void) > { > - return the_virtio_vsock; > + struct virtio_vsock *vsock; > + > + mutex_lock(_virtio_vsock_mutex); > + vsock

Re: [PATCH V2 0/4] Prevent vhost kthread from hogging CPU

2019-05-18 Thread David Miller
From: Jason Wang Date: Fri, 17 May 2019 00:29:48 -0400 > Hi: > > This series try to prevent a guest triggerable CPU hogging through > vhost kthread. This is done by introducing and checking the weight > after each requrest. The patch has been tested with reproducer of > vsock and virtio-net.

Re: [PATCH RESEND] vsock/virtio: Initialize core virtio vsock before registering the driver

2019-05-18 Thread David Miller
From: "Jorge E. Moreira" Date: Thu, 16 May 2019 13:51:07 -0700 > Avoid a race in which static variables in net/vmw_vsock/af_vsock.c are > accessed (while handling interrupts) before they are initialized. ... > Fixes: 22b5c0b63f32 ("vsock/virtio: fix kernel panic after device hot-unplug") > Cc:

Re: [PATCH v3] vsock/virtio: free packets during the socket release

2019-05-17 Thread David Miller
From: Stefano Garzarella Date: Fri, 17 May 2019 16:45:43 +0200 > When the socket is released, we should free all packets > queued in the per-socket list in order to avoid a memory > leak. > > Signed-off-by: Stefano Garzarella Applied and queued up for -stable.

Re: [PATCH net] vhost: don't use kmap() to log dirty pages

2019-05-13 Thread David Miller
From: Jason Wang Date: Mon, 13 May 2019 01:27:45 -0400 > Vhost log dirty pages directly to a userspace bitmap through GUP and > kmap_atomic() since kernel doesn't have a set_bit_to_user() > helper. This will cause issues for the arch that has virtually tagged > caches. The way to fix is to keep

Re: [PATCH v2 2/8] vsock/virtio: free packets during the socket release

2019-05-10 Thread David Miller
From: Stefano Garzarella Date: Fri, 10 May 2019 14:58:37 +0200 > @@ -827,12 +827,20 @@ static bool virtio_transport_close(struct vsock_sock > *vsk) > > void virtio_transport_release(struct vsock_sock *vsk) > { > + struct virtio_vsock_sock *vvs = vsk->trans; > + struct

Re: [PATCH net] vhost: reject zero size iova range

2019-04-10 Thread David Miller
From: Jason Wang Date: Tue, 9 Apr 2019 12:10:25 +0800 > We used to accept zero size iova range which will lead a infinite loop > in translate_desc(). Fixing this by failing the request in this case. > > Reported-by: syzbot+d21e6e297322a900c...@syzkaller.appspotmail.com > Fixes: 6b1e6cc7

Re: [PATCH net v8] failover: allow name change on IFF_UP slave interfaces

2019-04-10 Thread David Miller
From: Si-Wei Liu Date: Mon, 8 Apr 2019 19:45:27 -0400 > When a netdev appears through hot plug then gets enslaved by a failover > master that is already up and running, the slave will be opened > right away after getting enslaved. Today there's a race that userspace > (udev) may fail to rename

Re: [PATCH] virtio-net: Remove inclusion of pci.h

2019-04-06 Thread David Miller
From: Yuval Shaia Date: Wed, 3 Apr 2019 11:20:45 +0300 > This header is not in use - remove it. > > Signed-off-by: Yuval Shaia Applied to net-next ___ Virtualization mailing list Virtualization@lists.linux-foundation.org

Re: [PATCH] virtio-net: Fix some minor formatting errors

2019-04-06 Thread David Miller
From: Yuval Shaia Date: Wed, 3 Apr 2019 12:10:13 +0300 > Signed-off-by: Yuval Shaia Applied to net-next ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH] virtio_net: remove hcpu from virtnet_clean_affinity

2019-03-18 Thread David Miller
From: Peter Xu Date: Mon, 18 Mar 2019 14:56:06 +0800 > The variable is never used. > > CC: Michael S. Tsirkin > CC: Jason Wang > CC: virtualization@lists.linux-foundation.org > CC: net...@vger.kernel.org > CC: linux-ker...@vger.kernel.org > Signed-off-by: Peter Xu This looks rather

Re: [RFC PATCH V2 0/5] vhost: accelerate metadata access through vmap()

2019-03-11 Thread David Miller
From: "Michael S. Tsirkin" Date: Mon, 11 Mar 2019 09:59:28 -0400 > On Mon, Mar 11, 2019 at 03:13:17PM +0800, Jason Wang wrote: >> >> On 2019/3/8 下午10:12, Christoph Hellwig wrote: >> > On Wed, Mar 06, 2019 at 02:18:07AM -0500, Jason Wang wrote: >> > > This series tries to access virtqueue

Re: [RFC PATCH net] failover: allow name change on IFF_UP slave interfaces

2019-03-04 Thread David Miller
Why did you send this three times? What's different in each of these copies? ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH net V2] vhost: correctly check the return value of translate_desc() in log_used()

2019-02-19 Thread David Miller
From: Jason Wang Date: Tue, 19 Feb 2019 14:53:44 +0800 > When fail, translate_desc() returns negative value, otherwise the > number of iovs. So we should fail when the return value is negative > instead of a blindly check against zero. > > Detected by CoverityScan, CID# 1442593: Control flow

Re: [PATCH net] vhost: correctly check the return value of translate_desc() in log_used()

2019-02-15 Thread David Miller
From: Jason Wang Date: Fri, 15 Feb 2019 15:53:24 +0800 > When fail, translate_desc() returns negative value, otherwise the > number of iovs. So we should fail when the return value is negative > instead of a blindly check against zero. > > Reported-by: Stephen Hemminger > Fixes: cc5e71075947

Re: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames

2019-02-04 Thread David Miller
From: Toshiaki Makita Date: Thu, 31 Jan 2019 20:40:30 +0900 > Previously virtnet_xdp_xmit() did not account for device tx counters, > which caused confusions. > To be consistent with SKBs, account them on freeing xdp_frames. > > Reported-by: David Ahern > Signed-off-by: Toshiaki Makita

Re: [PATCH v3 0/2] vsock/virtio: fix issues on device hot-unplug

2019-02-04 Thread David Miller
From: Stefano Garzarella Date: Fri, 1 Feb 2019 12:42:05 +0100 > These patches try to handle the hot-unplug of vsock virtio transport device in > a proper way. > > Maybe move the vsock_core_init()/vsock_core_exit() functions in the > module_init > and module_exit of vsock_virtio_transport

Re: [PATCH v2 net 0/7] virtio_net: Fix problems around XDP tx and napi_tx

2019-01-31 Thread David Miller
From: Toshiaki Makita Date: Tue, 29 Jan 2019 09:45:52 +0900 > While I'm looking into how to account standard tx counters on XDP tx > processing, I found several bugs around XDP tx and napi_tx. > > Patch1: Fix oops on error path. Patch2 depends on this. > Patch2: Fix memory corruption on freeing

Re: [PATCH net] vhost: fix OOB in get_rx_bufs()

2019-01-31 Thread David Miller
From: "Michael S. Tsirkin" Date: Tue, 29 Jan 2019 20:36:31 -0500 > If it helps I can include most virtio stuff in my pull requests instead. > Or if that can't work since there's too often a dependency on net-next, > maybe Jason wants to create a tree and send pull requests to you. Let > us know

Re: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames

2019-01-31 Thread David Miller
From: "Michael S. Tsirkin" Date: Thu, 31 Jan 2019 10:25:17 -0500 > On Thu, Jan 31, 2019 at 08:40:30PM +0900, Toshiaki Makita wrote: >> Previously virtnet_xdp_xmit() did not account for device tx counters, >> which caused confusions. >> To be consistent with SKBs, account them on freeing

Re: [PATCH net] vhost: fix OOB in get_rx_bufs()

2019-01-29 Thread David Miller
From: Jason Wang Date: Mon, 28 Jan 2019 15:05:05 +0800 > After batched used ring updating was introduced in commit e2b3b35eb989 > ("vhost_net: batch used ring update in rx"). We tend to batch heads in > vq->heads for more than one packet. But the quota passed to > get_rx_bufs() was not correctly

Re: [PATCH net] vhost: fix OOB in get_rx_bufs()

2019-01-29 Thread David Miller
From: David Miller Date: Tue, 29 Jan 2019 15:10:26 -0800 (PST) > Yeah the CVE pushed my hand a little bit, and I knew I was going to > send Linus a pull request today because David Watson needs some TLS > changes in net-next. I also want to make a general comment for the record.

Re: [PATCH net] vhost: fix OOB in get_rx_bufs()

2019-01-29 Thread David Miller
From: "Michael S. Tsirkin" Date: Tue, 29 Jan 2019 17:54:44 -0500 > On Mon, Jan 28, 2019 at 10:54:44PM -0800, David Miller wrote: >> From: Jason Wang >> Date: Mon, 28 Jan 2019 15:05:05 +0800 >> >> > After batched used ring updating was introduced in com

Re: [PATCH net-next V4 0/5] vhost: accelerate metadata access through vmap()

2019-01-27 Thread David Miller
From: Jason Wang Date: Wed, 23 Jan 2019 17:55:52 +0800 > This series tries to access virtqueue metadata through kernel virtual > address instead of copy_user() friends since they had too much > overheads like checks, spec barriers or even hardware feature > toggling. > > Test shows about 24%

Re: [PATCH net-next V4 0/5] vhost: accelerate metadata access through vmap()

2019-01-23 Thread David Miller
From: "Michael S. Tsirkin" Date: Wed, 23 Jan 2019 08:58:07 -0500 > On Wed, Jan 23, 2019 at 05:55:52PM +0800, Jason Wang wrote: >> This series tries to access virtqueue metadata through kernel virtual >> address instead of copy_user() friends since they had too much >> overheads like checks, spec

Re: [PATCH v2] virtio_net: bulk free tx skbs

2019-01-19 Thread David Miller
From: "Michael S. Tsirkin" Date: Thu, 17 Jan 2019 23:20:07 -0500 > Use napi_consume_skb() to get bulk free. Note that napi_consume_skb is > safe to call in a non-napi context as long as the napi_budget flag is > correct. > > Signed-off-by: Michael S. Tsirkin Applied, thanks.

Re: [PATCH net V4] vhost: log dirty page correctly

2019-01-18 Thread David Miller
From: Jason Wang Date: Wed, 16 Jan 2019 16:54:42 +0800 > Vhost dirty page logging API is designed to sync through GPA. But we > try to log GIOVA when device IOTLB is enabled. This is wrong and may > lead to missing data after migration. > > To solve this issue, when logging with device IOTLB

Re: [PATCH net V4] vhost: log dirty page correctly

2019-01-17 Thread David Miller
From: Jason Wang Date: Wed, 16 Jan 2019 16:54:42 +0800 > Vhost dirty page logging API is designed to sync through GPA. But we > try to log GIOVA when device IOTLB is enabled. This is wrong and may > lead to missing data after migration. > > To solve this issue, when logging with device IOTLB

Re: [PATCH] vhost/vsock: fix vhost vsock cid hashing inconsistent

2019-01-16 Thread David Miller
From: Zha Bin Date: Tue, 8 Jan 2019 16:07:03 +0800 > The vsock core only supports 32bit CID, but the Virtio-vsock spec define > CID (dst_cid and src_cid) as u64 and the upper 32bits is reserved as > zero. This inconsistency causes one bug in vhost vsock driver. The > scenarios is: > > 0. A

Re: [PATCH net-next] virtio_net: bulk free tx skbs

2019-01-16 Thread David Miller
From: "Michael S. Tsirkin" Date: Mon, 14 Jan 2019 20:34:26 -0500 > Use napi_consume_skb() to get bulk free. Note that napi_consume_skb is > safe to call in a non-napi context as long as the napi_budget flag is > correct. > > Signed-off-by: Michael S. Tsirkin > --- > > My perf testing setup

Re: [RFC PATCH V2 3/3] vhost: access vq metadata through kernel virtual address

2018-12-28 Thread David Miller
From: Jason Wang Date: Fri, 28 Dec 2018 15:55:37 +0800 > +static int vhost_invalidate_vmap(struct vhost_virtqueue *vq, > + struct vhost_vmap *map, > + unsigned long uaddr, > + unsigned long start, > +

Re: [PATCH v2] VSOCK: Send reset control packet when socket is partially bound

2018-12-19 Thread David Miller
From: Jorgen Hansen Date: Tue, 18 Dec 2018 00:34:06 -0800 > If a server side socket is bound to an address, but not in the listening > state yet, incoming connection requests should receive a reset control > packet in response. However, the function used to send the reset > silently drops the

Re: [PATCH] VSOCK: Send reset control packet when socket is partially bound

2018-12-19 Thread David Miller
From: Jorgen Hansen Date: Wed, 12 Dec 2018 01:38:59 -0800 > static int vmci_transport_send_reset_bh(struct sockaddr_vm *dst, > @@ -312,12 +328,29 @@ static int vmci_transport_send_reset_bh(struct > sockaddr_vm *dst, > static int vmci_transport_send_reset(struct sock *sk, >

Re: [PATCH net-next 3/3] vhost: access vq metadata through kernel virtual address

2018-12-18 Thread David Miller
From: Jason Wang Date: Fri, 14 Dec 2018 11:57:35 +0800 > This is the price of all GUP users not only vhost itself. What's more > important, the goal is not to be left too much behind for other > backends like DPDK or AF_XDP (all of which are using GUP). +1

Re: [PATCH] vhost: return EINVAL if iovecs size does not match the message size

2018-12-18 Thread David Miller
From: Pavel Tikhomirov Date: Thu, 13 Dec 2018 17:53:50 +0300 > We've failed to copy and process vhost_iotlb_msg so let userspace at > least know about it. For instance before these patch the code below runs > without any error: ... > Signed-off-by: Pavel Tikhomirov Michael, will you be taking

Re: [PATCH net-next 0/3] vhost: accelerate metadata access through vmap()

2018-12-18 Thread David Miller
From: Jason Wang Date: Fri, 14 Dec 2018 12:29:54 +0800 > > On 2018/12/14 上午4:12, Michael S. Tsirkin wrote: >> On Thu, Dec 13, 2018 at 06:10:19PM +0800, Jason Wang wrote: >>> Hi: >>> >>> This series tries to access virtqueue metadata through kernel virtual >>> address instead of copy_user()

Re: [PATCH v2 2/5] VSOCK: support fill data to mergeable rx buffer in host

2018-12-15 Thread David Miller
From: jiangyiwen Date: Thu, 13 Dec 2018 11:11:48 +0800 > I hope Host can fill fewer bytes into rx virtqueue, so > I keep structure virtio_vsock_mrg_rxbuf_hdr one byte > alignment. The question is if this actully matters. Do you know? If the obejct this is embeeded inside of is at least 2 byte

Re: [PATCH net V2 0/4] Fix various issue of vhost

2018-12-15 Thread David Miller
From: Jason Wang Date: Wed, 12 Dec 2018 18:08:15 +0800 > This series tries to fix various issues of vhost: > > - Patch 1 adds a missing write barrier between used idx updating and > logging. > - Patch 2-3 brings back the protection of device IOTLB through vq > mutex, this fixes possible use

Re: [PATCH v2 2/5] VSOCK: support fill data to mergeable rx buffer in host

2018-12-15 Thread David Miller
From: jiangyiwen Date: Wed, 12 Dec 2018 17:29:31 +0800 > diff --git a/include/uapi/linux/virtio_vsock.h > b/include/uapi/linux/virtio_vsock.h > index 1d57ed3..2292f30 100644 > --- a/include/uapi/linux/virtio_vsock.h > +++ b/include/uapi/linux/virtio_vsock.h > @@ -63,6 +63,11 @@ struct

Re: [PATCH v2 1/5] VSOCK: support fill mergeable rx buffer in guest

2018-12-14 Thread David Miller
From: jiangyiwen Date: Wed, 12 Dec 2018 17:28:16 +0800 > +static int fill_mergeable_rx_buff(struct virtio_vsock *vsock, > + struct virtqueue *vq) > +{ > + struct page_frag *alloc_frag = >alloc_frag; > + struct scatterlist sg; > + /* Currently we don't use ewma len, use

Re: [PATCH net V3 0/3] Fix various issue of vhost

2018-12-12 Thread David Miller
From: Jason Wang Date: Thu, 13 Dec 2018 10:53:36 +0800 > This series tries to fix various issues of vhost: > > - Patch 1 adds a missing write barrier between used idx updating and > logging. > - Patch 2-3 brings back the protection of device IOTLB through vq > mutex, this fixes possible use

Re: [PATCH net 0/4] Fix various issue of vhost

2018-12-11 Thread David Miller
From: Jason Wang Date: Mon, 10 Dec 2018 17:44:50 +0800 > This series tries to fix various issues of vhost: > > - Patch 1 adds a missing write barrier between used idx updating and > logging. > - Patch 2-3 brings back the protection of device IOTLB through vq > mutex, this fixes possible use

Re: [PATCH v2] vhost: fix IOTLB locking

2018-12-03 Thread David Miller
From: Jean-Philippe Brucker Date: Fri, 30 Nov 2018 16:05:53 + > Commit 78139c94dc8c ("net: vhost: lock the vqs one by one") moved the vq > lock to improve scalability, but introduced a possible deadlock in > vhost-iotlb. vhost_iotlb_notify_vq() now takes vq->mutex while holding > the

Re: [PATCH net] virtio-net: keep vnet header zeroed after processing XDP

2018-11-30 Thread David Miller
From: Jason Wang Date: Thu, 29 Nov 2018 13:53:16 +0800 > We copy vnet header unconditionally in page_to_skb() this is wrong > since XDP may modify the packet data. So let's keep a zeroed vnet > header for not confusing the conversion between vnet header and skb > metadata. > > In the future, we

Re: [PATCH net-next v3 00/13] virtio: support packed ring

2018-11-26 Thread David Miller
From: "Michael S. Tsirkin" Date: Tue, 27 Nov 2018 01:08:08 -0500 > On Wed, Nov 21, 2018 at 06:03:17PM +0800, Tiwei Bie wrote: >> Hi, >> >> This patch set implements packed ring support in virtio driver. >> >> A performance test between pktgen (pktgen_sample03_burst_single_flow.sh) >> and DPDK

Re: [PATCH net 2/2] virtio-net: fail XDP set if guest csum is negotiated

2018-11-24 Thread David Miller
From: Jason Wang Date: Thu, 22 Nov 2018 14:36:31 +0800 > We don't support partial csumed packet since its metadata will be lost > or incorrect during XDP processing. So fail the XDP set if guest_csum > feature is negotiated. > > Fixes: f600b6905015 ("virtio_net: Add XDP support") > Reported-by:

Re: [PATCH net 1/2] virtio-net: disable guest csum during XDP set

2018-11-24 Thread David Miller
From: Jason Wang Date: Thu, 22 Nov 2018 14:36:30 +0800 > We don't disable VIRTIO_NET_F_GUEST_CSUM if XDP was set. This means we > can receive partial csumed packets with metadata kept in the > vnet_hdr. This may have several side effects: > > - It could be overridden by header adjustment, thus

Re: [PATCH net-next v3 00/13] virtio: support packed ring

2018-11-21 Thread David Miller
From: "Michael S. Tsirkin" Date: Wed, 21 Nov 2018 07:20:27 -0500 > Dave, given the holiday, attempts to wrap up the 1.1 spec and the > patchset size I would very much appreciate a bit more time for > review. Say until Nov 28? Ok. ___ Virtualization

Re: [PATCH net-next 2/2] tuntap: free XDP dropped packets in a batch

2018-11-17 Thread David Miller
From: Jason Wang Date: Thu, 15 Nov 2018 17:43:10 +0800 > Thanks to the batched XDP buffs through msg_control. Instead of > calling put_page() for each page which involves a atomic operation, > let's batch them by record the last page that needs to be freed and > its refcnt count and free them in

Re: [PATCH net-next 1/2] vhost_net: mitigate page reference counting during page frag refill

2018-11-17 Thread David Miller
From: Jason Wang Date: Thu, 15 Nov 2018 17:43:09 +0800 > We do a get_page() which involves a atomic operation. This patch tries > to mitigate a per packet atomic operation by maintaining a reference > bias which is initially USHRT_MAX. Each time a page is got, instead of > calling get_page() we

Re: [PATCH net] vhost: Fix Spectre V1 vulnerability

2018-10-31 Thread David Miller
From: Jason Wang Date: Tue, 30 Oct 2018 14:10:49 +0800 > The idx in vhost_vring_ioctl() was controlled by userspace, hence a > potential exploitation of the Spectre variant 1 vulnerability. > > Fixing this by sanitizing idx before using it to index d->vqs. > > Cc: Michael S. Tsirkin > Cc:

Re: [PATCH] virtio_net: add local_bh_disable() around u64_stats_update_begin

2018-10-18 Thread David Miller
From: Sebastian Andrzej Siewior Date: Thu, 18 Oct 2018 10:43:13 +0200 > on 32bit, lockdep notices that virtnet_open() and refill_work() invoke > try_fill_recv() from process context while virtnet_receive() invokes the > same function from BH context. The problem that the seqcounter within >

Re: [PATCH v3] virtio_net: avoid using netif_tx_disable() for serializing tx routine

2018-10-17 Thread David Miller
From: Ake Koomsin Date: Wed, 17 Oct 2018 19:44:12 +0900 > Commit 713a98d90c5e ("virtio-net: serialize tx routine during reset") > introduces netif_tx_disable() after netif_device_detach() in order to > avoid use-after-free of tx queues. However, there are two issues. > > 1) Its operation is

Re: [PATCH net-next V3] virtio_net: ethtool tx napi configuration

2018-10-10 Thread David Miller
From: Jason Wang Date: Tue, 9 Oct 2018 10:06:26 +0800 > Implement ethtool .set_coalesce (-C) and .get_coalesce (-c) handlers. > Interrupt moderation is currently not supported, so these accept and > display the default settings of 0 usec and 1 frame. > > Toggle tx napi through setting

Re: [REBASE PATCH net-next v9 0/4] net: vhost: improve performance when enable busyloop

2018-09-26 Thread David Miller
From: xiangxia.m@gmail.com Date: Tue, 25 Sep 2018 05:36:48 -0700 > From: Tonghao Zhang > > This patches improve the guest receive performance. > On the handle_tx side, we poll the sock receive queue > at the same time. handle_rx do that in the same way. > > For more performance report, see

Re: [PATCH net-next V2] virtio_net: ethtool tx napi configuration

2018-09-13 Thread David Miller
From: Jason Wang Date: Thu, 13 Sep 2018 13:35:45 +0800 > Toggle tx napi through a bit in tx-frames. This is not what the code implements as the interface any more. Please fix the commit message to match the code. Thanks. ___ Virtualization mailing

Re: [PATCH net-next V2 00/11] vhost_net TX batching

2018-09-13 Thread David Miller
From: "Michael S. Tsirkin" Date: Thu, 13 Sep 2018 14:02:13 -0400 > On Thu, Sep 13, 2018 at 09:28:19AM -0700, David Miller wrote: >> From: Jason Wang >> Date: Wed, 12 Sep 2018 11:16:58 +0800 >> >> > This series tries to batch submitting packets to un

  1   2   3   4   5   >