Re: consistency for statistics with XDP mode

2018-12-04 Thread Michael S. Tsirkin
On Tue, Dec 04, 2018 at 10:29:04AM +0100, Jesper Dangaard Brouer wrote: > On Mon, 3 Dec 2018 23:24:18 -0800 > Jakub Kicinski wrote: > > > On Tue, 04 Dec 2018 09:03:52 +0200, Toke Høiland-Jørgensen wrote: > > > David Miller writes: > > > > > > > From: David Ahern > > > > Date: Mon, 3 Dec

Re: [PATCH v2 net] tun: remove skb access after netif_receive_skb

2018-12-03 Thread Michael S. Tsirkin
_fork+0x35/0x40 > [613.088705] > [613.088705] The buggy address belongs to the object at 8881da9ab740 > [613.088705] which belongs to the cache skbuff_head_cache of size 232 > > Fixes: 043d222f93ab ("tuntap: accept an array of XDP buffs through sendmsg()") > Revie

Re: consistency for statistics with XDP mode

2018-11-30 Thread Michael S. Tsirkin
On Fri, Nov 30, 2018 at 08:10:58PM +, Saeed Mahameed wrote: > On Thu, 2018-11-22 at 18:00 +0100, Toke Høiland-Jørgensen wrote: > > David Ahern writes: > > > > > On 11/22/18 1:26 AM, Toke Høiland-Jørgensen wrote: > > > > Saeed Mahameed writes: > > > > > > > > > > > I'd say it sounds

Re: [PATCH] [PATCH net-next] tun: fix multiqueue rx

2018-11-16 Thread Michael S. Tsirkin
ation between descriptor and rx queue. > > Signed-off-by: Matthew Cover Acked-by: Michael S. Tsirkin stable material? > --- > drivers/net/tun.c | 7 ++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/tun.c b/drivers/net/tun.c

af_xdp zero copy ideas

2018-11-14 Thread Michael S. Tsirkin
So a I mentioned during the presentation for the af_xdp zero copy I think it's pretty important to be able to close the device and get back the affected memory. One way would be to unmap the DMA memory from userspace and map in some other memory. It's tricky since you need to also replace the

Re: [virtio-dev] Re: [PATCH net-next v2 0/5] virtio: support packed ring

2018-10-11 Thread Michael S. Tsirkin
On Thu, Oct 11, 2018 at 10:13:31PM +0800, Tiwei Bie wrote: > On Thu, Oct 11, 2018 at 09:48:48AM -0400, Michael S. Tsirkin wrote: > > On Thu, Oct 11, 2018 at 08:12:21PM +0800, Tiwei Bie wrote: > > > > > But if it's not too late, I second for a OUT_OF_ORDER feature. > >

Re: [virtio-dev] Re: [PATCH net-next v2 0/5] virtio: support packed ring

2018-10-11 Thread Michael S. Tsirkin
On Thu, Oct 11, 2018 at 08:12:21PM +0800, Tiwei Bie wrote: > > > But if it's not too late, I second for a OUT_OF_ORDER feature. > > > Starting from in order can have much simpler code in driver. > > > > > > Thanks > > > > It's tricky to change the flag polarity because of compatibility > > with

Re: [PATCH net V2] vhost-vsock: fix use after free

2018-09-27 Thread Michael S. Tsirkin
On Fri, Sep 28, 2018 at 07:37:37AM +0800, Jason Wang wrote: > > > On 2018年09月28日 01:04, Michael S. Tsirkin wrote: > > On Thu, Sep 27, 2018 at 08:22:04PM +0800, Jason Wang wrote: > > > The access of vsock is not protected by vhost_vsock_lock. This may > >

Re: [PATCH net V2] vhost-vsock: fix use after free

2018-09-27 Thread Michael S. Tsirkin
On Thu, Sep 27, 2018 at 08:22:04PM +0800, Jason Wang wrote: > The access of vsock is not protected by vhost_vsock_lock. This may > lead to use after free since vhost_vsock_dev_release() may free the > pointer at the same time. > > Fix this by holding the lock during the access. > > Reported-by:

Re: [PATCH net-next v2] net: allow to call netif_reset_xps_queues() under cpus_read_lock

2018-08-09 Thread Michael S. Tsirkin
_vqs+0x513/0x5a0 > #2: 5cd8463f (xps_map_mutex){+.+.}, at: > __netif_set_xps_queue+0x8d/0xc60 > > v2: move cpus_read_lock() out of __netif_set_xps_queue() FYI you change log should go after -- below, not before it. > Cc: "Nambiar, Amritha" > Cc: "Michael

Re: [PATCH net-next] vhost: switch to use new message format

2018-08-03 Thread Michael S. Tsirkin
ost.h > index c51f8e5..c176e9d 100644 > --- a/include/uapi/linux/vhost.h > +++ b/include/uapi/linux/vhost.h > @@ -65,6 +65,7 @@ struct vhost_iotlb_msg { > }; > > #define VHOST_IOTLB_MSG 0x1 > +#define VHOST_IOTLB_MSG_V2 0x2 > > struct vhost_msg { > int type; > @@ -74,6 +75,15 @@ struct vhost_msg { > }; > }; > > +struct vhost_msg_v2 { > + int type; > + __u32 reserved; > + union { > + struct vhost_iotlb_msg iotlb; > + __u8 padding[64]; > + }; > +}; > + > struct vhost_memory_region { > __u64 guest_phys_addr; > __u64 memory_size; /* bytes */ > @@ -160,6 +170,14 @@ struct vhost_memory { > #define VHOST_GET_VRING_BUSYLOOP_TIMEOUT _IOW(VHOST_VIRTIO, 0x24,\ >struct vhost_vring_state) > > +/* Set or get vhost backend capability */ > + > +/* Use message type V2 */ > +#define VHOST_BACKEND_F_IOTLB_MSG_V2 0x1 > + > +#define VHOST_SET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x25, __u64) > +#define VHOST_GET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x26, __u64) > + > /* VHOST_NET specific defines */ > > /* Attach virtio net ring to a raw socket, or tap device. Acked-by: Michael S. Tsirkin > -- > 2.7.4

Re: [PATCH net-next] virtio_net: force_napi_tx module param.

2018-08-01 Thread Michael S. Tsirkin
On Wed, Aug 01, 2018 at 06:43:53PM -0400, Willem de Bruijn wrote: > > > So e.g. we could set an affinity hint to a group of CPUs that > > > > might transmit to this queue. > > > > > > We also want to set the xps mask for all cpus in the group to this queue. > > > > > > Is there a benefit over

Re: [PATCH net-next] virtio_net: force_napi_tx module param.

2018-08-01 Thread Michael S. Tsirkin
On Mon, Jul 30, 2018 at 02:06:50PM +0800, Jason Wang wrote: > > > On 2018年07月25日 08:17, Jon Olson wrote: > > On Tue, Jul 24, 2018 at 3:46 PM Michael S. Tsirkin wrote: > > > On Tue, Jul 24, 2018 at 06:31:54PM -0400, Willem de Bruijn wrote: > > > > On Tu

Re: [PATCH net-next] virtio_net: force_napi_tx module param.

2018-08-01 Thread Michael S. Tsirkin
On Wed, Aug 01, 2018 at 11:46:14AM -0400, Willem de Bruijn wrote: > On Tue, Jul 31, 2018 at 8:34 AM Michael S. Tsirkin wrote: > > > > On Sun, Jul 29, 2018 at 05:32:56PM -0400, Willem de Bruijn wrote: > > > On Sun, Jul 29, 2018 at 12:01 PM David Miller wrote: > >

Re: [PATCH net-next] virtio_net: force_napi_tx module param.

2018-07-31 Thread Michael S. Tsirkin
On Sun, Jul 29, 2018 at 05:32:56PM -0400, Willem de Bruijn wrote: > On Sun, Jul 29, 2018 at 12:01 PM David Miller wrote: > > > > From: Caleb Raitto > > Date: Mon, 23 Jul 2018 16:11:19 -0700 > > > > > From: Caleb Raitto > > > > > > The driver disables tx napi if it's not certain that completions

Re: [PATCH net-next] virtio_net: force_napi_tx module param.

2018-07-29 Thread Michael S. Tsirkin
On Sun, Jul 29, 2018 at 09:00:27AM -0700, David Miller wrote: > From: Caleb Raitto > Date: Mon, 23 Jul 2018 16:11:19 -0700 > > > From: Caleb Raitto > > > > The driver disables tx napi if it's not certain that completions will > > be processed affine with tx service. > > > > Its heuristic

Re: [PATCH net-next 0/6] virtio_net: Add ethtool stat items

2018-07-25 Thread Michael S. Tsirkin
On Mon, Jul 23, 2018 at 11:36:03PM +0900, Toshiaki Makita wrote: > From: Toshiaki Makita > > Add some ethtool stat items useful for performance analysis. > > Signed-off-by: Toshiaki Makita Series: Acked-by: Michael S. Tsirkin Patch 1 seems appropriate for stable, even th

Re: [PATCH net-next] virtio_net: force_napi_tx module param.

2018-07-24 Thread Michael S. Tsirkin
On Tue, Jul 24, 2018 at 06:31:54PM -0400, Willem de Bruijn wrote: > On Tue, Jul 24, 2018 at 6:23 PM Michael S. Tsirkin wrote: > > > > On Tue, Jul 24, 2018 at 04:52:53PM -0400, Willem de Bruijn wrote: > > > >From the above linked patch, I understand that there are ye

Re: [PATCH net-next] virtio_net: force_napi_tx module param.

2018-07-24 Thread Michael S. Tsirkin
On Tue, Jul 24, 2018 at 04:52:53PM -0400, Willem de Bruijn wrote: > >From the above linked patch, I understand that there are yet > other special cases in production, such as a hard cap on #tx queues to > 32 regardless of number of vcpus. I don't think upstream kernels have this limit - we can

Re: [PATCH net-next] virtio_net: force_napi_tx module param.

2018-07-24 Thread Michael S. Tsirkin
On Tue, Jul 24, 2018 at 10:01:39AM -0400, Willem de Bruijn wrote: > On Tue, Jul 24, 2018 at 6:44 AM Michael S. Tsirkin wrote: > > > > On Mon, Jul 23, 2018 at 04:11:19PM -0700, Caleb Raitto wrote: > > > From: Caleb Raitto > > > > > > The d

Re: [PATCH net-next] virtio_net: force_napi_tx module param.

2018-07-24 Thread Michael S. Tsirkin
On Mon, Jul 23, 2018 at 04:11:19PM -0700, Caleb Raitto wrote: > From: Caleb Raitto > > The driver disables tx napi if it's not certain that completions will > be processed affine with tx service. > > Its heuristic doesn't account for some scenarios where it is, such as > when the queue pair

Re: [PATCH net] failover: eliminate callback hell

2018-06-11 Thread Michael S. Tsirkin
On Mon, Jun 11, 2018 at 11:56:56AM -0700, Siwei Liu wrote: > The current implementation may only work with new userspace, even so > the eth0/eth0nsby naming is not consistenly persisted due to races in > bus probing. Which race do you mean exactly? -- MST

Re: [PATCH net] failover: eliminate callback hell

2018-06-11 Thread Michael S. Tsirkin
On Mon, Jun 04, 2018 at 08:42:31PM -0700, Stephen Hemminger wrote: > * Set permanent and current address of net_failover device > to match the primary. > > * Carrier should be marked off before registering device > the net_failover device. Sridhar, do we want to address this? If yes,

Re: [PATCH net] failover: eliminate callback hell

2018-06-11 Thread Michael S. Tsirkin
On Wed, Jun 06, 2018 at 03:21:21PM -0700, Stephen Hemminger wrote: > > > > > > I think you need to get rid of triggering off of the name change. > > > > Worth considering down the road since it's a bit of a hack but it's one > > we won't have trouble supporting, unlike the delayed uplink. > >

Re: [PATCH net] failover: eliminate callback hell

2018-06-11 Thread Michael S. Tsirkin
; > > > > >> On Wed, Jun 6, 2018 at 2:24 PM, Stephen Hemminger > > >> wrote: > > >> > On Wed, 6 Jun 2018 15:30:27 +0300 > > >> > "Michael S. Tsirkin" wrote: > > >> > > > >> >> On Wed, Jun

Re: [PATCH net] failover: eliminate callback hell

2018-06-08 Thread Michael S. Tsirkin
On Fri, Jun 08, 2018 at 11:30:08AM -0700, Stephen Hemminger wrote: > * what about nested KVM on Hyper-V? Would it make sense to > have a way to pass subset of VF queues to guest? No as long as hyper-v doesn't have a vIOMMU. -- MST

Re: [PATCH net] failover: eliminate callback hell

2018-06-07 Thread Michael S. Tsirkin
On Thu, Jun 07, 2018 at 09:17:42AM -0700, Stephen Hemminger wrote: > On Thu, 7 Jun 2018 18:41:31 +0300 > "Michael S. Tsirkin" wrote: > > > > > Why would DPDK care what we do in the kernel? Isn't it just slapping > > > > vfio-pci on the netdevs it

Re: [PATCH net] failover: eliminate callback hell

2018-06-07 Thread Michael S. Tsirkin
rala, Sridhar" wrote: > > > > > >> On 6/6/2018 2:24 PM, Stephen Hemminger wrote: > > >> > On Wed, 6 Jun 2018 15:30:27 +0300 > > >> > "Michael S. Tsirkin" wrote: > > >> > > > >> >> On Wed, Jun

Re: [PATCH net] failover: eliminate callback hell

2018-06-07 Thread Michael S. Tsirkin
On Wed, Jun 06, 2018 at 03:24:08PM -0700, Stephen Hemminger wrote: > On Thu, 7 Jun 2018 00:47:52 +0300 > "Michael S. Tsirkin" wrote: > > > On Wed, Jun 06, 2018 at 02:24:47PM -0700, Stephen Hemminger wrote: > > > On Wed, 6 Jun 2018 15:30:27 +0300

Re: [PATCH net] failover: eliminate callback hell

2018-06-06 Thread Michael S. Tsirkin
On Wed, Jun 06, 2018 at 02:24:47PM -0700, Stephen Hemminger wrote: > On Wed, 6 Jun 2018 15:30:27 +0300 > "Michael S. Tsirkin" wrote: > > > On Wed, Jun 06, 2018 at 09:25:12AM +0200, Jiri Pirko wrote: > > > Tue, Jun 05, 2018 at 05:42:31AM CEST, step...@networkp

Re: [PATCH net] failover: eliminate callback hell

2018-06-06 Thread Michael S. Tsirkin
dhar" wrote: > > > > > >> On 6/5/2018 8:51 PM, Stephen Hemminger wrote: > > >>> On Tue, 5 Jun 2018 16:52:22 -0700 > > >>> "Samudrala, Sridhar" wrote: > > >>> > > >>>> On 6/5/2018 2:52

Re: [PATCH net] failover: eliminate callback hell

2018-06-06 Thread Michael S. Tsirkin
On Wed, Jun 06, 2018 at 09:25:12AM +0200, Jiri Pirko wrote: > Tue, Jun 05, 2018 at 05:42:31AM CEST, step...@networkplumber.org wrote: > >The net failover should be a simple library, not a virtual > >object with function callbacks (see callback hell). > > Why just a library? It should do a common

Re: [PATCH net] failover: eliminate callback hell

2018-06-06 Thread Michael S. Tsirkin
On Tue, Jun 05, 2018 at 08:51:18PM -0700, Stephen Hemminger wrote: > > I think the push back was with the usage of the delay, not bringing up the > > primary/standby > > device in the name change event handler. > > Can't netvsc use this mechanism instead of depending on the delay? > > > > > >

Re: [PATCH net] failover: eliminate callback hell

2018-06-05 Thread Michael S. Tsirkin
On Tue, Jun 05, 2018 at 11:53:05AM -0700, Stephen Hemminger wrote: > > > * Now, netvsc and net_failover use the same delayed work type > > > mechanism for setup. Previously, net_failover code was triggering off > > > name change but a similar policy was rejected for netvsc. > > >

Re: [PATCH net] failover: eliminate callback hell

2018-06-05 Thread Michael S. Tsirkin
Thanks, I think this is nice patch but I wonder whether it can be split up somewhat. Not all of it is uncontroversial. On Mon, Jun 04, 2018 at 08:42:31PM -0700, Stephen Hemminger wrote: > * The matching of secondary device to primary device policy > is up to the network device. Both

Re: [RFC PATCH net-next 00/12] XDP batching for TUN/vhost_net

2018-05-25 Thread Michael S. Tsirkin
On Mon, May 21, 2018 at 05:04:21PM +0800, Jason Wang wrote: > Hi all: > > We do not support XDP batching for TUN since it can only receive one > packet a time from vhost_net. This series tries to remove this > limitation by: > > - introduce a TUN specific msg_control that can hold a pointer to

Re: [PATCH net-next v12 0/5] Enable virtio_net to act as a standby for a passthru device

2018-05-25 Thread Michael S. Tsirkin
the guest to switch over to VF datapath. > > This patch is based on the discussion initiated by Jesse on this thread. > https://marc.info/?l=linux-virtualization=151189725224231=2 Series: Acked-by: Michael S. Tsirkin <m...@redhat.com> > v12: > - Tested live migration

Re: [PATCH net] vhost: synchronize IOTLB message with dev cleanup

2018-05-24 Thread Michael S. Tsirkin
t;vhost: new device IOTLB API") > Signed-off-by: Jason Wang <jasow...@redhat.com> We should think of a way to have a per-vq lock here, but for now: Acked-by: Michael S. Tsirkin <m...@redhat.com> > --- > drivers/vhost/vhost.c | 3 +++ > 1 file changed, 3

Re: [PATCH net-next v11 2/5] netvsc: refactor notifier/event handling code to use the failover framework

2018-05-22 Thread Michael S. Tsirkin
On Tue, May 22, 2018 at 07:38:44PM +0200, Jiri Pirko wrote: > >> >> In private > >> >> flag. I don't see no reason to break this pattern here. > >> > > >> >Other masters are setup from userspace, this one is set up automatically > >> >by kernel. So the bar is higher, we need an interface that

Re: [PATCH net-next v11 2/5] netvsc: refactor notifier/event handling code to use the failover framework

2018-05-22 Thread Michael S. Tsirkin
On Tue, May 22, 2018 at 05:45:01PM +0200, Jiri Pirko wrote: > Tue, May 22, 2018 at 05:32:30PM CEST, m...@redhat.com wrote: > >On Tue, May 22, 2018 at 05:13:43PM +0200, Jiri Pirko wrote: > >> Tue, May 22, 2018 at 03:39:33PM CEST, m...@redhat.com wrote: > >> >On Tue, May 22, 2018 at 03:26:26PM

Re: Shepherd request (P83): Multipath TCP: Present Use Cases and an Upstream Future

2018-05-22 Thread Michael S. Tsirkin
On Tue, May 22, 2018 at 05:36:14PM +0200, Jiri Pirko wrote: > Tue, May 22, 2018 at 05:28:42PM CEST, sridhar.samudr...@intel.com wrote: > > > >On 5/22/2018 2:08 AM, Jiri Pirko wrote: > >> Tue, May 22, 2018 at 11:06:37AM CEST, j...@resnulli.us wrote: > >> > Tue, May 22, 2018 at 04:06:18AM CEST,

Re: [PATCH net-next v11 2/5] netvsc: refactor notifier/event handling code to use the failover framework

2018-05-22 Thread Michael S. Tsirkin
On Tue, May 22, 2018 at 05:13:43PM +0200, Jiri Pirko wrote: > Tue, May 22, 2018 at 03:39:33PM CEST, m...@redhat.com wrote: > >On Tue, May 22, 2018 at 03:26:26PM +0200, Jiri Pirko wrote: > >> Tue, May 22, 2018 at 03:17:37PM CEST, m...@redhat.com wrote: > >> >On Tue, May 22, 2018 at 03:14:22PM

Re: [PATCH net-next v11 2/5] netvsc: refactor notifier/event handling code to use the failover framework

2018-05-22 Thread Michael S. Tsirkin
On Tue, May 22, 2018 at 03:26:26PM +0200, Jiri Pirko wrote: > Tue, May 22, 2018 at 03:17:37PM CEST, m...@redhat.com wrote: > >On Tue, May 22, 2018 at 03:14:22PM +0200, Jiri Pirko wrote: > >> Tue, May 22, 2018 at 03:12:40PM CEST, m...@redhat.com wrote: > >> >On Tue, May 22, 2018 at 11:08:53AM

Re: [PATCH net-next v11 2/5] netvsc: refactor notifier/event handling code to use the failover framework

2018-05-22 Thread Michael S. Tsirkin
On Tue, May 22, 2018 at 03:14:22PM +0200, Jiri Pirko wrote: > Tue, May 22, 2018 at 03:12:40PM CEST, m...@redhat.com wrote: > >On Tue, May 22, 2018 at 11:08:53AM +0200, Jiri Pirko wrote: > >> Tue, May 22, 2018 at 11:06:37AM CEST, j...@resnulli.us wrote: > >> >Tue, May 22, 2018 at 04:06:18AM CEST,

Re: [PATCH net-next v11 2/5] netvsc: refactor notifier/event handling code to use the failover framework

2018-05-22 Thread Michael S. Tsirkin
On Tue, May 22, 2018 at 11:08:53AM +0200, Jiri Pirko wrote: > Tue, May 22, 2018 at 11:06:37AM CEST, j...@resnulli.us wrote: > >Tue, May 22, 2018 at 04:06:18AM CEST, sridhar.samudr...@intel.com wrote: > >>Use the registration/notification framework supported by the generic > >>failover

Re: KASAN: use-after-free Read in vhost_chr_write_iter

2018-05-21 Thread Michael S. Tsirkin
On Tue, May 22, 2018 at 11:50:29AM +0800, Jason Wang wrote: > > > On 2018年05月21日 22:42, Michael S. Tsirkin wrote: > > On Mon, May 21, 2018 at 10:38:10AM +0800, Jason Wang wrote: > > > On 2018年05月18日 17:24, Jason Wang wrote: > > > > On 2018年05月17日 21:45, DaeRy

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-21 Thread Michael S. Tsirkin
On Tue, May 22, 2018 at 11:22:11AM +0800, Jason Wang wrote: > > > On 2018年05月22日 06:08, Michael S. Tsirkin wrote: > > On Mon, May 21, 2018 at 11:47:42AM -0400, David Miller wrote: > > > From: Jason Wang <jasow...@redhat.com> > > > Date: Fri, 18 May 2018

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-21 Thread Michael S. Tsirkin
On Tue, May 22, 2018 at 11:22:11AM +0800, Jason Wang wrote: > > > On 2018年05月22日 06:08, Michael S. Tsirkin wrote: > > On Mon, May 21, 2018 at 11:47:42AM -0400, David Miller wrote: > > > From: Jason Wang <jasow...@redhat.com> > > > Date: Fri, 18 May 2018

Re: [RFC PATCH net-next 10/12] vhost_net: build xdp buff

2018-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2018 at 09:56:11AM -0700, Jesse Brandeburg wrote: > On Mon, 21 May 2018 17:04:31 +0800 Jason wrote: > > This patch implement build XDP buffers in vhost_net. The idea is do > > userspace copy in vhost_net and build XDP buff based on the > > page. Vhost_net can then submit one or an

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2018 at 11:47:42AM -0400, David Miller wrote: > From: Jason Wang > Date: Fri, 18 May 2018 21:00:43 +0800 > > > We return -EIO on device down but can not raise EPOLLOUT after it was > > up. This may confuse user like vhost which expects tuntap to raise > >

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-21 Thread Michael S. Tsirkin
On Sat, May 19, 2018 at 09:09:11AM +0800, Jason Wang wrote: > > > On 2018年05月18日 22:46, Michael S. Tsirkin wrote: > > On Fri, May 18, 2018 at 10:11:54PM +0800, Jason Wang wrote: > > > > > > On 2018年05月18日 22:06, Michael S. Tsirkin wrote: > > > > On

Re: [PATCH net 0/4] Fix several issues of virtio-net mergeable XDP

2018-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2018 at 04:35:02PM +0800, Jason Wang wrote: > Hi: > > Please review the patches that tries to fix sevreal issues of > virtio-net mergeable XDP. > > Thanks I think we should do 3/4 differently. The rest looks good, and probably needed on stable. Thanks! > Jason Wang (4): >

Re: [PATCH net 2/4] virtio-net: correctly transmit XDP buff after linearizing

2018-05-21 Thread Michael S. Tsirkin
p the refcnt of original page and go for xmit path. > > Fixes: 72979a6c3590 ("virtio_net: xdp, add slowpath case for non contiguous > buffers") > Cc: John Fastabend <john.fastab...@gmail.com> > Signed-off-by: Jason Wang <jasow...@redhat.com> Acked-by: Michael S

Re: [PATCH net 1/4] virtio-net: correctly redirect linearized packet

2018-05-21 Thread Michael S. Tsirkin
riginal page. > > Fixes: 186b3c998c50 ("virtio-net: support XDP_REDIRECT") > Reported-by: David Ahern <dsah...@gmail.com> > Tested-by: David Ahern <dsah...@gmail.com> > Signed-off-by: Jason Wang <jasow...@redhat.com> Acked-by: Michael S. Tsirkin <m...@

Re: [PATCH net 4/4] virito-net: fix leaking page for gso packet during mergeable XDP

2018-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2018 at 04:35:06PM +0800, Jason Wang wrote: > We need to drop refcnt to xdp_page if we see a gso packet. Otherwise > it will be leaked. Fixing this by moving the check of gso packet above > the linearizing logic. > > Cc: John Fastabend > Fixes:

Re: [PATCH net 3/4] virtio-net: reset num_buf to 1 after linearizing packet

2018-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2018 at 04:35:05PM +0800, Jason Wang wrote: > If we successfully linearize the packets, num_buf were set to zero > which was wrong since we now have only 1 buffer to be used for e.g in > the error path of receive_mergeable(). Zero num_buf will lead the code > try to pop the buffers

Re: KASAN: use-after-free Read in vhost_chr_write_iter

2018-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2018 at 10:38:10AM +0800, Jason Wang wrote: > > > On 2018年05月18日 17:24, Jason Wang wrote: > > > > > > On 2018年05月17日 21:45, DaeRyong Jeong wrote: > > > We report the crash: KASAN: use-after-free Read in vhost_chr_write_iter > > > > > > This crash has been found in v4.17-rc1

Re: [RFC PATCH net-next 12/12] vhost_net: batch submitting XDP buffers to underlayer sockets

2018-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2018 at 05:04:33PM +0800, Jason Wang wrote: > This patch implements XDP batching for vhost_net with tun. This is > done by batching XDP buffs in vhost and submit them when: > > - vhost_net can not build XDP buff (mostly because of the size of packet) > - #batched exceeds the

Re: [RFC PATCH net-next 06/12] tuntap: enable premmption early

2018-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2018 at 05:04:27PM +0800, Jason Wang wrote: > Signed-off-by: Jason Wang typo in subject > --- > drivers/net/tun.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/tun.c b/drivers/net/tun.c > index 44d4f3d..24ecd82

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-18 Thread Michael S. Tsirkin
On Fri, May 18, 2018 at 10:11:54PM +0800, Jason Wang wrote: > > > On 2018年05月18日 22:06, Michael S. Tsirkin wrote: > > On Fri, May 18, 2018 at 10:00:31PM +0800, Jason Wang wrote: > > > > > > On 2018年05月18日 21:26, Jason Wang wrote: > > > > > >

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-18 Thread Michael S. Tsirkin
On Fri, May 18, 2018 at 10:00:31PM +0800, Jason Wang wrote: > > > On 2018年05月18日 21:26, Jason Wang wrote: > > > > > > On 2018年05月18日 21:13, Michael S. Tsirkin wrote: > > > On Fri, May 18, 2018 at 09:00:43PM +0800, Jason Wang wrote: > > > >

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-18 Thread Michael S. Tsirkin
On Fri, May 18, 2018 at 09:00:43PM +0800, Jason Wang wrote: > We return -EIO on device down but can not raise EPOLLOUT after it was > up. This may confuse user like vhost which expects tuntap to raise > EPOLLOUT to re-enable its TX routine after tuntap is down. This could > be easily reproduced by

Re: [PATCH net-next 2/2] pfifo_fast: drop unneeded additional lock on dequeue

2018-05-16 Thread Michael S. Tsirkin
On Wed, May 16, 2018 at 09:56:16AM +0200, Paolo Abeni wrote: > On Tue, 2018-05-15 at 23:17 +0300, Michael S. Tsirkin wrote: > > On Tue, May 15, 2018 at 04:24:37PM +0200, Paolo Abeni wrote: > > > After the previous patch, for NOLOCK qdiscs, q->seqlock is > > >

Re: [PATCH net-next 2/2] pfifo_fast: drop unneeded additional lock on dequeue

2018-05-15 Thread Michael S. Tsirkin
On Tue, May 15, 2018 at 04:24:37PM +0200, Paolo Abeni wrote: > After the previous patch, for NOLOCK qdiscs, q->seqlock is > always held when the dequeue() is invoked, we can drop > any additional locking to protect such operation. > > Signed-off-by: Paolo Abeni > --- >

Re: [PATCH net V2] tun: fix use after free for ptr_ring

2018-05-11 Thread Michael S. Tsirkin
was introduced by commit 4df0bfc79904 ("tun: fix a memory leak > for tfile->tx_array"). > > Reported-by: syzbot+e8b902c3c3fadf0a9...@syzkaller.appspotmail.com > Cc: Eric Dumazet <eric.duma...@gmail.com> > Cc: Cong Wang <xiyou.wangc...@gmail.com> > Cc: Micha

Re: [PATCH net-next v10 2/4] net: Introduce generic failover module

2018-05-11 Thread Michael S. Tsirkin
On Mon, May 07, 2018 at 03:39:19PM -0700, Randy Dunlap wrote: > Hi, > > On 05/07/2018 03:10 PM, Sridhar Samudrala wrote: > > > > Signed-off-by: Sridhar Samudrala > > --- > > MAINTAINERS|7 + > > include/linux/netdevice.h | 16 + > >

Re: [PATCH net] tun: fix use after free for ptr_ring

2018-05-11 Thread Michael S. Tsirkin
was introduced by commit 4df0bfc79904 ("tun: fix a memory leak > for tfile->tx_array"). > > Reported-by: syzbot+e8b902c3c3fadf0a9...@syzkaller.appspotmail.com > Cc: Eric Dumazet <eric.duma...@gmail.com> > Cc: Cong Wang <xiyou.wangc...@gmail.com> > Cc: Micha

Re: [PATCH net-next v10 2/4] net: Introduce generic failover module

2018-05-11 Thread Michael S. Tsirkin
On Mon, May 07, 2018 at 05:24:27PM -0700, Samudrala, Sridhar wrote: > > > On 5/7/2018 4:53 PM, Stephen Hemminger wrote: > > On Mon, 7 May 2018 15:10:44 -0700 > > Sridhar Samudrala wrote: > > > > > +static struct net_device *net_failover_get_bymac(u8 *mac, > > > +

Re: [PATCH net] vhost: Use kzalloc() to allocate vhost_msg_node

2018-05-07 Thread Michael S. Tsirkin
P_KERNEL); > + struct vhost_msg_node *node = kzalloc(sizeof *node, GFP_KERNEL); > if (!node) > return NULL; > node->vq = vq; Let's just init the msg though. OK it seems this is the best we can do for now, we need a new feature bit to fix it for 32 bit us

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-02 Thread Michael S. Tsirkin
On Thu, May 03, 2018 at 09:11:16AM +0800, Tiwei Bie wrote: > On Wed, May 02, 2018 at 06:42:57PM +0300, Michael S. Tsirkin wrote: > > On Wed, May 02, 2018 at 11:12:55PM +0800, Tiwei Bie wrote: > > > On Wed, May 02, 2018 at 04:51:01PM +0300, Michael S. Tsirkin wrote: > >

Re: [PATCH net-next v9 2/4] net: Introduce generic failover module

2018-05-02 Thread Michael S. Tsirkin
On Wed, May 02, 2018 at 10:51:12AM -0700, Samudrala, Sridhar wrote: > > > On 5/2/2018 9:15 AM, Jiri Pirko wrote: > > Sat, Apr 28, 2018 at 11:06:01AM CEST, j...@resnulli.us wrote: > > > Fri, Apr 27, 2018 at 07:06:58PM CEST, sridhar.samudr...@intel.com wrote: > > [...] > > > > > > > > + > > > >

Re: [PATCH net-next v9 3/4] virtio_net: Extend virtio to use VF datapath when available

2018-05-02 Thread Michael S. Tsirkin
On Wed, May 02, 2018 at 09:50:21AM +0200, Jiri Pirko wrote: > Wed, May 02, 2018 at 02:20:26AM CEST, sridhar.samudr...@intel.com wrote: > >On 4/30/2018 12:20 AM, Jiri Pirko wrote: > >> > >> > > Now I try to change mac of the failover master: > >> > > [root@test1 ~]# ip link set ens3 addr

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-02 Thread Michael S. Tsirkin
On Wed, May 02, 2018 at 11:12:55PM +0800, Tiwei Bie wrote: > On Wed, May 02, 2018 at 04:51:01PM +0300, Michael S. Tsirkin wrote: > > On Wed, May 02, 2018 at 03:28:19PM +0800, Tiwei Bie wrote: > > > On Wed, May 02, 2018 at 10:51:06AM +0800, Jason Wang wrote: > > > > O

[PATCH] Revert "vhost: make msg padding explicit"

2018-05-02 Thread Michael S. Tsirkin
This reverts commit 93c0d549c4c5a7382ad70de6b86610b7aae57406. Unfortunately the padding will break 32 bit userspace. Ouch. Need to add some compat code, revert for now. Signed-off-by: Michael S. Tsirkin <m...@redhat.com> --- include/uapi/linux/vhost.h | 1 - 1 file changed, 1 deletion(-)

Re: [PATCH V2 net-next 1/6] virtio: Add support for SCTP checksum offloading

2018-05-02 Thread Michael S. Tsirkin
On Wed, May 02, 2018 at 11:14:13AM -0300, Marcelo Ricardo Leitner wrote: > On Wed, May 02, 2018 at 06:16:45AM +0300, Michael S. Tsirkin wrote: > > On Tue, May 01, 2018 at 10:07:34PM -0400, Vladislav Yasevich wrote: > > > To support SCTP checksum offloading, we need to

Re: [PATCH] vhost: make msg padding explicit

2018-05-02 Thread Michael S. Tsirkin
On Wed, May 02, 2018 at 10:04:46AM -0400, David Miller wrote: > From: "Michael S. Tsirkin" <m...@redhat.com> > Date: Wed, 2 May 2018 16:36:37 +0300 > > > Ouch. True - and in particular the 32 bit ABI on 64 bit kernels doesn't > > work at all. Hmm. It's rela

Re: [PATCH V2 net-next 5/6] macvlan/macvtap: Add support for SCTP checksum offload.

2018-05-02 Thread Michael S. Tsirkin
On Wed, May 02, 2018 at 10:00:14AM -0400, Vlad Yasevich wrote: > On 05/02/2018 09:46 AM, Michael S. Tsirkin wrote: > > On Wed, May 02, 2018 at 09:27:00AM -0400, Vlad Yasevich wrote: > >> On 05/01/2018 11:24 PM, Michael S. Tsirkin wrote: > >>> On Tue, May 01, 2018

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-02 Thread Michael S. Tsirkin
On Wed, May 02, 2018 at 03:28:19PM +0800, Tiwei Bie wrote: > On Wed, May 02, 2018 at 10:51:06AM +0800, Jason Wang wrote: > > On 2018年04月25日 13:15, Tiwei Bie wrote: > > > This commit introduces the event idx support in packed > > > ring. This feature is temporarily disabled, because the > > >

Re: [PATCH V2 net-next 5/6] macvlan/macvtap: Add support for SCTP checksum offload.

2018-05-02 Thread Michael S. Tsirkin
On Wed, May 02, 2018 at 09:27:00AM -0400, Vlad Yasevich wrote: > On 05/01/2018 11:24 PM, Michael S. Tsirkin wrote: > > On Tue, May 01, 2018 at 10:07:38PM -0400, Vladislav Yasevich wrote: > >> Since we now have support for software CRC32c offload, turn it on > >> for mac

Re: [PATCH] vhost: make msg padding explicit

2018-05-02 Thread Michael S. Tsirkin
On Wed, May 02, 2018 at 02:28:09AM -0400, Kevin Easton wrote: > On Tue, May 01, 2018 at 02:05:51PM -0400, David Miller wrote: > > From: "Michael S. Tsirkin" <m...@redhat.com> > > Date: Tue, 1 May 2018 20:19:19 +0300 > > > > > On Tue, May 01

Re: [PATCH V2 net-next 5/6] macvlan/macvtap: Add support for SCTP checksum offload.

2018-05-01 Thread Michael S. Tsirkin
On Tue, May 01, 2018 at 10:07:38PM -0400, Vladislav Yasevich wrote: > Since we now have support for software CRC32c offload, turn it on > for macvlan and macvtap devices so that guests can take advantage > of offload SCTP checksums to the host or host hardware. > > Signed-off-by: Vladislav

Re: [PATCH V2 net-next 1/6] virtio: Add support for SCTP checksum offloading

2018-05-01 Thread Michael S. Tsirkin
On Tue, May 01, 2018 at 10:07:34PM -0400, Vladislav Yasevich wrote: > To support SCTP checksum offloading, we need to add a new feature > to virtio_net, so we can negotiate support between the hypervisor > and the guest. > The HOST feature bit signifies offloading support for transmit and >

Re: [PATCH] vhost: make msg padding explicit

2018-05-01 Thread Michael S. Tsirkin
On Tue, May 01, 2018 at 11:28:22AM -0400, David Miller wrote: > From: "Michael S. Tsirkin" <m...@redhat.com> > Date: Fri, 27 Apr 2018 19:02:05 +0300 > > > There's a 32 bit hole just after type. It's best to > > give it a name, this way compiler is

Re: [PATCH net] vhost: Use kzalloc() to allocate vhost_msg_node

2018-04-27 Thread Michael S. Tsirkin
On Fri, Apr 27, 2018 at 06:11:31PM +0200, Dmitry Vyukov wrote: > On Fri, Apr 27, 2018 at 6:05 PM, Michael S. Tsirkin <m...@redhat.com> wrote: > > On Fri, Apr 27, 2018 at 11:45:02AM -0400, Kevin Easton wrote: > >> The struct vhost_msg within struct vhost_msg_node is copi

Re: [PATCH net] vhost: Use kzalloc() to allocate vhost_msg_node

2018-04-27 Thread Michael S. Tsirkin
On Fri, Apr 27, 2018 at 06:11:31PM +0200, Dmitry Vyukov wrote: > On Fri, Apr 27, 2018 at 6:05 PM, Michael S. Tsirkin <m...@redhat.com> wrote: > > On Fri, Apr 27, 2018 at 11:45:02AM -0400, Kevin Easton wrote: > >> The struct vhost_msg within struct vhost_msg_node is copi

Re: [PATCH net] vhost: Use kzalloc() to allocate vhost_msg_node

2018-04-27 Thread Michael S. Tsirkin
On Fri, Apr 27, 2018 at 11:45:02AM -0400, Kevin Easton wrote: > The struct vhost_msg within struct vhost_msg_node is copied to userspace, > so it should be allocated with kzalloc() to ensure all structure padding > is zeroed. > > Signed-off-by: Kevin Easton > Reported-by:

[PATCH] vhost: make msg padding explicit

2018-04-27 Thread Michael S. Tsirkin
There's a 32 bit hole just after type. It's best to give it a name, this way compiler is forced to initialize it with rest of the structure. Reported-by: Kevin Easton <ke...@guarana.org> Signed-off-by: Michael S. Tsirkin <m...@redhat.com> --- include/uapi/linux/vhost.h | 1 + 1 fil

Re: [RFC v3 0/5] virtio: support packed ring

2018-04-26 Thread Michael S. Tsirkin
On Fri, Apr 27, 2018 at 11:56:05AM +0800, Jason Wang wrote: > > > On 2018年04月25日 13:15, Tiwei Bie wrote: > > Hello everyone, > > > > This RFC implements packed ring support in virtio driver. > > > > Some simple functional tests have been done with Jason's > > packed ring implementation in

Re: [PATCH net-next v8 4/4] netvsc: refactor notifier/event handling code to use the failover framework

2018-04-26 Thread Michael S. Tsirkin
On Thu, Apr 26, 2018 at 03:33:26PM -0700, Stephen Hemminger wrote: > On Thu, 26 Apr 2018 05:30:05 +0300 > "Michael S. Tsirkin" <m...@redhat.com> wrote: > > > On Wed, Apr 25, 2018 at 05:08:37PM -0700, Stephen Hemminger wrote: > > > On Wed, 25 Apr 201

Re: [PATCH v7 net-next 4/4] netvsc: refactor notifier/event handling code to use the failover framework

2018-04-26 Thread Michael S. Tsirkin
On Thu, Apr 26, 2018 at 03:14:46PM -0700, Siwei Liu wrote: > On Wed, Apr 25, 2018 at 7:28 PM, Michael S. Tsirkin <m...@redhat.com> wrote: > > On Wed, Apr 25, 2018 at 03:57:57PM -0700, Siwei Liu wrote: > >> On Wed, Apr 25, 2018 at 3:22 PM, Michael S. Tsirkin <m

Re: [dm-devel] [PATCH v5] fault-injection: introduce kvmalloc fallback options

2018-04-26 Thread Michael S. Tsirkin
On Thu, Apr 26, 2018 at 05:50:20PM -0400, Mikulas Patocka wrote: > How is the user or developer supposed to learn about this option, if > he gets no crash at all? Look in /sys/kernel/debug/fail* ? That actually lets you filter by module, process etc. I think this patch conflates two things: 1.

Re: [dm-devel] [PATCH v5] fault-injection: introduce kvmalloc fallback options

2018-04-26 Thread Michael S. Tsirkin
On Thu, Apr 26, 2018 at 03:36:14PM -0400, Mikulas Patocka wrote: > People on this list argue "this should be a kernel parameter". How about making it a writeable attribute, so it's easy to turn on/off after boot. Then you can keep it deterministic, userspace can play with the attribute at random

Re: [dm-devel] [PATCH v5] fault-injection: introduce kvmalloc fallback options

2018-04-26 Thread Michael S. Tsirkin
On Thu, Apr 26, 2018 at 02:54:26PM -0400, Mikulas Patocka wrote: > > > On Thu, 26 Apr 2018, Michael S. Tsirkin wrote: > > > On Thu, Apr 26, 2018 at 12:07:25PM -0400, Mikulas Patocka wrote: > > > > IIUC debug kernels mainly exist so people who experience e.g. mem

Re: [dm-devel] [PATCH v5] fault-injection: introduce kvmalloc fallback options

2018-04-26 Thread Michael S. Tsirkin
On Thu, Apr 26, 2018 at 02:58:08PM -0400, Mikulas Patocka wrote: > > > On Thu, 26 Apr 2018, Michael S. Tsirkin wrote: > > > How do you make sure QA tests a specific corner case? Add it to > > the test plan :) > > BTW. how many "lines of code" of corporat

Re: [dm-devel] [PATCH v5] fault-injection: introduce kvmalloc fallback options

2018-04-26 Thread Michael S. Tsirkin
On Thu, Apr 26, 2018 at 12:07:25PM -0400, Mikulas Patocka wrote: > > IIUC debug kernels mainly exist so people who experience e.g. memory > > corruption can try and debug the failure. In this case, CONFIG_DEBUG_SG > > will *already* catch a failure early. Nothing special needs to be done. > > The

Re: [dm-devel] [PATCH v5] fault-injection: introduce kvmalloc fallback options

2018-04-26 Thread Michael S. Tsirkin
On Thu, Apr 26, 2018 at 11:44:21AM -0400, Mikulas Patocka wrote: > > > On Thu, 26 Apr 2018, James Bottomley wrote: > > > On Thu, 2018-04-26 at 11:05 -0400, Mikulas Patocka wrote: > > > > > > On Thu, 26 Apr 2018, James Bottomley wrote: > > [...] > > > > Perhaps find out beforehand instead of

Re: [PATCH v7 net-next 4/4] netvsc: refactor notifier/event handling code to use the failover framework

2018-04-25 Thread Michael S. Tsirkin
On Wed, Apr 25, 2018 at 05:18:31PM -0700, Stephen Hemminger wrote: > On Wed, 25 Apr 2018 15:57:57 -0700 > Siwei Liu wrote: > > > > > > > I think ideally the infrastructure should suppport flexible matching of > > > NICs - netvsc is already reported to be moving to some kind

Re: [PATCH net-next v8 4/4] netvsc: refactor notifier/event handling code to use the failover framework

2018-04-25 Thread Michael S. Tsirkin
On Wed, Apr 25, 2018 at 05:08:37PM -0700, Stephen Hemminger wrote: > On Wed, 25 Apr 2018 16:59:28 -0700 > Sridhar Samudrala wrote: > > > Use the registration/notification framework supported by the generic > > failover infrastructure. > > > > Signed-off-by: Sridhar

Re: [PATCH v7 net-next 4/4] netvsc: refactor notifier/event handling code to use the failover framework

2018-04-25 Thread Michael S. Tsirkin
On Wed, Apr 25, 2018 at 03:57:57PM -0700, Siwei Liu wrote: > On Wed, Apr 25, 2018 at 3:22 PM, Michael S. Tsirkin <m...@redhat.com> wrote: > > On Wed, Apr 25, 2018 at 02:38:57PM -0700, Siwei Liu wrote: > >> On Mon, Apr 23, 2018 at 1:06 PM, Michael S. Tsirkin <m

Re: [PATCH v7 net-next 4/4] netvsc: refactor notifier/event handling code to use the failover framework

2018-04-25 Thread Michael S. Tsirkin
On Wed, Apr 25, 2018 at 02:38:57PM -0700, Siwei Liu wrote: > On Mon, Apr 23, 2018 at 1:06 PM, Michael S. Tsirkin <m...@redhat.com> wrote: > > On Mon, Apr 23, 2018 at 12:44:39PM -0700, Siwei Liu wrote: > >> On Mon, Apr 23, 2018 at 10:56 AM, Michael S. Tsirkin <m

  1   2   3   4   5   6   7   8   9   10   >