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 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: [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: [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

[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: [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

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. > >

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: [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

[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: [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) { >> +

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

[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: [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: [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

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
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 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 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: > 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-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

[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 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

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-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: >> 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
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-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:

[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

[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 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 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 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 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

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

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 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 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

[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

[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 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

Re: [PATCH net-next, 1/1] hv_netvsc: call dump_rndis_message() only in netvsc debug mode

2015-04-22 Thread Vitaly Kuznetsov
six...@microsoft.com writes: > From: Simon Xiao > > Signed-off-by: Simon Xiao > Reviewed-by: K. Y. Srinivasan > Reviewed-by: Haiyang Zhang I don't quite understand what problem is being solved here (and empty commit message doesn't is not very helpful). netdev_dbg() is not being printed by d

Re: [PATCH net-next] hyperv: Add handler for RNDIS_STATUS_NETWORK_CHANGE event

2015-10-30 Thread Vitaly Kuznetsov
Haiyang Zhang writes: >> -Original Message- >> From: Richard Weinberger [mailto:richard.weinber...@gmail.com] >> Sent: Tuesday, October 27, 2015 6:36 PM >> To: David Miller >> Cc: Haiyang Zhang ; o...@aepfle.de; Greg Kroah- >> Hartman ; netdev@vger.kernel.org; jasow...@redhat.com; >> dri

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

2016-05-12 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 | 2 -- drivers/net/hyperv/netvsc.c | 30

[PATCH 6/6] hv_netvsc: set nvdev link after populating chn_table

2016-05-12 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

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

2016-05-12 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 1/6] hv_netvsc: move start_remove flag to net_device_context

2016-05-12 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 5/6] hv_netvsc: synchronize netvsc_change_mtu()/netvsc_set_channels() with netvsc_remove()

2016-05-12 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 3/6] hv_netvsc: untangle the pointer mess

2016-05-12 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 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

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 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

[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 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 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 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 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 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 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 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] 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

Re: [PATCH net-next] hv_netvsc: Fix the list processing for network change event

2016-04-22 Thread Vitaly Kuznetsov
e get some other events in between these two halves. Reviewed-by: Vitaly Kuznetsov > Signed-off-by: Haiyang Zhang > Reviewed-by: K. Y. Srinivasan > --- > drivers/net/hyperv/netvsc_drv.c |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drive

Re: [PATCH net-next] hv_netvsc: Increase delay for RNDIS_STATUS_NETWORK_CHANGE

2016-02-03 Thread Vitaly Kuznetsov
Haiyang Zhang writes: > We simulates a link down period for RNDIS_STATUS_NETWORK_CHANGE message to > trigger DHCP renew. User daemons may need multiple seconds to trigger the > link down event. (e.g. ifplugd: 5sec, network-manager: 4sec.) So update > this link down period to 10 sec to properly tr

Re: [PATCH net-next] hv_netvsc: Increase delay for RNDIS_STATUS_NETWORK_CHANGE

2016-02-03 Thread Vitaly Kuznetsov
Haiyang Zhang writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Wednesday, February 3, 2016 8:06 AM >> To: Haiyang Zhang >> Cc: da...@davemloft.net; netdev@vger.kernel.org; KY Srinivasan >> ; o...@aep

[PATCH net] hv_netvsc: Restore needed_headroom request

2016-02-05 Thread Vitaly Kuznetsov
ry, it should not give us performance penalty. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/netvsc_drv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 1d3a665..98e34fe 100644 --- a/drivers/net/hyperv/netvsc_drv.c

Re: [PATCH net] hv_netvsc: Restore needed_headroom request

2016-02-10 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > Commit c0eb454034aa ("hv_netvsc: Don't ask for additional head room in the > skb") got rid of needed_headroom setting for the driver. With the change I > hit the following issue trying to use ptkgen module: > > [ 57.522021] kernel

Re: [PATCH net-next] hv_netvsc: Increase delay for RNDIS_STATUS_NETWORK_CHANGE

2016-02-17 Thread Vitaly Kuznetsov
David Miller writes: > From: Haiyang Zhang > Date: Tue, 9 Feb 2016 15:31:34 + > >> 1) I share your concern as well. Is there a universal way to immediately >> trigger >> DHCP renew of all current and future daemons with a single event from >> kernel? >> If not, can we put the delay (RNDI

[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-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 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 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 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 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

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 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 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 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 V5 9/9] hvsock: introduce Hyper-V VM Sockets feature

2016-01-05 Thread Vitaly Kuznetsov
Dexuan Cui writes: Just some minor nitpicks below -- I have to admit I didn't test the feature. [..skip..] > + > + if (sk->sk_err) { > + ret = -sk->sk_err; > + goto out_wait_error; > + } else { > + ret = 0; > + } > + > +out_wait: > + finish_w

Re: [PATCH V5 4/9] Drivers: hv: ring_buffer: enhance hv_ringbuffer_read() to support hvsock

2016-01-05 Thread Vitaly Kuznetsov
eason I didn't do it. I believe you have more or less the same reasoing for introducing new read type instead of parsing this at a higher level. Some comments below ... > > This patch is required by the next patch, which will introduce the hvsock > send/recv APIs. >

Re: [PATCH V5 5/9] Drivers: hv: vmbus: add APIs to send/recv hvsock packets

2016-01-05 Thread Vitaly Kuznetsov
Dexuan Cui writes: > This will be used by the coming net/hvsock driver. > > Signed-off-by: Dexuan Cui > --- > drivers/hv/channel.c | 59 > ++ > include/linux/hyperv.h | 9 > 2 files changed, 68 insertions(+) > > diff --git a/drivers/h

Re: [PATCH V5 7/9] Drivers: hv: vmbus: add a mechanism to pass hvsock events to the hvsock driver

2016-01-05 Thread Vitaly Kuznetsov
Dexuan Cui writes: > For now only 1 event is defined: HVSOCK_RESCIND_CHANNEL. > We'll have more events in the future. > > Signed-off-by: Dexuan Cui > --- > drivers/hv/channel_mgmt.c | 18 ++ > include/linux/hyperv.h| 17 + > 2 files changed, 35 insertions(+)

[PATCH net-next] hv_netvsc: use skb_get_hash() instead of a homegrown implementation

2016-01-25 Thread Vitaly Kuznetsov
the struct flow_keys data layout and this is wrong. Get rid of netvsc_set_hash() by switching to skb_get_hash(). This change will also imply switching to Jenkins hash from the currently used Toeplitz but it seems there is no good excuse for Toeplitz to stay. Signed-off-by: Vitaly Kuznetsov --

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] 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] 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

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] 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

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

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

[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

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

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-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: [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: [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: >> >>

  1   2   >