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

Re: [PATCH] Drivers: hv: vmbus: fix the race when querying & updating the percpu list

2016-05-17 Thread Vitaly Kuznetsov
Dexuan Cui writes: > There is a rare race when we remove an entry from the global list > hv_context.percpu_list[cpu] in hv_process_channel_removal() -> > percpu_channel_deq() -> list_del(): at this time, if vmbus_on_event() -> > process_chn_event() -> pcpu_relid2channel() is trying to query the l

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

2016-05-25 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 0/5] hv_netvsc: cleanup after untangling the pointer mess

2016-05-25 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] Drivers: hv: avoid vfree() on crash

2016-05-25 Thread Vitaly Kuznetsov
of crashes to reduce the amount of work which can cause consequent crashes. We don't really need to free anything on crash. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv.c | 8 +--- drivers/hv/hyperv_vmbus.h | 2 +- drivers/hv/vmbus_drv.c| 8 3 files changed

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

2016-05-25 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 5/5] hv_netvsc: pass struct net_device to rndis_filter_set_offload_params()

2016-05-25 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 2/5] hv_netvsc: introduce {net, hv}_device_to_netvsc_device() helpers

2016-05-25 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 3/5] hv_netvsc: pass struct netvsc_device to rndis_filter_{open, close}()

2016-05-25 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 2/2] Drivers: hv: don't leak memory in vmbus_establish_gpadl()

2016-05-30 Thread Vitaly Kuznetsov
In some cases create_gpadl_header() allocates submessages but we never free them. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c index 2b109e8..a68830c 100644 --- a

[PATCH 1/2] Drivers: hv: get rid of redundant messagecount in create_gpadl_header()

2016-05-30 Thread Vitaly Kuznetsov
We use messagecount only once in vmbus_establish_gpadl() to check if it is safe to iterate through the submsglist. We can just initialize the list header in all cases in create_gpadl_header() instead. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel.c | 38

[PATCH 0/2] Drivers: hv: fix memory leak while establishing GPADL

2016-05-30 Thread Vitaly Kuznetsov
kmemleak helped me to identify a memory leak on GPADL establishment. Do some minor refactoring and fix the issue. Vitaly Kuznetsov (2): Drivers: hv: get rid of redundant messagecount in create_gpadl_header() Drivers: hv: don't leak memory in vmbus_establish_gpadl() drivers/hv/chan

[PATCH 0/2] PCI: hv: fix a couple of issues in hv_pci_onchannelcallback()

2016-05-30 Thread Vitaly Kuznetsov
kmemleak helped me to identify a memory leak in hv_pci_onchannelcallback() and while fixing it I stumbled upon an unrelated issue(s) there. Vitaly Kuznetsov (2): PCI: hv: don't leak buffer in hv_pci_onchannelcallback() PCI: hv: handle all pending messages in hv_pci_onchannelcal

[PATCH 1/2] PCI: hv: don't leak buffer in hv_pci_onchannelcallback()

2016-05-30 Thread Vitaly Kuznetsov
We don't free buffer on several code paths in hv_pci_onchannelcallback(), put kfree() to the end of the function to fix the issue. Direct { kfree(); return; } can now be replaced with a simple 'break'; Signed-off-by: Vitaly Kuznetsov --- drivers/pci/host/pci-hyperv.c | 11

[PATCH 2/2] PCI: hv: handle all pending messages in hv_pci_onchannelcallback()

2016-05-30 Thread Vitaly Kuznetsov
values by dropping out. If the return value is not zero it is wrong to inspect buffer or bytes_recvd as these may contain invalid data. Signed-off-by: Vitaly Kuznetsov --- drivers/pci/host/pci-hyperv.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/pci/host/pci-

Re: [PATCH v3] Drivers: hv: vmbus: fix the race when querying & updating the percpu list

2016-05-31 Thread Vitaly Kuznetsov
vmbus_release_relid() to a later place where > the channel has been removed from the per-cpu and the global lists. > > Reported-by: Rolf Neugebauer > Cc: Vitaly Kuznetsov > Signed-off-by: Dexuan Cui Tested 4.7-rc1 with this path applied and kernel always crashes on boot (WS2016TP5,

Re: [PATCH v3] Drivers: hv: vmbus: fix the race when querying & updating the percpu list

2016-06-01 Thread Vitaly Kuznetsov
Dexuan Cui writes: >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Wednesday, June 1, 2016 0:27 >> To: Dexuan Cui >> Cc: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org; driverdev- >> de...@linuxdriverproject.org; o...@aepfle.de

[PATCH] Drivers: hv: fix infinite wait when channel open timeouts

2016-06-03 Thread Vitaly Kuznetsov
dd sending CHANNELMSG_CLOSECHANNEL message on timeout to make sure the channel is closed. The other possible solution for the issue would be to remove the timeout in vmbus_open() making our wait infinite. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel.c | 14 +- 1 file c

[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 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 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 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 v2] Drivers: hv: get rid of timeout in vmbus_open()

2016-06-06 Thread Vitaly Kuznetsov
to respond to our request (and there is nothing we can do if it doesn't). Signed-off-by: Vitaly Kuznetsov --- - The patch is the successor of previously sent '[PATCH] Drivers: hv: fix infinite wait when channel open timeouts, thus v2. - Remove the timeout completely [K. Y. Sriniva

[PATCH] Drivers: hv: utils: fix a race on userspace daemons registration

2016-06-07 Thread Vitaly Kuznetsov
27;t really know when these messages are delivered but we don't have a single message buffer there. Reported-by: Barry Davis Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_fcopy.c | 14 ++ drivers/hv/hv_kvp.c | 27 --- drivers/hv

[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

[PATCH 1/4] Drivers: hv: cleanup vmbus_open() for wrap around mappings

2016-06-10 Thread Vitaly Kuznetsov
); - rename poorly named labels; - use alloc_pages() instead of __get_free_pages() as we need struct page pointer for future. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel.c | 43 +++ 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/drivers

[PATCH 4/4] Drivers: hv: ring_buffer: count on wrap around mappings in get_next_pkt_raw()

2016-06-10 Thread Vitaly Kuznetsov
With wrap around mappings in place we can always provide drivers with direct links to packets on the ring buffer, even when they wrap around. Do the required updates to get_next_pkt_raw()/put_pkt_raw() Signed-off-by: Vitaly Kuznetsov --- include/linux/hyperv.h | 32

[PATCH 3/4] Drivers: hv: ring_buffer: use wrap around mappings in hv_copy{from, to}_ringbuffer()

2016-06-10 Thread Vitaly Kuznetsov
With wrap around mappings for ring buffers we can always use a single memcpy() to do the job. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/ring_buffer.c | 24 +++- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/drivers/hv/ring_buffer.c b/drivers/hv

[PATCH 0/4] Drivers: hv: ring_buffer: make in-place consumption always possible

2016-06-10 Thread Vitaly Kuznetsov
for conditional checking in copy_to/ copy_from functions and use a single memcpy(). Lightly tested with 'netvsc: Use the new in-place consumption APIs in the rx path' patch and with storvsc driver. Vitaly Kuznetsov (4): Drivers: hv: cleanup vmbus_open() for wrap around mappings Dr

[PATCH 2/4] Drivers: hv: ring_buffer: wrap around mappings for ring buffers

2016-06-10 Thread Vitaly Kuznetsov
) check in hv_ringbuffer_init() with BUILD_BUG_ON() as it is a compile time check. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel.c | 29 ++--- drivers/hv/hyperv_vmbus.h | 4 ++-- drivers/hv/ring_buffer.c | 39 +-- 3 files

Re: [PATCH 0/2] PCI: hv: fix a couple of issues in hv_pci_onchannelcallback()

2016-06-10 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > kmemleak helped me to identify a memory leak in hv_pci_onchannelcallback() > and while fixing it I stumbled upon an unrelated issue(s) there. > > Vitaly Kuznetsov (2): > PCI: hv: don't leak buffer in hv_pci_onchannelcallback() > PCI: hv: hand

Re: [PATCH 0/2] PCI: hv: fix a couple of issues in hv_pci_onchannelcallback()

2016-06-19 Thread Vitaly Kuznetsov
Bjorn Helgaas writes: > On Fri, Jun 10, 2016 at 06:53:36PM -0500, Bjorn Helgaas wrote: >> On Mon, May 30, 2016 at 04:17:57PM +0200, Vitaly Kuznetsov wrote: >> > kmemleak helped me to identify a memory leak in hv_pci_onchannelcallback() >> > and while fixing it I stumb

[PATCH] Tools: hv: kvp: ensure kvp device fd is closed on exec

2016-06-30 Thread Vitaly Kuznetsov
KVP daemon does fork()/exec() (with popen()) so we need to close our fds to avoid sharing them with child processes. The immediate implication of not doing so I see is SELinux complaining about 'ip' trying to access '/dev/vmbus/hv_kvp'. Signed-off-by: Vitaly Kuzn

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

Re: [PATCH 0/3] Drivers: hv: vmbus: Some miscellaneous fixes

2016-07-29 Thread Vitaly Kuznetsov
"K. Y. Srinivasan" writes: > Some miscellaneous fixes. > > Vitaly Kuznetsov (3): > Drivers: hv: avoid vfree() on crash > Drivers: hv: get rid of redundant messagecount in > create_gpadl_header() > Drivers: hv: don't leak memory in vmbus_establish_

[PATCH 4/4] Drivers: hv: balloon: replace ha_region_mutex with spinlock

2016-08-05 Thread Vitaly Kuznetsov
list_for_each -> list_for_each_entry as we actually need entries in all these cases, drop meaningless list_empty() checks. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_balloon.c | 98 ++--- 1 file changed, 53 insertions(+), 45 deletions(-) diff --git a/drivers/

[PATCH 3/4] Drivers: hv: balloon: get rid on ol_waitevent

2016-08-05 Thread Vitaly Kuznetsov
With the recently introduced in-kernel memory onlining (MEMORY_HOTPLUG_DEFAULT_ONLINE) these it no point in waiting for pages to come online in the driver and in case the feature is disabled the 5 second wait won't help. Get rid of the waiting. Signed-off-by: Vitaly Kuznetsov --- drive

[PATCH 0/4] Drivers: hv: balloon: fix WS2012 memory hotplug issues and do some cleanup

2016-08-05 Thread Vitaly Kuznetsov
the locking fine-grained with a spinlock. Vitaly Kuznetsov (4): Drivers: hv: balloon: keep track of where ha_region starts Drivers: hv: balloon: account for gaps in hot add regions Drivers: hv: balloon: get rid on ol_waitevent Drivers: hv: balloon: replace ha_region_mutex with spinlock

[PATCH 2/4] Drivers: hv: balloon: account for gaps in hot add regions

2016-08-05 Thread Vitaly Kuznetsov
and our current logic doesn't allow that. Instead, create a list of such 'gaps' and check for them in the page online callback. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_balloon.c | 107 +--- 1 file changed, 83 insertions

[PATCH 1/4] Drivers: hv: balloon: keep track of where ha_region starts

2016-08-05 Thread Vitaly Kuznetsov
'moving window' was wrong (as there is no guarantee that hot add requests come ordered) we should still keep track of covered_start_pfn. This is not a revert, the logic is different. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_balloon.c | 7 +-- 1 file changed, 5 insertions(+),

Re: [PATCH 2/4] Drivers: hv: balloon: account for gaps in hot add regions

2016-08-08 Thread Vitaly Kuznetsov
"Alex Ng (LIS)" writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Friday, August 5, 2016 3:49 AM >> To: de...@linuxdriverproject.org >> Cc: linux-ker...@vger.kernel.org; Haiyang Zhang ; >> KY Srin

[PATCH 0/2] Drivers: hv: vmbus: make bus ids in sysfs persistent

2016-08-09 Thread Vitaly Kuznetsov
auto incremented counter. Vitaly Kuznetsov (2): Drivers: hv: make VMBus bus ids persistent Drivers: hv: get rid of id in struct vmbus_channel drivers/hv/channel_mgmt.c | 2 -- drivers/hv/vmbus_drv.c| 2 +- include/linux/hyperv.h| 3 --- 3 files changed, 1 insertion(+), 6 deletions

[PATCH 1/2] Drivers: hv: make VMBus bus ids persistent

2016-08-09 Thread Vitaly Kuznetsov
. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/vmbus_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index e82f7e1..ef42909 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -962,7 +962,7 @@ int

[PATCH 2/2] Drivers: hv: get rid of id in struct vmbus_channel

2016-08-09 Thread Vitaly Kuznetsov
The auto incremented counter is not being used anymore, get rid of it. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel_mgmt.c | 2 -- include/linux/hyperv.h| 3 --- 2 files changed, 5 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index b6c1211

Re: [PATCH 0/2] Drivers: hv: vmbus: make bus ids in sysfs persistent

2016-08-11 Thread Vitaly Kuznetsov
KY Srinivasan writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Tuesday, August 9, 2016 1:46 AM >> To: de...@linuxdriverproject.org >> Cc: linux-ker...@vger.kernel.org; Haiyang Zhang ; >> KY Srinivasan

Re: [PATCH 3/4] Drivers: hv: balloon: get rid on ol_waitevent

2016-08-11 Thread Vitaly Kuznetsov
"Alex Ng (LIS)" writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Friday, August 5, 2016 3:49 AM >> To: de...@linuxdriverproject.org >> Cc: linux-ker...@vger.kernel.org; Haiyang Zhang ; KY >> Srin

[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

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

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 v2 0/4] Drivers: hv: balloon: fix WS2012 memory hotplug issues and do some cleanup

2016-08-11 Thread Vitaly Kuznetsov
when we have in in-kernel memory onlining, patch 4 gets rid of ha_region_mutex by doing the locking fine-grained with a spinlock. Vitaly Kuznetsov (4): Drivers: hv: balloon: keep track of where ha_region starts Drivers: hv: balloon: account for gaps in hot add regions Drivers: hv: balloon

[PATCH v2 1/4] Drivers: hv: balloon: keep track of where ha_region starts

2016-08-11 Thread Vitaly Kuznetsov
'moving window' was wrong (as there is no guarantee that hot add requests come ordered) we should still keep track of covered_start_pfn. This is not a revert, the logic is different. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_balloon.c | 7 +-- 1 file changed, 5 insertions(+),

[PATCH v2 3/4] Drivers: hv: balloon: don't wait for ol_waitevent when memhp_auto_online is enabled

2016-08-11 Thread Vitaly Kuznetsov
With the recently introduced in-kernel memory onlining (MEMORY_HOTPLUG_DEFAULT_ONLINE) these is no point in waiting for pages to come online in the driver and we can get rid of the waiting. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_balloon.c | 14 -- 1 file changed, 8

[PATCH v2 2/4] Drivers: hv: balloon: account for gaps in hot add regions

2016-08-11 Thread Vitaly Kuznetsov
and our current logic doesn't allow that. Instead, create a list of such 'gaps' and check for them in the page online callback. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_balloon.c | 107 +--- 1 file changed, 83 insertions

[PATCH v2 4/4] Drivers: hv: balloon: replace ha_region_mutex with spinlock

2016-08-11 Thread Vitaly Kuznetsov
list_for_each -> list_for_each_entry as we actually need entries in all these cases, drop meaningless list_empty() checks. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_balloon.c | 96 ++--- 1 file changed, 52 insertions(+), 44 deletions(-) diff --git a/drivers/

[PATCH v2 RESEND 3/4] Drivers: hv: balloon: don't wait for ol_waitevent when memhp_auto_online is enabled

2016-08-11 Thread Vitaly Kuznetsov
With the recently introduced in-kernel memory onlining (MEMORY_HOTPLUG_DEFAULT_ONLINE) these is no point in waiting for pages to come online in the driver and we can get rid of the waiting. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_balloon.c | 14 -- 1 file changed, 8

[PATCH v2 RESEND 4/4] Drivers: hv: balloon: replace ha_region_mutex with spinlock

2016-08-11 Thread Vitaly Kuznetsov
list_for_each -> list_for_each_entry as we actually need entries in all these cases, drop meaningless list_empty() checks. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_balloon.c | 96 ++--- 1 file changed, 52 insertions(+), 44 deletions(-) diff --git a/drivers/

[PATCH v2 RESEND 2/4] Drivers: hv: balloon: account for gaps in hot add regions

2016-08-11 Thread Vitaly Kuznetsov
and our current logic doesn't allow that. Instead, create a list of such 'gaps' and check for them in the page online callback. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_balloon.c | 107 +--- 1 file changed, 83 insertions

[PATCH v2 RESEND 0/4] Drivers: hv: balloon: fix WS2012 memory hotplug issues and do some cleanup

2016-08-11 Thread Vitaly Kuznetsov
sues which I fix with first two patches of this series. Patches 3 removes wait on ol_waitevent when we have in in-kernel memory onlining, patch 4 gets rid of ha_region_mutex by doing the locking fine-grained with a spinlock. Vitaly Kuznetsov (4): Drivers: hv: balloon: keep track of where ha_reg

[PATCH v2 RESEND 1/4] Drivers: hv: balloon: keep track of where ha_region starts

2016-08-11 Thread Vitaly Kuznetsov
'moving window' was wrong (as there is no guarantee that hot add requests come ordered) we should still keep track of covered_start_pfn. This is not a revert, the logic is different. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_balloon.c | 7 +-- 1 file changed, 5 insertions(+),

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

[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 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 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 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 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 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: [PATCH 0/2] Drivers: hv: vmbus: make bus ids in sysfs persistent

2016-08-15 Thread Vitaly Kuznetsov
KY Srinivasan writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Thursday, August 11, 2016 2:17 AM >> To: KY Srinivasan >> Cc: de...@linuxdriverproject.org; linux-ker...@vger.kernel.org; Haiyang Zhang >> >

Re: [PATCH v2 RESEND 2/4] Drivers: hv: balloon: account for gaps in hot add regions

2016-08-16 Thread Vitaly Kuznetsov
"Alex Ng (LIS)" writes: >> @@ -676,35 +686,63 @@ static void hv_mem_hot_add(unsigned long start, >> unsigned long size, >> >> static void hv_online_page(struct page *pg) { >> -struct list_head *cur; >> struct hv_hotadd_state *has; >> +struct hv_hotadd_gap *gap; >> unsigned lo

[PATCH v3 1/4] Drivers: hv: balloon: keep track of where ha_region starts

2016-08-16 Thread Vitaly Kuznetsov
'moving window' was wrong (as there is no guarantee that hot add requests come ordered) we should still keep track of covered_start_pfn. This is not a revert, the logic is different. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_balloon.c | 7 +-- 1 file changed, 5 insertions(+),

[PATCH v3 0/4] Drivers: hv: balloon: fix WS2012 memory hotplug issues and do some cleanup

2016-08-16 Thread Vitaly Kuznetsov
entify two issues which I fix with first two patches of this series. Patches 3 removes wait on ol_waitevent when we have in in-kernel memory onlining, patch 4 gets rid of ha_region_mutex by doing the locking fine-grained with a spinlock. Vitaly Kuznetsov (4): Drivers: hv: balloon: keep trac

[PATCH v3 2/4] Drivers: hv: balloon: account for gaps in hot add regions

2016-08-16 Thread Vitaly Kuznetsov
and our current logic doesn't allow that. Instead, create a list of such 'gaps' and check for them in the page online callback. Signed-off-by: Vitaly Kuznetsov --- Changes since v2: - check for gaps when onlining 'tails' in hv_bring_pgs_onlin

[PATCH v3 3/4] Drivers: hv: balloon: don't wait for ol_waitevent when memhp_auto_online is enabled

2016-08-16 Thread Vitaly Kuznetsov
With the recently introduced in-kernel memory onlining (MEMORY_HOTPLUG_DEFAULT_ONLINE) these is no point in waiting for pages to come online in the driver and we can get rid of the waiting. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_balloon.c | 15 +-- 1 file changed, 9

[PATCH v3 4/4] Drivers: hv: balloon: replace ha_region_mutex with spinlock

2016-08-16 Thread Vitaly Kuznetsov
list_for_each -> list_for_each_entry as we actually need entries in all these cases, drop meaningless list_empty() checks. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_balloon.c | 98 ++--- 1 file changed, 53 insertions(+), 45 deletions(-) diff --git a/drivers/

[PATCH v2 0/2] Drivers: hv: vmbus: make bus ids in sysfs persistent

2016-08-23 Thread Vitaly Kuznetsov
of an auto incremented counter. Changes since v1: - Use if_instance instead of relid [K. Y. Srinivasan] Vitaly Kuznetsov (2): Drivers: hv: make VMBus bus ids persistent Drivers: hv: get rid of id in struct vmbus_channel drivers/hv/channel_mgmt.c | 2 -- drivers/hv/vmbus_drv.c| 4

[PATCH v2 2/2] Drivers: hv: get rid of id in struct vmbus_channel

2016-08-23 Thread Vitaly Kuznetsov
The auto incremented counter is not being used anymore, get rid of it. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel_mgmt.c | 2 -- include/linux/hyperv.h| 3 --- 2 files changed, 5 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index b6c1211

[PATCH v2 1/2] Drivers: hv: make VMBus bus ids persistent

2016-08-23 Thread Vitaly Kuznetsov
. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/vmbus_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index e82f7e1..ca7ae7a 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -961,8 +961,8 @@ int

Re: [PATCH 2/5] Drivers: hv: balloon: account for gaps in hot add regions

2016-08-25 Thread Vitaly Kuznetsov
Yauheni Kaliuta writes: > Hi, kys! > >> On Wed, 24 Aug 2016 16:23:10 -0700, kys wrote: > > [...] > > > -static bool pfn_covered(unsigned long start_pfn, unsigned long pfn_cnt) > > +static int pfn_covered(unsigned long start_pfn, unsigned long pfn_cnt) > > { > >struct list_head *cur

Re: [PATCH char-misc 1/1] Drivers: hv: vmbus: Implement Direct Mode for stimer0

2017-11-01 Thread Vitaly Kuznetsov
mikel...@exchange.microsoft.com writes: > From: Michael Kelley > > The 2016 version of Hyper-V offers the option to operate the guest VM > per-vcpu stimer's in Direct Mode, which means the timer interupts on its > own vector rather than queueing a VMbus message. Direct Mode reduces > timer proce

Re: [PATCH char-misc 1/1] Drivers: hv: vmbus: Implement Direct Mode for stimer0

2017-11-01 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > mikel...@exchange.microsoft.com writes: > >> From: Michael Kelley >> >> The 2016 version of Hyper-V offers the option to operate the guest VM >> per-vcpu stimer's in Direct Mode, which means the timer interupts on its >> own ve

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 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] tools/hv: add install target to Makefile

2017-11-03 Thread Vitaly Kuznetsov
Makefiles usually come with 'install' target included so each distro doesn't need to implement the procedure from scratch. Add it to tools/hv. Signed-off-by: Vitaly Kuznetsov --- tools/hv/Makefile | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) dif

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