[PATCH 0/2] Drivers: hv: balloon: two memory hotplug fixes

2016-04-05 Thread Vitaly Kuznetsov
m/memory/auto_online_blocks' 3) Wait till hv_balloon driver finishes negotiation. 4) Increase memory to 8192Mb. 5) Increase memory to 1Mb. The first patch in the series fixes the issue. While writing it I stumbled upon an unrelated issue which I fix with PATCH 2. Please review. Vitaly

[PATCH 2/2] Drivers: hv: balloon: reset host_specified_ha_region

2016-04-05 Thread Vitaly Kuznetsov
We set host_specified_ha_region = true on certain request but this is a global state which stays 'true' forever. We need to reset it when we receive a request where ha_region is not specified. I did not see any real issues, the bug was found by code inspection. Signed-off-by: Vitaly

Re: [PATCH 0/6] Drivers: hv: vmbus: Cleanup and mmio management.

2016-04-04 Thread Vitaly Kuznetsov
2016-April/088262.html It consists of 7 patches. It would probably make sense to take them all I think. > > Vitaly Kuznetsov (1): > Drivers: hv: kvp: fix IP Failover > > drivers/hv/hv_kvp.c | 31 + > drivers/hv/hyperv_vmbus.h

[PATCH v2] Drivers: hv: kvp: fix IP Failover

2016-03-29 Thread Vitaly Kuznetsov
t separation between kernel and userspace parts. Other two modules (VSS and FCOPY) don't require such delay, leave them untouched. Signed-off-by: Vitaly Kuznetsov --- Changes since v1: - Cancel handshake timeout work on module unload. --- drivers/hv/hv_kvp.c | 31 ++

Re: [PATCH 1/6] Drivers: hv: kvp: fix IP Failover

2016-03-29 Thread Vitaly Kuznetsov
"K. Y. Srinivasan" writes: > From: Vitaly Kuznetsov > > Hyper-V VMs can be replicated to another hosts and there is a feature to > set different IP for replicas, it is called 'Failover TCP/IP'. When > such guest starts Hyper-V host sends it KVP_OP_SET_IP_

Re: KVP daemon/module race on module unloading

2016-03-24 Thread Vitaly Kuznetsov
Dexuan Cui writes: > Hi Vitaly, > We got the below warning once -- it's pretty hard to repro it. > > I think the cause may be: before the daemon is terminated, we can successfully > "rmmod hv_utils" -- as a result all the code/data segments of the module > shouldn't be accessed any more, but in

[PATCH v2] Drivers: hv: vmbus: handle various crash scenarios

2016-03-22 Thread Vitaly Kuznetsov
PU as we're clearing CPU0 messages now but we may want to bring up additional CPUs on crash) as new messages won't be delivered till we consume what's pending. On boot we'll place message pages somewhere else and we won't be able to read stale messages.

Re: [PATCH] Drivers: hv: vmbus: handle various crash scenarios

2016-03-22 Thread Vitaly Kuznetsov
KY Srinivasan writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Monday, March 21, 2016 12:52 AM >> To: KY Srinivasan >> Cc: de...@linuxdriverproject.org; linux-ker...@vger.kernel.org; Haiyang >> Zhang ; Ale

Re: [PATCH 3/5] Drivers: hv: vmbus: Fix a bug in hv_need_to_signal_on_read()

2016-03-22 Thread Vitaly Kuznetsov
KY Srinivasan writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Monday, March 21, 2016 1:19 AM >> To: KY Srinivasan >> Cc: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org; >> de...@linux

Re: [PATCH] Drivers: hv: vmbus: handle various crash scenarios

2016-03-22 Thread Vitaly Kuznetsov
KY Srinivasan writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Monday, March 21, 2016 12:52 AM >> To: KY Srinivasan >> Cc: de...@linuxdriverproject.org; linux-ker...@vger.kernel.org; Haiyang >> Zhang ; Ale

Re: [PATCH 5/5] Drivers: hv: vmbus: Implement copy-free read APIs

2016-03-21 Thread Vitaly Kuznetsov
"K. Y. Srinivasan" writes: > Implement copy-free read APIs. > > Signed-off-by: K. Y. Srinivasan > --- > drivers/hv/ring_buffer.c | 55 > ++ > include/linux/hyperv.h |6 + > 2 files changed, 61 insertions(+), 0 deletions(-) > > diff --git

Re: [PATCH 3/5] Drivers: hv: vmbus: Fix a bug in hv_need_to_signal_on_read()

2016-03-21 Thread Vitaly Kuznetsov
"K. Y. Srinivasan" writes: > We need to issue a full memory barrier prior making a signalling > decision. Any reason this should be mb()? This is pretty strong and will probably lead to performace regression ... and, btw, we have another mb() in hv_ringbuffer_read(). Could you please describe t

Re: [PATCH] Drivers: hv: vmbus: handle various crash scenarios

2016-03-21 Thread Vitaly Kuznetsov
KY Srinivasan writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Friday, March 18, 2016 5:33 AM >> To: de...@linuxdriverproject.org >> Cc: linux-ker...@vger.kernel.org; KY Srinivasan ; >> Haiyang Zhang ; Ale

Re: [PATCH] Drivers: hv: vmbus: handle various crash scenarios

2016-03-20 Thread Vitaly Kuznetsov
Radim Krcmar writes: > 2016-03-18 13:33+0100, Vitaly Kuznetsov: >> Kdump keeps biting. Turns out CHANNELMSG_UNLOAD_RESPONSE is always >> delivered to CPU0 regardless of what CPU we're sending CHANNELMSG_UNLOAD >> from. vmbus_wait_for_unload() doesn't account for

[PATCH] Drivers: hv: vmbus: handle various crash scenarios

2016-03-18 Thread Vitaly Kuznetsov
current CPU as we're clearing CPU0 messages now but we may want to bring up additional CPUs on crash) as new messages won't be delivered till we consume what's pending. On boot we'll place message pages somewhere else and we won't be able to read stale messages. Sig

[PATCH] scsi: storvsc: fix SRB_STATUS_ABORTED handling

2016-03-07 Thread Vitaly Kuznetsov
l required, fix the check. Fixes: 3209f9d780d1 ("scsi: storvsc: Fix a bug in the handling of SRB status flags") Signed-off-by: Vitaly Kuznetsov --- drivers/scsi/storvsc_drv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi

[PATCH] Drivers: hv: kvp: fix IP Failover

2016-03-02 Thread Vitaly Kuznetsov
t separation between kernel and userspace parts. Other two modules (VSS and FCOPY) don't require such delay, leave them untouched. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_kvp.c | 30 ++ drivers/hv/hyperv_vmbus.h | 5 + 2 files changed, 35 in

Re: [PATCH] Drivers: hv: util: fix a race with daemons startup

2016-02-29 Thread Vitaly Kuznetsov
KY Srinivasan writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Thursday, February 18, 2016 5:35 AM >> To: de...@linuxdriverproject.org >> Cc: KY Srinivasan ; Haiyang Zhang >> ; Olaf Hering ; Cathy Avery

[PATCH] Drivers: hv: util: fix a race with daemons startup

2016-02-18 Thread Vitaly Kuznetsov
nctions. Fixes: 3cace4a61610 ("Drivers: hv: utils: run polling callback always in interrupt context") Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_fcopy.c| 1 + drivers/hv/hv_kvp.c | 1 + drivers/hv/hv_snapshot.c | 1 + 3 files changed, 3 insertions(+) diff --git a/drivers/h

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 2/4] Drivers: hv: vmbus: avoid wait_for_completion() on crash

2016-02-12 Thread Vitaly Kuznetsov
wait_for_completion() may sleep, it enables interrupts and this is something we really want to avoid on crashes because interrupt handlers can cause other crashes. Switch to the recently introduced vmbus_wait_for_unload() doing busy wait instead. Reported-by: Radim Krcmar Signed-off-by: Vitaly

[PATCH 3/4] Drivers: hv: vmbus: remove code duplication in message handling

2016-02-12 Thread Vitaly Kuznetsov
We have 3 functions dealing with messages and they all implement the same logic to finalize reads, move it to vmbus_signal_eom(). Suggested-by: Radim Krcmar Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel_mgmt.c | 10 +- drivers/hv/hyperv_vmbus.h | 24

[PATCH 0/4] Drivers: hv: vmbus: bugfix and improvements for message handling

2016-02-12 Thread Vitaly Kuznetsov
First patch of the series addresses a potentially important issue, second patch tries to make crash path more stable, the rest is just a cleanup. Please review. Vitaly Kuznetsov (4): Drivers: hv: vmbus: don't loose HVMSG_TIMER_EXPIRED messages Drivers: hv: vmbus: avoid wait_for_compl

[PATCH 4/4] Drivers: hv: vmbus: avoid unneeded compiler optimizations in vmbus_wait_for_unload()

2016-02-12 Thread Vitaly Kuznetsov
Message header is modified by the hypervisor and we read it in a loop, we need to prevent compilers from optimizing accesses. There are no such optimizations at this moment, this is just a future proof. Suggested-by: Radim Krcmar Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel_mgmt.c

[PATCH 1/4] Drivers: hv: vmbus: don't loose HVMSG_TIMER_EXPIRED messages

2016-02-12 Thread Vitaly Kuznetsov
handle it from there. Avoid looping in vmbus_on_msg_dpc(), we're OK with handling one message per interrupt. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/vmbus_drv.c | 68 -- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/dr

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

[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-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; net...@vger.kernel.org; KY Srinivasan >> ; o...@aep

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

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

[PATCH 3/3] Drivers: hv: vmbus: don't manipulate with clocksources on crash

2016-01-18 Thread Vitaly Kuznetsov
clocksource_change_rating() involves mutex usage and can't be called in interrupt context. It also makes sense to avoid doing redundant work on crash. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drive

[PATCH 1/3] Drivers: hv: vmbus: avoid infinite loop in init_vp_index()

2016-01-18 Thread Vitaly Kuznetsov
cpus in Linux, e.g. when we boot with 'nr_cpus=' limitation. Avoid the infinite loop in init_vp_index() by checking that we still have non-used CPUs in the alloced_cpus_in_node mask and resetting it in case we don't. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel_mgm

[PATCH 2/3] Drivers: hv: vmbus: avoid scheduling in interrupt context in vmbus_initiate_unload()

2016-01-18 Thread Vitaly Kuznetsov
all the other messages and use it if we're in an interrupt context. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel_mgmt.c | 44 +++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_m

[PATCH 0/3] Drivers: hv: fix kdump (again) and more

2016-01-18 Thread Vitaly Kuznetsov
Kdump on crash is reportedly broken for Hyper-V guests and I was able to find two reasons: 1) Inability to boot with nr_cpus=1 (PATCH 1) 2) Sleeping in interrupt context on crash (PATCH 2 and 3) Vitaly Kuznetsov (3): Drivers: hv: vmbus: avoid infinite loop in init_vp_index() Drivers: hv

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(+)

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 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 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 1/3] Drivers: hv: utils: fix hvt_op_poll() return value on transport destroy

2015-12-16 Thread Vitaly Kuznetsov
project.org; o...@aepfle.de; a...@canonical.com; >> vkuzn...@redhat.com; jasow...@redhat.com >> Subject: [PATCH 1/3] Drivers: hv: utils: fix hvt_op_poll() return value on >> transport >> destroy >> >> From: Vitaly Kuznetsov >> >> The return type of hvt_op_pol

[PATCH] Drivers: hv: utils: fix hvt_op_poll() return value on transport destroy

2015-12-15 Thread Vitaly Kuznetsov
The return type of hvt_op_poll() is unsigned int and -EBADF is inappropriate, poll functions return POLL* statuses. Reported-by: Dexuan Cui Signed-off-by: Vitaly Kuznetsov --- - This is a follow-up to the previously sent 'Drivers: hv: utils: introduce HVUTIL_TRANSPORT_DESTROY mode&#

Re: [PATCH 3/9] Drivers: hv: utils: introduce HVUTIL_TRANSPORT_DESTROY mode

2015-12-15 Thread Vitaly Kuznetsov
> de...@linuxdriverproject.org; o...@aepfle.de; a...@canonical.com; >> vkuzn...@redhat.com; jasow...@redhat.com >> Subject: [PATCH 3/9] Drivers: hv: utils: introduce HVUTIL_TRANSPORT_DESTROY >> mode >> >> From: Vitaly Kuznetsov >> >> When Hyper-V host

[PATCH v2 RESEND 4/4] Drivers: hv: utils: fix crash when device is removed from host side

2015-12-14 Thread Vitaly Kuznetsov
only way to solve the issue is to defer freeing the hvutil_transport structure. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_utils_transport.c | 26 +++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/hv/hv_utils_transport.c b/drivers/hv

[PATCH v2 RESEND 3/4] Drivers: hv: utils: introduce HVUTIL_TRANSPORT_DESTROY mode

2015-12-14 Thread Vitaly Kuznetsov
separate contexts now we need to use a proper locking. Signed-off-by: Vitaly Kuznetsov --- Changes since v1: - Don't re-introduce memory leak in hvt_op_write() [Dan Carpenter] --- drivers/hv/hv_utils_transport.c | 71 - drivers/hv/hv_utils_transport.h |

[PATCH v2 RESEND 0/4] Drivers: hv: utils: prevent crash when a utility driver is disabled host side

2015-12-14 Thread Vitaly Kuznetsov
ted, patch 2 renames outmsg_lock to 'lock' as we're gonna use it to protect test-and-set operations on 'mode', patch 3 introduces HVUTIL_TRANSPORT_DESTROY mode of operation, patch 4 fixes the issue itself. Patches are rebased on previously sent Olaf's fixes. Vitaly Kuzne

[PATCH v2 RESEND 2/4] Drivers: hv: utils: rename outmsg_lock

2015-12-14 Thread Vitaly Kuznetsov
As a preparation to reusing outmsg_lock to protect test-and-set openrations on 'mode' rename it the more general 'lock'. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_utils_transport.c | 14 +++--- drivers/hv/hv_utils_transport.h | 2 +- 2 files changed

[PATCH v2 RESEND 1/4] Drivers: hv: utils: fix memory leak on on_msg() failure

2015-12-14 Thread Vitaly Kuznetsov
inmsg should be freed in case of on_msg() failure to avoid memory leak. Preserve the error code from on_msg(). Signed-off-by: Vitaly Kuznetsov --- Changes since v1: - Preserve the error code from on_msg(). [Dan Carpenter] --- drivers/hv/hv_utils_transport.c | 7 --- 1 file changed, 4

Re: [PATCH net-next] hv_netvsc: Fix race condition on Multi-Send Data field

2015-12-11 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > Haiyang Zhang writes: > >> In commit 2a04ae8acb14 ("hv_netvsc: remove locking in netvsc_send()"), the >> locking for MSD (Multi-Send Data) field was removed. This could cause a >> race condition between RNDIS control messages and d

Re: [PATCH net-next] hv_netvsc: Fix race condition on Multi-Send Data field

2015-12-11 Thread Vitaly Kuznetsov
() directly. Please see my patch attached (note: it should be split in 3 patches if submitted). If you like the idea I can send it. -- Vitaly commit b2784f827d2b7b19d3af6025bbe8be5b1450b88c Author: Vitaly Kuznetsov Date: Fri Dec 11 13:29:40 2015 +0100 netvsc: untangle rndis_filter_send_reques

[PATCH v2 5/5] Drivers: hv: ring_buffer: eliminate hv_ringbuffer_peek()

2015-12-08 Thread Vitaly Kuznetsov
above mentioned lock, calculate available space on the ring, ...) twice and this path is performance-critical. Remove hv_ringbuffer_peek() moving the logic from __vmbus_recvpacket() to hv_ringbuffer_read(). Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel.c | 30

[PATCH v2 2/5] Drivers: hv: ring_buffer: remove stray smp_read_barrier_depends()

2015-12-08 Thread Vitaly Kuznetsov
smp_read_barrier_depends() does nothing on almost all arcitectures including x86 and having it in the beginning of hv_get_ringbuffer_availbytes() does not provide any guarantees anyway. Signed-off-by: Vitaly Kuznetsov --- include/linux/hyperv.h | 2 -- 1 file changed, 2 deletions(-) diff --git

[PATCH v2 3/5] Drivers: hv: ring_buffer: remove code duplication from hv_ringbuffer_peek/read()

2015-12-08 Thread Vitaly Kuznetsov
hv_ringbuffer_peek() does the same as hv_ringbuffer_read() without advancing the read index. The only functional change this patch brings is moving hv_need_to_signal_on_read() call under the ring_lock but this function is just a couple of comparisons. Signed-off-by: Vitaly Kuznetsov --- drivers

[PATCH v2 4/5] Drivers: hv: remove code duplication between vmbus_recvpacket()/vmbus_recvpacket_raw()

2015-12-08 Thread Vitaly Kuznetsov
case in vmbus_recvpacket(). I'm removing it as it is usless for users to see such messages and /vmbus_recvpacket_raw() doesn't have it. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel.c | 65 ++-- 1 file changed, 22 insertions(+), 43 deletion

[PATCH v2 1/5] Drivers: hv: ring_buffer.c: fix comment style

2015-12-08 Thread Vitaly Kuznetsov
Convert 6+-string comments repeating function names to normal kernel-style comments and fix a couple of other comment style issues. No textual or functional changes intended. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/ring_buffer.c | 135 +-- 1

[PATCH v2 0/5] Drivers: hv: ring_buffer: do some code cleanup and optimization

2015-12-08 Thread Vitaly Kuznetsov
Changes since v1: added PATCH 4/5 and 5/5. 1) Fix comment style in ring_buffer.c 2) Remove unneeded smp_read_barrier_depends() from hyperv.h 3) Unify hv_ringbuffer_peek/read() functions 4) Unify vmbus_recvpacket()/vmbus_recvpacket_raw() functions 5) Eliminate hv_ringbuffer_peek(). Vitaly

Re: [PATCH] storvsc: add more logging for error and warning messages

2015-12-04 Thread Vitaly Kuznetsov
Long Li writes: > Introduce a logging level for storvsc to log certain error/warning > messages. Those messages are helpful in some environments, > e.g. Microsoft Azure, for customer support and troubleshooting > purposes. I have an alternative suggestion: let's use dynamic debug! Basically, we

[PATCH net-next] hv_netvsc: rework link status change handling

2015-11-27 Thread Vitaly Kuznetsov
ork device context. - On a reconfig event add it to the list of events and schedule netvsc_link_change(). - In netvsc_link_change() ensure 2-second delay between link status changes. - Handle RNDIS_STATUS_NETWORK_CHANGE as a paired disconnect/connect event. Signed-off-by: Vitaly Kuznetsov --

Re: [PATCH net-next 08/10] hv_netvsc: Don't ask for additional head room in the skb

2015-11-24 Thread Vitaly Kuznetsov
"K. Y. Srinivasan" writes: > The rndis header is 116 bytes big and can be placed in the default > head room that will be available in the skb. We have the following in include/linux/netdevice.h: #if defined(CONFIG_WLAN) || IS_ENABLED(CONFIG_AX25) # if defined(CONFIG_MAC80211_MESH) # define LL_

Re: [PATCH net-next 01/10] hv_netvsc: Resize some of the variables in hv_netvsc_packet

2015-11-24 Thread Vitaly Kuznetsov
"K. Y. Srinivasan" writes: > As part of reducing the size of the hv_netvsc_packet, resize some of the > variables based on their usage. > > Signed-off-by: K. Y. Srinivasan > Reviewed-by: Haiyang Zhang > --- > drivers/net/hyperv/hyperv_net.h | 14 +++--- > 1 files changed, 7 insertion

[PATCH 3/3] Drivers: hv: ring_buffer: remove code duplication from hv_ringbuffer_peek/read()

2015-11-23 Thread Vitaly Kuznetsov
hv_ringbuffer_peek() does the same as hv_ringbuffer_read() without advancing the read index. The only functional change this patch brings is moving hv_need_to_signal_on_read() call under the ring_lock but this function is just a couple of comparisons. Signed-off-by: Vitaly Kuznetsov --- drivers

[PATCH 2/3] Drivers: hv: ring_buffer: remove stray smp_read_barrier_depends()

2015-11-23 Thread Vitaly Kuznetsov
smp_read_barrier_depends() does nothing on almost all arcitectures including x86 and having it in the beginning of hv_get_ringbuffer_availbytes() does not provide any guarantees anyway. Signed-off-by: Vitaly Kuznetsov --- include/linux/hyperv.h | 2 -- 1 file changed, 2 deletions(-) diff --git

[PATCH 0/3] Drivers: hv: ring_buffer: do some code cleanup

2015-11-23 Thread Vitaly Kuznetsov
1) Fix comment style in ring_buffer.c 2) Remove unneeded smp_read_barrier_depends() from hyperv.h 3) Unify hv_ringbuffer_peek/read() functions. Vitaly Kuznetsov (3): Drivers: hv: ring_buffer.c: fix comment style Drivers: hv: ring_buffer: remove stray smp_read_barrier_depends() Drivers: hv

[PATCH 1/3] Drivers: hv: ring_buffer.c: fix comment style

2015-11-23 Thread Vitaly Kuznetsov
Convert 6+-string comments repeating function names to normal kernel-style comments and fix a couple of other comment style issues. No textual or functional changes intended. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/ring_buffer.c | 135 +-- 1

Re: [PATCH 1/2] Drivers: hv: vmbus: Fix a Host signaling bug

2015-11-19 Thread Vitaly Kuznetsov
"K. Y. Srinivasan" writes: > Currently we have two policies for deciding when to signal the host: > One based on the ring buffer state and the other based on what the > VMBUS client driver wants to do. Consider the case when the client > wants to explicitly control when to signal the host. In thi

[PATCH v2 0/4] Drivers: hv: utils: prevent crash when a utility driver is disabled host side

2015-11-18 Thread Vitaly Kuznetsov
x27;re gonna use it to protect test-and-set operations on 'mode', patch 3 introduces HVUTIL_TRANSPORT_DESTROY mode of operation, patch 4 fixes the issue itself. Patches are rebased on previously sent Olaf's fixes. Vitaly Kuznetsov (4): Drivers: hv: utils: fix memory leak on on_msg(

[PATCH v2 3/4] Drivers: hv: utils: introduce HVUTIL_TRANSPORT_DESTROY mode

2015-11-18 Thread Vitaly Kuznetsov
separate contexts now we need to use a proper locking. Signed-off-by: Vitaly Kuznetsov --- Changes since v1: - Don't re-introduce memory leak in hvt_op_write() [Dan Carpenter] --- drivers/hv/hv_utils_transport.c | 71 - drivers/hv/hv_utils_transport.h |

[PATCH v2 2/4] Drivers: hv: utils: rename outmsg_lock

2015-11-18 Thread Vitaly Kuznetsov
As a preparation to reusing outmsg_lock to protect test-and-set openrations on 'mode' rename it the more general 'lock'. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_utils_transport.c | 14 +++--- drivers/hv/hv_utils_transport.h | 2 +- 2 files changed

[PATCH v2 4/4] Drivers: hv: utils: fix crash when device is removed from host side

2015-11-18 Thread Vitaly Kuznetsov
only way to solve the issue is to defer freeing the hvutil_transport structure. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_utils_transport.c | 26 +++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/hv/hv_utils_transport.c b/drivers/hv

[PATCH v2 1/4] Drivers: hv: utils: fix memory leak on on_msg() failure

2015-11-18 Thread Vitaly Kuznetsov
inmsg should be freed in case of on_msg() failure to avoid memory leak. Preserve the error code from on_msg(). Signed-off-by: Vitaly Kuznetsov --- Changes since v1: - Preserve the error code from on_msg(). [Dan Carpenter] --- drivers/hv/hv_utils_transport.c | 7 --- 1 file changed, 4

Re: [PATCH 1/4] Drivers: hv: utils: fix memory leak on on_msg() failure

2015-11-16 Thread Vitaly Kuznetsov
Dan Carpenter writes: > On Thu, Nov 12, 2015 at 12:32:13PM +0100, Vitaly Kuznetsov wrote: >> @@ -85,10 +86,10 @@ static ssize_t hvt_op_write(struct file *file, const >> char __user *buf, >> return PTR_ERR(inmsg); >> >> if (hvt->on_msg(i

[PATCH 3/4] Drivers: hv: utils: introduce HVUTIL_TRANSPORT_DESTROY mode

2015-11-12 Thread Vitaly Kuznetsov
separate contexts now we need to use a proper locking. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_utils_transport.c | 69 - drivers/hv/hv_utils_transport.h | 1 + 2 files changed, 56 insertions(+), 14 deletions(-) diff --git a/drivers/hv/hv_utils_trans

[PATCH 1/4] Drivers: hv: utils: fix memory leak on on_msg() failure

2015-11-12 Thread Vitaly Kuznetsov
inmsg should be freed in case of on_msg() failure to avoid memory leak. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_utils_transport.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/hv/hv_utils_transport.c b/drivers/hv/hv_utils_transport.c index 24b2766

[PATCH 4/4] Drivers: hv: utils: fix crash when device is removed from host side

2015-11-12 Thread Vitaly Kuznetsov
only way to solve the issue is to defer freeing the hvutil_transport structure. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_utils_transport.c | 26 +++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/hv/hv_utils_transport.c b/drivers/hv

[PATCH 0/4] Drivers: hv: utils: prevent crash when a utility driver is disabled host side

2015-11-12 Thread Vitaly Kuznetsov
he issue itself. Patches are rebased on previously sent Olaf's fixes. Vitaly Kuznetsov (4): Drivers: hv: utils: fix memory leak on on_msg() failure Drivers: hv: utils: rename outmsg_lock Drivers: hv: utils: introduce HVUTIL_TRANSPORT_DESTROY mode Drivers: hv: utils: fix crash when

[PATCH 2/4] Drivers: hv: utils: rename outmsg_lock

2015-11-12 Thread Vitaly Kuznetsov
As a preparation to reusing outmsg_lock to protect test-and-set openrations on 'mode' rename it the more general 'lock'. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_utils_transport.c | 14 +++--- drivers/hv/hv_utils_transport.h | 2 +- 2 files changed

Re: [PATCH V2 10/12] Drivers: hv: vmbus: channge vmbus_connection.channel_lock to mutex

2015-11-12 Thread Vitaly Kuznetsov
"K. Y. Srinivasan" writes: > From: Dexuan Cui > > spinlock is unnecessary here. > mutex is enough. Hm, mutex is usually required when we need to sleep and a spinlock is enough otherwise :-) Or are you trying to say we don't need to disable interrupts here? In that can maybe we can just switch

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 ; net...@vger.kernel.org; jasow...@redhat.com; >> dri

Re: [PATCH] Drivers: hv: vss: run only on supported host versions

2015-10-19 Thread Vitaly Kuznetsov
Olaf Hering writes: > The Backup integration service on WS2012 has appearently trouble to > negotiate with a guest which does not support the provided util version. > Currently the VSS driver supports only version 5/0. A WS2012 offers only > version 1/x and 3/x, and vmbus_prep_negotiate_resp corr

Re: [PATCH 02/10] Drivers: hv: utils: run polling callback always in interrupt context

2015-10-09 Thread Vitaly Kuznetsov
Olaf Hering writes: > On Thu, Oct 08, KY Srinivasan wrote: > >> > yes, but after doing fcopy_respond_to_host(). I'd suggest we leave the >> > check in place, better safe than sorry. >> >> Agreed; Olaf, if it is ok with you, I can fix it up and send. > > I will retest with this part reverted. I t

Re: [PATCH 02/10] Drivers: hv: utils: run polling callback always in interrupt context

2015-10-08 Thread Vitaly Kuznetsov
Olaf Hering writes: > On Thu, Oct 08, Vitaly Kuznetsov wrote: > >> > @@ -295,9 +288,6 @@ static int fcopy_on_msg(void *msg, int len) >> >if (fcopy_transaction.state == HVUTIL_DEVICE_INIT) >> >return fcopy_handle_handshake(*val); >>

Re: [PATCH 02/10] Drivers: hv: utils: run polling callback always in interrupt context

2015-10-08 Thread Vitaly Kuznetsov
"K. Y. Srinivasan" writes: > From: Olaf Hering > > All channel interrupts are bound to specific VCPUs in the guest > at the point channel is created. While currently, we invoke the > polling function on the correct CPU (the CPU to which the channel > is bound to) in some cases we may run the pol

Re: [PATCH 10/10] drivers:hv: Define the channel type for Hyper-V PCI Express pass-through

2015-10-08 Thread Vitaly Kuznetsov
"K. Y. Srinivasan" writes: > From: Jake Oshins > > This defines the channel type for PCI front-ends in Hyper-V VMs. > > Signed-off-by: Jake Oshins > Signed-off-by: K. Y. Srinivasan > --- > drivers/hv/channel_mgmt.c |3 +++ > include/linux/hyperv.h| 11 +++ > 2 files changed,

Re: [PATCH 1/1] drivers/hv: cleanup synic msrs if vmbus connect failed

2015-10-07 Thread Vitaly Kuznetsov
tch does appropriate cleanup in case of vmbus_connect() failure. > > Signed-off-by: Andrey Smetanin > Signed-off-by: Denis V. Lunev > CC: "K. Y. Srinivasan" > CC: Haiyang Zhang > CC: Vitaly Kuznetsov Reviewed-by: Vitaly Kuznetsov > --- > drivers/hv/vmbus_drv.c | 4

Re: [PATCH] x86: guest: rely on leaf 0x40000001 to detect Hyper-V

2015-10-02 Thread Vitaly Kuznetsov
_INTERFACE. > > Change ms_hyperv_platform to actually do what the specification suggests. > This roughy matches what Windows looks for, though Windows actually > ignores HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS completely. > > Signed-off-by: Paolo Bonzini Reviewed-by: Vitaly Kuznetsov

Re: [PATCH 0/3] scsi: Some miscellaneous fixes

2015-09-29 Thread Vitaly Kuznetsov
"K. Y. Srinivasan" writes: [...] > > Vitaly Kuznetsov (2): > scsi_scan: don't dump trace when scsi_prep_async_scan() is called > twice > scsi: introduce short_inquiry flag for broken host adapters James, I'm sorry for the annoyance but when I aske

Re: [PATCH] hyperv: Fix build failure with HYPERVISOR_GUEST=y && KEXEC_CORE=n

2015-09-29 Thread Vitaly Kuznetsov
Ben Hutchings writes: > On Tue, 2015-09-29 at 10:47 +0200, Vitaly Kuznetsov wrote: >> Ben Hutchings writes: >> >> > Currently with this configuration I get: >> > >> > arch/x86/built-in.o: In function `hv_machine_crash_shutdown': >>

Re: [PATCH] hyperv: Fix build failure with HYPERVISOR_GUEST=y && KEXEC_CORE=n

2015-09-29 Thread Vitaly Kuznetsov
kml.org/lkml/2015/9/7/440 ... > > Fixes: b4370df2b1f5 ("Drivers: hv: vmbus: add special crash handler") > Signed-off-by: Ben Hutchings > Cc: Vitaly Kuznetsov > --- > arch/x86/kernel/cpu/mshyperv.c | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) > >

[PATCH v2] storvsc: get rid of bounce buffer

2015-09-23 Thread Vitaly Kuznetsov
) functions. Setting virt_boundary_mask to PAGE_SIZE - 1 guarantees we'll never see such holes so we can significantly simplify the driver. This is also supposed to bring us some performance improvement for certain workloads as we eliminate copying. Reported-by: Radim Krčmář Signed-off-by: Vita

Re: [PATCH] storvsc: get rid of homegrown copy_{to, from}_bounce_buffer()

2015-09-23 Thread Vitaly Kuznetsov
Christoph Hellwig writes: > On Tue, Sep 22, 2015 at 06:27:50PM +0200, Vitaly Kuznetsov wrote: >> Storvsc driver needs to ensure there are no 'holes' in the presented >> sg list (all segments in the middle of the list need to be of PAGE_SIZE). > > I think it sho

[PATCH v3] x86: hyperv: fix build in !CONFIG_KEXEC_CORE case

2015-09-23 Thread Vitaly Kuznetsov
down' Decorate all kexec related code with #ifdef CONFIG_KEXEC_CORE. Reported-by: Jim Davis Reported-by: Stephen Hemminger Signed-off-by: Vitaly Kuznetsov --- Changes since v2: - Hide hv_kexec_handler/hv_crash_handler under IS_ENABLED(CONFIG_HYPERV) to avoid warings in !CONFIG_HYPERV &

[PATCH] storvsc: get rid of homegrown copy_{to,from}_bounce_buffer()

2015-09-22 Thread Vitaly Kuznetsov
e_buffer() functions. Scsi layer already has scsi_sg_copy_{to,from}_buffer() functions to linearize a list, the only difference is that already existent functions create a flat buffer instead of a new list but we can cope. Reported-by: Radim Krčmář Signed-off-by: Vitaly Kuznetsov --- drivers/scsi

[PATCH v2] x86: hyperv: fix build in !CONFIG_KEXEC_CORE case

2015-09-22 Thread Vitaly Kuznetsov
down' Decorate all kexec related code with #ifdef CONFIG_KEXEC_CORE. Reported-by: Jim Davis Reported-by: Stephen Hemminger Signed-off-by: Vitaly Kuznetsov --- Previously I tried solving the issue by defining native_machine_crash_shutdown in !CONFIG_KEXEC_CORE case: https://lkml.org/lkml

Re: [PATCH 2/5] hv: add helpers to handle hv_util device state

2015-09-21 Thread Vitaly Kuznetsov
Olaf Hering writes: > On Mon, Sep 21, Vitaly Kuznetsov wrote: > >> I'd like to see a trace from the hang, it is not obvious to me how it >> happened and what caused it. (or if you have such hang scenario in your >> head, can you please reveal it?) &

Re: [PATCH 2/5] hv: add helpers to handle hv_util device state

2015-09-21 Thread Vitaly Kuznetsov
Olaf Hering writes: > On Sun, Sep 20, Greg KH wrote: > >> Just use a lock, that's what it is there for. > > How would that help? It might help because it enforces ordering. But > that requires that all three utils get refactored to deal with the > introduced locking. I will let KY comment on this

[PATCH] hyper-v: mark TSC as unstable

2015-08-19 Thread Vitaly Kuznetsov
d TSC page. Signed-off-by: Vitaly Kuznetsov --- arch/x86/kernel/cpu/mshyperv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index aad4bd8..6fd023d 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c

Re: [PATCH] scsi: storvsc: be more picky about scmnd->sc_data_direction

2015-08-13 Thread Vitaly Kuznetsov
KY Srinivasan writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Thursday, June 25, 2015 9:12 AM >> To: linux-s...@vger.kernel.org >> Cc: Long Li; KY Srinivasan; Haiyang Zhang; James E.J. Bottomley; >> de.

Re: [PATCH] scsi: storvsc: use shost_for_each_device() instead of open coding

2015-08-13 Thread Vitaly Kuznetsov
Long Li writes: >> -Original Message- >> From: KY Srinivasan >> Sent: Friday, July 03, 2015 11:35 AM >> To: Vitaly Kuznetsov; linux-s...@vger.kernel.org >> Cc: Long Li; Haiyang Zhang; James E.J. Bottomley; >> de...@linuxdriverproject.org; >> l

Re: [PATCH 1/1] X86: mshyperv.c: Fix a compilation issue.

2015-08-10 Thread Vitaly Kuznetsov
KY Srinivasan writes: >> -Original Message- >> From: Greg KH [mailto:gre...@linuxfoundation.org] >> Sent: Thursday, August 6, 2015 2:11 PM >> To: KY Srinivasan >> Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; >> vkuzn...@redhat.com; s...@canb.auug.org.au; t...@linutroni

[PATCH v7 3/3] Drivers: hv: vmbus: use cpu_hotplug_enable/disable

2015-07-23 Thread Vitaly Kuznetsov
Commit e513229b4c38 ("Drivers: hv: vmbus: prevent cpu offlining on newer hypervisors") was altering smp_ops.cpu_disable to prevent CPU offlining. We can bo better by using cpu_hotplug_enable/disable functions instead of such hard-coding. Reported-by: Radim Krčmář Signed-off-by: Vitaly

[PATCH v7 2/3] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable

2015-07-23 Thread Vitaly Kuznetsov
Hyper-V module needs to disable cpu hotplug (offlining) as there is no support from hypervisor side to reassign already opened event channels to a different CPU. Currently it is been done by altering smp_ops.cpu_disable but it is hackish. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Thomas

[PATCH v7 1/3] cpu-hotplug: convert cpu_hotplug_disabled to a counter

2015-07-23 Thread Vitaly Kuznetsov
er in disable_nonboot_cpus() unconditionally as all users of disable_nonboot_cpus() are supposed to do enable_nonboot_cpus() in case an error was returned. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Thomas Gleixner --- Changes since v6: - make this patch first in the series [Thomas Gleixner],

<    2   3   4   5   6   7   8   9   10   >