Re: [PATCH net-next] hv_netvsc: Add error handling while switching data path

2021-03-30 Thread Vitaly Kuznetsov
Haiyang Zhang writes: > Add error handling in case of failure to send switching data path message > to the host. > > Reported-by: Shachar Raindel > Signed-off-by: Haiyang Zhang > > --- > drivers/net/hyperv/hyperv_net.h | 6 +- > drivers/net/hyperv/netvsc.c | 35 +++

Re: [RFC PATCH 2/12] x86/Hyper-V: Add new hvcall guest address host visibility support

2021-03-03 Thread Vitaly Kuznetsov
Tianyu Lan writes: > From: Tianyu Lan > > Add new hvcall guest address host visibility support. Mark vmbus > ring buffer visible to host when create gpadl buffer and mark back > to not visible when tear down gpadl buffer. > > Signed-off-by: Sunil Muthuswamy > Co-Developed-by: Sunil Muthuswamy

Re: [RFC PATCH 1/12] x86/Hyper-V: Add visibility parameter for vmbus_establish_gpadl()

2021-03-03 Thread Vitaly Kuznetsov
Tianyu Lan writes: > From: Tianyu Lan > > Add visibility parameter for vmbus_establish_gpadl() and prepare > to change host visibility when create gpadl for buffer. > "No functional change" as you don't actually use the parameter. > Signed-off-by: Sunil Muthuswamy > Co-Developed-by: Sunil Mut

Re: [PATCH net-next,2/2] hv_netvsc: Add range checking for rx packet offset and length

2018-03-23 Thread Vitaly Kuznetsov
Haiyang Zhang writes: > From: Haiyang Zhang > > This patch adds range checking for rx packet offset and length. > It may only happen if there is a host side bug. > > Signed-off-by: Haiyang Zhang > --- > drivers/net/hyperv/hyperv_net.h | 1 + > drivers/net/hyperv/netvsc.c | 17

Re: [RFC 0/2] hv_netvsc shutdown redo

2018-01-27 Thread Vitaly Kuznetsov
Stephen Hemminger writes: > These patches change how teardown of Hyper-V network devices > is done. These are tested on WS2012 and WS2016. > > It moves the tx/rx shutdown into the rndis close handling, > and that makes earlier gpadl changes unnecsssary. > Thank you Stephen, I gave these a try a

Re: [RFC PATCH] virtio_net: Extend virtio to use VF datapath when available

2017-12-20 Thread Vitaly Kuznetsov
David Miller writes: > From: "Samudrala, Sridhar" > Date: Tue, 19 Dec 2017 09:41:39 -0800 > >> This is based on netvsc implementation and here is the commit that >> added this delay.  Not sure if this needs to be 100ms. >> >> commit 6123c66854c174e4982f98195100c1d990f9e5e6 >> Author: stephen he

[PATCH net v2] hv_netvsc: preserve hw_features on mtu/channels/ringparam changes

2017-11-15 Thread Vitaly Kuznetsov
life I guess but let's be consistent). Signed-off-by: Vitaly Kuznetsov --- Changes since v1: call rndis_netdev_set_hwcaps() unconditionally; clear net->hw_features flags we set and set them again based on host's data. Clear missing features from net->features. Unfo

Re: [PATCH net] hv_netvsc: preserve hw_features on mtu/channels/ringparam changes

2017-11-15 Thread Vitaly Kuznetsov
Haiyang Zhang writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Tuesday, November 14, 2017 11:58 AM >> To: Stephen Hemminger >> Cc: netdev@vger.kernel.org; linux-ker...@vger.kernel.org; >> de...@linuxdriver

Re: [PATCH net] hv_netvsc: preserve hw_features on mtu/channels/ringparam changes

2017-11-14 Thread Vitaly Kuznetsov
Stephen Hemminger writes: > On Tue, 14 Nov 2017 16:22:05 +0100 > Vitaly Kuznetsov wrote: > > Yes, this looks like a real issue. > >> +/* Query hardware capabilities if we're called from netvsc_probe() */ >> +if (!net->hw_features) { >> +

[PATCH net] hv_netvsc: preserve hw_features on mtu/channels/ringparam changes

2017-11-14 Thread Vitaly Kuznetsov
additional flags which are set outside of the driver, e.g. register_netdevice() adds NETIF_F_SOFT_FEATURES and many others. Fill hw_features in only when we're called from netvsc_probe() and hw_features is empty. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/rndis_filter.c

Re: [RFC] hv_netvsc: safer orderly shutdown

2017-11-13 Thread Vitaly Kuznetsov
Stephen Hemminger writes: > > The NAPI disable is already handled by rndis close. Sorry, but I'm probably missing something: I can only see netif_napi_del() call in netvsc_device_remove() but this happens much later. And I don see us doing napi_disable() anywhere on the path. But I'm probably mi

Re: [RFC] hv_netvsc: safer orderly shutdown

2017-11-10 Thread Vitaly Kuznetsov
Stephen Hemminger writes: > Several types of control operations require that the underlying RNDIS > infrastructure be restarted. This patch changes the ordering of the > shutdown to avoid race conditions. > Stop all transmits before doing RNDIS halt. This involves stopping the > network device tr

Re: [PATCH net-next v2 2/2] hv_netvsc: hide warnings about uninitialized/missing rndis device

2017-11-08 Thread Vitaly Kuznetsov
Stephen Hemminger writes: > On Nov 2, 2017 19:35, "Vitaly Kuznetsov" wrote: > > Hyper-V hosts are known to send RNDIS messages even after we halt the > device in rndis_filter_halt_device(). Remove user visible messages > as they are not really useful. > >

[PATCH net-next v2 0/2] hv_netvsc: fix a hang on channel/mtu changes

2017-11-02 Thread Vitaly Kuznetsov
d messages. Changes since v1: - Throw away patches 2 and 3 of the original series as one is unneeded and the other is not justified [Eric Dumazet, Stephen Hemminger] so I'm only fixing the hang now, the crash doesn't reproduce. Will keep an eye on it. Vitaly Kuznetsov (2): hv_netvsc: n

[PATCH net-next v2 2/2] hv_netvsc: hide warnings about uninitialized/missing rndis device

2017-11-02 Thread Vitaly Kuznetsov
Hyper-V hosts are known to send RNDIS messages even after we halt the device in rndis_filter_halt_device(). Remove user visible messages as they are not really useful. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/rndis_filter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH net-next v2 1/2] hv_netvsc: netvsc_teardown_gpadl() split

2017-11-02 Thread Vitaly Kuznetsov
reliably. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/netvsc.c | 69 +++-- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 5bb6a20072dd..bfc79698b8f4 100644 --- a/drivers

Re: [PATCH net-next 2/4] hv_netvsc: protect nvdev->extension with RCU

2017-11-02 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > > Ok, I may have missed something. I'll try reproducing the crash and > finding a better fine-grained solution. > It's been two days and I'm failing to reproduce the crash in rndis_filter_receive() in my environment so I'll probably

Re: [PATCH net-next 2/4] hv_netvsc: protect nvdev->extension with RCU

2017-10-31 Thread Vitaly Kuznetsov
Stephen Hemminger writes: > On Tue, 31 Oct 2017 14:42:02 +0100 > Vitaly Kuznetsov wrote: > >> @@ -2002,7 +2002,9 @@ static int netvsc_probe(struct hv_device *dev, >> device_info.recv_sections = NETVSC_DEFAULT_RX; >> device_info.recv_section_size

Re: [PATCH net-next 3/4] hv_netvsc: reset net_device_ctx->nvdev with rcu_assign_pointer()

2017-10-31 Thread Vitaly Kuznetsov
David Miller writes: > From: Vitaly Kuznetsov > Date: Tue, 31 Oct 2017 15:40:06 +0100 > >> Eric Dumazet writes: >> >>> On Tue, 2017-10-31 at 14:42 +0100, Vitaly Kuznetsov wrote: >>>> RCU_INIT_POINTER() is not suitable here as it doesn't give

Re: [PATCH net-next 3/4] hv_netvsc: reset net_device_ctx->nvdev with rcu_assign_pointer()

2017-10-31 Thread Vitaly Kuznetsov
Eric Dumazet writes: > On Tue, 2017-10-31 at 14:42 +0100, Vitaly Kuznetsov wrote: >> RCU_INIT_POINTER() is not suitable here as it doesn't give us ordering >> guarantees (see the comment in rcupdate.h). This is also not a hotpath. >> >> Signed-off-by: Vitaly K

[PATCH net-next 1/4] hv_netvsc: netvsc_teardown_gpadl() split

2017-10-31 Thread Vitaly Kuznetsov
reliably. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/netvsc.c | 69 +++-- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 5bb6a20072dd..bfc79698b8f4 100644 --- a/drivers

[PATCH net-next 3/4] hv_netvsc: reset net_device_ctx->nvdev with rcu_assign_pointer()

2017-10-31 Thread Vitaly Kuznetsov
RCU_INIT_POINTER() is not suitable here as it doesn't give us ordering guarantees (see the comment in rcupdate.h). This is also not a hotpath. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/netvsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/h

[PATCH net-next 2/4] hv_netvsc: protect nvdev->extension with RCU

2017-10-31 Thread Vitaly Kuznetsov
rndis_filter_receive() is called from interrupt context and may race with rndis_filter_device_remove() resetting extension pointer. RNDIS_MSG_HALT does not help, host may still send us messages after it. Protect extension pointer with RCU. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv

[PATCH net-next 4/4] hv_netvsc: hide warnings about uninitialized/missing rndis device

2017-10-31 Thread Vitaly Kuznetsov
Hyper-V hosts are known to send RNDIS messages even after we halt the device in rndis_filter_halt_device(). Remove user visible messages as they are not really useful. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/rndis_filter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH net-next 0/4] hv_netvsc: fix some crashes and hangs on channel/mtu changes

2017-10-31 Thread Vitaly Kuznetsov
ixing everything VMs seem to survive overnight test. I'll send one more related patch to VMBus core too. Vitaly Kuznetsov (4): hv_netvsc: netvsc_teardown_gpadl() split hv_netvsc: protect nvdev->extension with RCU hv_netvsc: reset net_device_ctx->nvdev with rcu_assign_pointer()

[PATCH net-next] hinic: don't build the module by default

2017-08-28 Thread Vitaly Kuznetsov
We probably don't want to enable code supporting particular hardware by default e.g. when someone does 'make defconfig'. Other ethernet modules don't do it. Signed-off-by: Vitaly Kuznetsov --- drivers/net/ethernet/huawei/hinic/Kconfig | 1 - 1 file changed, 1 deletion(-)

Re: [PATCH RFC net-next] net: Allow name change of IFF_UP interfaces

2017-08-11 Thread Vitaly Kuznetsov
Stephen Hemminger writes: > On Thu, 10 Aug 2017 10:55:01 -0600 > David Ahern wrote: > >> On 8/10/17 10:48 AM, David Miller wrote: >> > From: Andrew Lunn >> > Date: Thu, 10 Aug 2017 18:27:22 +0200 >> > >> >> On Thu, Aug 10, 2017 at 05:

Re: [PATCH RFC net-next] net: Allow name change of IFF_UP interfaces

2017-08-10 Thread Vitaly Kuznetsov
Andrew Lunn writes: > On Thu, Aug 10, 2017 at 05:24:55PM +0200, Vitaly Kuznetsov wrote: >> Andrew Lunn writes: >> >> >> We are - rtnetlink_event() does the job. We, however, don't have a >> >> special IFLA_EVENT_* for name change and end up with IFLA

Re: [PATCH RFC net-next] net: Allow name change of IFF_UP interfaces

2017-08-10 Thread Vitaly Kuznetsov
Andrew Lunn writes: >> We are - rtnetlink_event() does the job. We, however, don't have a >> special IFLA_EVENT_* for name change and end up with IFLA_EVENT_NONE. > > What is in this event? Old and new name? Just the new name? Basically, it's everything we know about the interface - type, index,

Re: [PATCH RFC net-next] net: Allow name change of IFF_UP interfaces

2017-08-10 Thread Vitaly Kuznetsov
Eric Dumazet writes: > On Thu, 2017-08-10 at 10:41 +0200, Vitaly Kuznetsov wrote: >> Andrew Lunn writes: >> >> >> I understand the 'legacy' concern but at the same time we don't want to >> >> have aftificial limitations too. Name chang

Re: [PATCH RFC net-next] net: Allow name change of IFF_UP interfaces

2017-08-10 Thread Vitaly Kuznetsov
Andrew Lunn writes: >> I understand the 'legacy' concern but at the same time we don't want to >> have aftificial limitations too. Name change, in particular, doesn't >> happen 'under the hood' -- someone privileged enough needs to request >> the change. >> >> Can you think of any particular rea

Re: [PATCH RFC net-next] net: Allow name change of IFF_UP interfaces

2017-08-09 Thread Vitaly Kuznetsov
吉藤英明 writes: > 2017-08-09 19:42 GMT+09:00 Vitaly Kuznetsov : >> What happens is: __netvsc_vf_setup() does dev_open() for the VF device and >> the consecutive dev_change_name() fails with -EBUSY because of the >> (dev->flags & IFF_UP) check. The history of this code

[PATCH RFC net-next] net: Allow name change of IFF_UP interfaces

2017-08-09 Thread Vitaly Kuznetsov
with -EBUSY because of the (dev->flags & IFF_UP) check. The history of this code predates git so I wasn't able to figure out when and why the check was added, everything seems to work fine without it. dev_change_name() has only two call sites, both hold rtnl_lock. Signed-off-by: Vitaly K

Re: [PATCH net-next 0/1] netvsc: another VF datapath fix

2017-08-09 Thread Vitaly Kuznetsov
Stephen Hemminger writes: > The following would allow udev a chance at the device. > This would of course work but the approach is a bit hackish and can still fail on a loaded system. Raising the pause interval would be an option, but again, probably not the best one. Let me try to send an RFC

Re: [PATCH net-next 0/1] netvsc: another VF datapath fix

2017-08-08 Thread Vitaly Kuznetsov
Stephen Hemminger writes: > On Tue, 08 Aug 2017 17:24:03 +0200 > Vitaly Kuznetsov wrote: > >> Stephen Hemminger writes: >> >> > On Tue, 08 Aug 2017 16:03:56 +0200 >> > Vitaly Kuznetsov wrote: >> > >> >> Stephen Hem

Re: [PATCH net-next 0/1] netvsc: another VF datapath fix

2017-08-08 Thread Vitaly Kuznetsov
Stephen Hemminger writes: > On Tue, 08 Aug 2017 16:03:56 +0200 > Vitaly Kuznetsov wrote: > >> Stephen Hemminger writes: >> >> > Previous fix was incomplete. >> > >> >> Not really related to this patch series (which btw fixes my issue, &

Re: [PATCH net-next 0/1] netvsc: another VF datapath fix

2017-08-08 Thread Vitaly Kuznetsov
Stephen Hemminger writes: > Previous fix was incomplete. > Not really related to this patch series (which btw fixes my issue, thanks!), but I found one addition issue. Systemd fails to rename VF interface: kernel: mlx4_core 0002:00:02.0 eth2: joined to eth1 kernel: hv_netvsc 33b7a6f9-6736-451

Re: [PATCH net-next 1/1] netvsc: fix rtnl deadlock on unregister of vf

2017-08-07 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > Vitaly Kuznetsov writes: > >> Stephen Hemminger writes: >> >>> With new transparent VF support, it is possible to get a deadlock >>> when some of the deferred work is running and the unregister_vf >>> is trying to ca

Re: [PATCH net-next 1/1] netvsc: fix rtnl deadlock on unregister of vf

2017-08-07 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > Stephen Hemminger writes: > >> With new transparent VF support, it is possible to get a deadlock >> when some of the deferred work is running and the unregister_vf >> is trying to cancel the work element. The solution is to use >> tryl

Re: [PATCH net-next 1/1] netvsc: fix rtnl deadlock on unregister of vf

2017-08-07 Thread Vitaly Kuznetsov
team device). > > Reported-by: Vitaly Kuznetsov > Fixes: 0c195567a8f6 ("netvsc: transparent VF management") > Signed-off-by: Stephen Hemminger > --- > drivers/net/hyperv/netvsc_drv.c | 12 ++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > > diff --gi

[PATCH v2] xen-netfront: avoid crashing on resume after a failure in talk_to_netback()

2017-05-11 Thread Vitaly Kuznetsov
after resume. Fix the bug by removing the whole xen device completely with device_unregister(), this guarantees we won't have any calls into netfront after a failure. Signed-off-by: Vitaly Kuznetsov --- Changes since v1: instead of cleaning drvdata and checking for it in netfront_re

Re: [PATCH] xen-netfront: avoid crashing on resume after a failure in talk_to_netback()

2017-05-05 Thread Vitaly Kuznetsov
David Miller writes: > From: Vitaly Kuznetsov > Date: Thu, 4 May 2017 14:23:04 +0200 > >> Unavoidable crashes in netfront_resume() and netback_changed() after a >> previous fail in talk_to_netback() (e.g. when we fail to read MAC from >> xenstore) were disc

[PATCH] xen-netfront: avoid crashing on resume after a failure in talk_to_netback()

2017-05-04 Thread Vitaly Kuznetsov
again after resume. Reset drvdata in netback_changed() the same way we reset it in netfront_probe() and check for NULL in both netfront_resume() and netback_changed() to properly handle the situation. Signed-off-by: Vitaly Kuznetsov --- I apologize for sending this during the merge window, I'

Re: [PATCH net-next] net/hyperv: remove use of VLAN_TAG_PRESENT

2017-01-04 Thread Vitaly Kuznetsov
Michał Mirosław writes: > Signed-off-by: Michał Mirosław Can we have a non-empty description please? > --- > drivers/net/hyperv/hyperv_net.h | 2 +- > drivers/net/hyperv/netvsc_drv.c | 13 ++--- > drivers/net/hyperv/rndis_filter.c | 4 ++-- > 3 files changed, 9 insertions(+), 10

[PATCH net-next] hv_netvsc: remove excessive logging on MTU change

2016-11-28 Thread Vitaly Kuznetsov
00:15:5d:1e:91:12 link state up This information is useful as debug at most. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/netvsc.c | 8 drivers/net/hyperv/rndis_filter.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/hyperv/netvsc.c

Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf()

2016-10-21 Thread Vitaly Kuznetsov
David Miller writes: > From: Vitaly Kuznetsov > Date: Fri, 21 Oct 2016 13:15:53 +0200 > >> David Miller writes: >> >>> From: Vitaly Kuznetsov >>> Date: Thu, 20 Oct 2016 10:51:04 +0200 >>> >>>> Stephen Hemminger writes: >>

Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf()

2016-10-21 Thread Vitaly Kuznetsov
David Miller writes: > From: Vitaly Kuznetsov > Date: Thu, 20 Oct 2016 10:51:04 +0200 > >> Stephen Hemminger writes: >> >>> Do we need ACCESS_ONCE() here to avoid check/use issues? >>> >> >> I think we don't: this is the only place in

Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf()

2016-10-20 Thread Vitaly Kuznetsov
e locking, if we read stale NULL value after it was already updated on a different CPU we're fine, we'll just return -EAGAIN. > -Original Message- > From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] > Sent: Wednesday, October 19, 2016 2:53 PM > To: netdev@v

[PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf()

2016-10-19 Thread Vitaly Kuznetsov
c_send(). Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/netvsc.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 720b5fa..e2bfaac 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c

[PATCH net-next v3] xen-netfront: avoid packet loss when ethernet header crosses page boundary

2016-09-19 Thread Vitaly Kuznetsov
erable short-term and shouldn't bring significant performance degradation as such packets are rare. That's what this patch is trying to achieve with skb_copy(). Signed-off-by: Vitaly Kuznetsov Acked-by: David Vrabel --- - Changes since 'v2': Move 'len' calculat

Re: [PATCH net-next RESEND] xen-netfront: avoid packet loss when ethernet header crosses page boundary

2016-09-19 Thread Vitaly Kuznetsov
David Vrabel writes: > On 19/09/16 11:22, Vitaly Kuznetsov wrote: >> David Miller writes: >> >>> From: Vitaly Kuznetsov >>> Date: Fri, 16 Sep 2016 12:59:14 +0200 >>> >>>> @@ -595,6 +596,19 @@ static int xennet_start_xmit(struct sk_b

[PATCH net-next v2] xen-netfront: avoid packet loss when ethernet header crosses page boundary

2016-09-19 Thread Vitaly Kuznetsov
erable short-term and shouldn't bring significant performance degradation as such packets are rare. That's what this patch is trying to achieve with skb_copy(). Signed-off-by: Vitaly Kuznetsov Acked-by: David Vrabel --- - Changes since 'v1': Recalculate 'len' a

Re: [PATCH net-next RESEND] xen-netfront: avoid packet loss when ethernet header crosses page boundary

2016-09-19 Thread Vitaly Kuznetsov
David Miller writes: > From: Vitaly Kuznetsov > Date: Fri, 16 Sep 2016 12:59:14 +0200 > >> @@ -595,6 +596,19 @@ static int xennet_start_xmit(struct sk_buff *skb, >> struct net_device *dev) >> offset = offset_in_page(skb->data); >> len = skb_headlen

[PATCH net-next RESEND] xen-netfront: avoid packet loss when ethernet header crosses page boundary

2016-09-16 Thread Vitaly Kuznetsov
erable short-term and shouldn't bring significant performance degradation as such packets are rare. That's what this patch is trying to achieve with skb_copy(). Signed-off-by: Vitaly Kuznetsov Acked-by: David Vrabel --- - This is just a RESEND with David's ACK added. ---

Re: [PATCH net-next] xen-netfront: avoid packet loss when ethernet header crosses page boundary

2016-09-12 Thread Vitaly Kuznetsov
David Vrabel writes: > On 22/08/16 16:42, Vitaly Kuznetsov wrote: >> Small packet loss is reported on complex multi host network configurations >> including tunnels, NAT, ... My investigation led me to the following check >> in netback which drops packets: >> >>

Re: [Xen-devel] [PATCH net-next] xen-netfront: avoid packet loss when ethernet header crosses page boundary

2016-09-09 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > Vitaly Kuznetsov writes: > >> David Vrabel writes: >> >>> On 22/08/16 16:42, Vitaly Kuznetsov wrote: >>>> >>>> I see two ways to fix the issue: >>>> - Change the 'wire' protocol between netfr

Re: [Xen-devel] [PATCH net-next] xen-netfront: avoid packet loss when ethernet header crosses page boundary

2016-08-29 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > David Vrabel writes: > >> On 22/08/16 16:42, Vitaly Kuznetsov wrote: >>> >>> I see two ways to fix the issue: >>> - Change the 'wire' protocol between netfront and netback to start keeping >>> the original S

Re: [Xen-devel] [PATCH net-next] xen-netfront: avoid packet loss when ethernet header crosses page boundary

2016-08-23 Thread Vitaly Kuznetsov
David Vrabel writes: > On 22/08/16 16:42, Vitaly Kuznetsov wrote: >> >> I see two ways to fix the issue: >> - Change the 'wire' protocol between netfront and netback to start keeping >> the original SKB structure. We'll have to add a flag indicating

[PATCH net-next] xen-netfront: avoid packet loss when ethernet header crosses page boundary

2016-08-22 Thread Vitaly Kuznetsov
erable short-term and shouldn't bring significant performance degradation as such packets are rare. That's what this patch is trying to achieve with skb_copy(). Signed-off-by: Vitaly Kuznetsov --- drivers/net/xen-netfront.c | 14 ++ 1 file changed, 14 insertions(+) d

[PATCH net v2 1/5] hv_netvsc: don't lose VF information

2016-08-15 Thread Vitaly Kuznetsov
struct netvsc_device is not suitable for storing VF information as this structure is being destroyed on MTU change / set channel operation (see rndis_filter_device_remove()). Move all VF related stuff to struct net_device_context which is persistent. Signed-off-by: Vitaly Kuznetsov Acked-by

[PATCH net v2 4/5] hv_netvsc: protect module refcount by checking net_device_ctx->vf_netdev

2016-08-15 Thread Vitaly Kuznetsov
We're not guaranteed to see NETDEV_REGISTER/NETDEV_UNREGISTER notifications only once per VF but we increase/decrease module refcount unconditionally. Check vf_netdev to make sure we don't take/release it twice. We presume that only one VF per netvsc device may exist. Signed-off-

[PATCH net v2 0/5] hv_netvsc: fixes for VF removal path

2016-08-15 Thread Vitaly Kuznetsov
ght thing to do long-term, we can either put this on top of this series or do it later in net-next. Vitaly Kuznetsov (5): hv_netvsc: don't lose VF information hv_netvsc: avoid deadlocks between rtnl lock and vf_use_cnt wait hv_netvsc: reset vf_inject on VF removal hv_netvsc: protec

[PATCH net v2 3/5] hv_netvsc: reset vf_inject on VF removal

2016-08-15 Thread Vitaly Kuznetsov
We reset vf_inject on VF going down (netvsc_vf_down()) but we don't on VF removal (netvsc_unregister_vf()) so vf_inject stays 'true' while vf_netdev is already NULL and we're trying to inject packets into NULL net device in netvsc_recv_callback() causing kernel to crash. S

[PATCH net v2 2/5] hv_netvsc: avoid deadlocks between rtnl lock and vf_use_cnt wait

2016-08-15 Thread Vitaly Kuznetsov
nd call NETDEV_NOTIFY_PEERS directly. As we're acting under rtnl lock this is legitimate. Signed-off-by: Vitaly Kuznetsov Acked-by: Haiyang Zhang --- Changes since v1: - Move the patch ahead in the series to avoid introducing new blocking issues and solving them later in the series. [

[PATCH net v2 5/5] hv_netvsc: fix bonding devices check in netvsc_netdev_event()

2016-08-15 Thread Vitaly Kuznetsov
: Vitaly Kuznetsov --- drivers/net/hyperv/netvsc_drv.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 62a4e6e..3ba29fc 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv

Re: [RFC 2/2] netvsc: use RCU for VF net device reference

2016-08-15 Thread Vitaly Kuznetsov
Stephen Hemminger writes: > Rather than keeping a pointer, a flag, and reference count, use RCU and > existing > device reference count to protect the synthetic to VF relationship. Thanks! I like the idea. Some nitpicks below ... > > One other change is that injected packets must be accounted

Re: [PATCH net 2/4] hv_netvsc: reset vf_inject on VF removal

2016-08-11 Thread Vitaly Kuznetsov
Yuval Mintz writes: >> +static void netvsc_inject_enable(struct net_device_context >> +*net_device_ctx) { >> +net_device_ctx->vf_inject = true; >> +} >> + >> +static void netvsc_inject_disable(struct net_device_context >> +*net_device_ctx) { >> +net_device_ctx->vf_inject = false; >> + >>

[PATCH net 4/4] hv_netvsc: avoid deadlocks between rtnl lock and netvsc_inject_disable()

2016-08-11 Thread Vitaly Kuznetsov
zero. Instead of introducing additional synchronization I suggest we drop gwrk.dwrk completely and call NETDEV_NOTIFY_PEERS directly. As we're acting under rtnl lock this is legitimate. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/hyperv_net.h | 7 --- drivers/net/h

[PATCH net 3/4] hv_netvsc: protect module refcount by checking net_device_ctx->vf_netdev

2016-08-11 Thread Vitaly Kuznetsov
We're not guaranteed to see NETDEV_REGISTER/NETDEV_UNREGISTER notifications only once per VF but we increase/decrease module refcount unconditionally. Check vf_netdev to make sure we don't take/release it twice. We presume that only one VF per netvsc device may exist. Signed-off-

[PATCH net 0/4] hv_netvsc: fixes for VF removal path

2016-08-11 Thread Vitaly Kuznetsov
Kernel crash is reported after VF is removed and detached from netvsc device. My investigation led me to PATCH2 of this series but PATCH1 is required to support the change. I also noticed a couple of other issues while debugging and I fix them with PATCH3 and PATCH4. Please review. Vitaly

[PATCH net 2/4] hv_netvsc: reset vf_inject on VF removal

2016-08-11 Thread Vitaly Kuznetsov
We reset vf_inject on VF going down (netvsc_vf_down()) but we don't on VF removal (netvsc_unregister_vf()) so vf_inject stays 'true' while vf_netdev is already NULL and we're trying to inject packets into NULL net device in netvsc_recv_callback() causing kernel to crash. S

[PATCH net 1/4] hv_netvsc: don't lose VF information

2016-08-11 Thread Vitaly Kuznetsov
struct netvsc_device is not suitable for storing VF information as this structure is being destroyed on MTU change / set channel operation (see rndis_filter_device_remove()). Move all VF related stuff to struct net_device_context which is persistent. Signed-off-by: Vitaly Kuznetsov --- drivers

Re: [PATCH v15 net-next 1/1] hv_sock: introduce Hyper-V Sockets

2016-07-08 Thread Vitaly Kuznetsov
tps://msdn.microsoft.com/en-us/virtualization/hyperv_on_windows/develop/make_mgmt_service > > The patch implements the necessary support in the guest side by introducing > a new socket address family AF_HYPERV. > > Signed-off-by: Dexuan Cui > Cc: "K. Y. Srinivasan" > Cc: Haiya

[PATCH net-next v3] netvsc: get rid of completion timeouts

2016-06-09 Thread Vitaly Kuznetsov
nd if the host screws things up there is no easy way to recover anyway. Signed-off-by: Vitaly Kuznetsov Acked-by: Haiyang Zhang --- Changes since v2: - Rebase to current net-next [David Miller] Changes since v1 RFC: - Non-RFC - Restore (net_dev->num_sc_offered > 0) condition in rndis_fi

Re: [PATCH net-next v2] netvsc: get rid of completion timeouts

2016-06-09 Thread Vitaly Kuznetsov
David Miller writes: > From: Vitaly Kuznetsov > Date: Wed, 8 Jun 2016 19:17:41 +0200 > >> I'm hitting 5 second timeout in rndis_filter_set_rss_param() while setting >> RSS parameters for the device. When this happens we end up returning >>

[PATCH net-next v2] netvsc: get rid of completion timeouts

2016-06-08 Thread Vitaly Kuznetsov
nd if the host screws things up there is no easy way to recover anyway. Signed-off-by: Vitaly Kuznetsov Acked-by: Haiyang Zhang --- Changes since v1 RFC: - Non-RFC - Restore (net_dev->num_sc_offered > 0) condition in rndis_filter_device_remove() as without it we may hang when there are no

Re: [PATCH RFC net-next] netvsc: get rid of completion timeouts

2016-06-08 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > I'm hitting 5 second timeout in rndis_filter_set_rss_param() while setting > RSS parameters for the device. When this happens we end up returning > -ETIMEDOUT from the function and rndis_filter_device_add() falls back to > setting > >

[PATCH RFC net-next] netvsc: get rid of completion timeouts

2016-06-08 Thread Vitaly Kuznetsov
nd if the host screws things up there is no easy way to recover anyway. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/netvsc.c | 14 + drivers/net/hyperv/rndis_filter.c | 115 +- 2 files changed, 30 insertions(+), 99 deletions(-) diff --git

[PATCH net-next v2 4/5] hv_netvsc: pass struct net_device to rndis_filter_set_device_mac()

2016-06-03 Thread Vitaly Kuznetsov
We unpack 'struct net_device' in netvsc_set_mac_addr() to get to 'struct hv_device' pointer which we use in rndis_filter_set_device_mac() to get back to 'struct net_device'. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/hyperv_net.h | 2 +- drivers

[PATCH net-next v2 3/5] hv_netvsc: pass struct netvsc_device to rndis_filter_{open,close}()

2016-06-03 Thread Vitaly Kuznetsov
Both rndis_filter_open()/rndis_filter_close() use struct hv_device to reach to struct netvsc_device only and all callers have it already. While on it, rename net_device to nvdev in rndis_filter_open() as net_device is misleading. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv

[PATCH net-next v2 1/5] hv_netvsc: remove redundant assignment in netvsc_recv_callback()

2016-06-03 Thread Vitaly Kuznetsov
net_device_ctx is assigned in the very beginning of the function and 'net' pointer doesn't change. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/netvsc_drv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/net

[PATCH net-next v2 0/5] hv_netvsc: cleanup after untangling the pointer mess

2016-06-03 Thread Vitaly Kuznetsov
need while their callers already have the required information. This is just a cleanup series with no functional changes intended. It doesn't pretend to be complete, additional cleanup of other functions may follow. Vitaly Kuznetsov (5): hv_netvsc: remove redundant assignment in netvsc_rec

[PATCH net-next v2 2/5] hv_netvsc: introduce {net,hv}_device_to_netvsc_device() helpers

2016-06-03 Thread Vitaly Kuznetsov
Make it easier to get 'struct netvsc_device' from 'struct net_device' and 'struct hv_device' by introducing inline helpers. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/hyperv_net.h | 12 drivers/net/hyperv/netvsc.c | 11 +

[PATCH net-next v2 5/5] hv_netvsc: pass struct net_device to rndis_filter_set_offload_params()

2016-06-03 Thread Vitaly Kuznetsov
The only caller rndis_filter_device_add() has 'struct net_device' pointer already. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/rndis_filter.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/

[PATCH net] bnx2x: avoid leaking memory on bnx2x_init_one() failures

2016-05-30 Thread Vitaly Kuznetsov
ff-by: Vitaly Kuznetsov --- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index 0a5b770..c5fe9158 100644

[PATCH net-next 0/5] hv_netvsc: cleanup after untangling the pointer mess

2016-05-23 Thread Vitaly Kuznetsov
with no functional changes intended. It doesn't pretend to be complete, additional cleanup of other functions may follow. Vitaly Kuznetsov (5): hv_netvsc: remove redundant assignment in netvsc_recv_callback() hv_netvsc: introduce {net,hv}_device_to_netvsc_device() helpers hv_netvsc: p

[PATCH net-next 2/5] hv_netvsc: introduce {net,hv}_device_to_netvsc_device() helpers

2016-05-23 Thread Vitaly Kuznetsov
Make it easier to get 'struct netvsc_device' from 'struct net_device' and 'struct hv_device' by introducing inline helpers. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/hyperv_net.h | 12 drivers/net/hyperv/netvsc.c | 11 +

[PATCH net-next 1/5] hv_netvsc: remove redundant assignment in netvsc_recv_callback()

2016-05-23 Thread Vitaly Kuznetsov
net_device_ctx is assigned in the very beginning of the function and 'net' pointer doesn't change. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/netvsc_drv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/net

[PATCH net-next 3/5] hv_netvsc: pass struct netvsc_device to rndis_filter_{open,close}()

2016-05-23 Thread Vitaly Kuznetsov
Both rndis_filter_open()/rndis_filter_close() use struct hv_device to reach to struct netvsc_device only and all callers have it already. While on it, rename net_device to nvdev in rndis_filter_open() as net_device is misleading. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv

[PATCH net-next 5/5] hv_netvsc: pass struct net_device to rndis_filter_set_offload_params()

2016-05-23 Thread Vitaly Kuznetsov
The only caller rndis_filter_device_add() has 'struct net_device' pointer already. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/rndis_filter.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/

[PATCH net-next 4/5] hv_netvsc: pass struct net_device to rndis_filter_set_device_mac()

2016-05-23 Thread Vitaly Kuznetsov
We unpack 'struct net_device' in netvsc_set_mac_addr() to get to 'struct hv_device' pointer which we use in rndis_filter_set_device_mac() to get back to 'struct net_device'. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/hyperv_net.h | 2 +- drivers

[PATCH net-next v2 0/6] hv_netvsc: avoid races on mtu change/set channels

2016-05-13 Thread Vitaly Kuznetsov
() 2) netvsc_remove() 3) netvsc_send() To solve these issues without introducing new locks some refactoring is required. We need to get rid of very complex link graph in all the internal structures and avoid traveling through structures which are being removed. Vitaly Kuznetsov (6): hv_netvsc

[PATCH net-next v2 2/6] hv_netvsc: use start_remove flag to protect netvsc_link_change()

2016-05-13 Thread Vitaly Kuznetsov
start_remove value in netvsc_link_change(). Reported-by: Haiyang Zhang Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/netvsc_drv.c | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c

[PATCH net-next v2 3/6] hv_netvsc: untangle the pointer mess

2016-05-13 Thread Vitaly Kuznetsov
he 'netvsc_device -> rndis_device' branch and re-creating it making the synchronization easier. There is one additional redundant pointer left, it is struct net_device link in struct netvsc_device, it is going to be removed in a separate commit. Signed-off-by: Vitaly Kuznetsov --- d

[PATCH net-next v2 1/6] hv_netvsc: move start_remove flag to net_device_context

2016-05-13 Thread Vitaly Kuznetsov
struct netvsc_device is destroyed on mtu change so keeping the protection flag there is not a good idea. Move it to struct net_device_context which is preserved. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/hyperv_net.h | 4 +++- drivers/net/hyperv/netvsc.c | 3 +-- drivers/net

[PATCH net-next v2 5/6] hv_netvsc: synchronize netvsc_change_mtu()/netvsc_set_channels() with netvsc_remove()

2016-05-13 Thread Vitaly Kuznetsov
When netvsc device is removed during mtu change or channels setup we get into troubles as both paths are trying to remove the device. Synchronize them with start_remove flag and rtnl lock. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/netvsc_drv.c | 9 +++-- 1 file changed, 7

[PATCH net-next v2 4/6] hv_netvsc: get rid of struct net_device pointer in struct netvsc_device

2016-05-13 Thread Vitaly Kuznetsov
Simplify netvsvc pointer graph by getting rid of the redundant ndev pointer. We can always get a pointer to struct net_device from somewhere else. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/hyperv_net.h | 5 +-- drivers/net/hyperv/netvsc.c | 36 +++- drivers/net

[PATCH net-next v2 6/6] hv_netvsc: set nvdev link after populating chn_table

2016-05-13 Thread Vitaly Kuznetsov
() before we populate chn_table. - we populate chn_table[0] only. The issue could be papered over by checking channel != NULL in netvsc_send() but populating the whole chn_table and writing the nvdev pointer afterwards seems more appropriate. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv

Re: Aw: [PATCH 0/6] hv_netvsc: avoid races on mtu change/set channels

2016-05-12 Thread Vitaly Kuznetsov
"Lino Sanfilippo" writes: > Hi, > >> >> MTU change and set channels operations are implemented as netvsc device >> re-creation destroying internal structures (struct net_device stays). This >> is really unfortunate but there is no support from Hyper-V host to do it >> in a different way. Such re-

[PATCH 0/6] hv_netvsc: avoid races on mtu change/set channels

2016-05-12 Thread Vitaly Kuznetsov
new locks some refactoring is required. We need to get rid of very complex link graph in all the internal structures and avoid traveling through structures which are being removed. Vitaly Kuznetsov (6): hv_netvsc: move start_remove flag to net_device_context hv_netvsc: use start_remove flag to

  1   2   >