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

2016-03-29 Thread Vitaly Kuznetsov
"K. Y. Srinivasan" <k...@microsoft.com> writes: > From: Vitaly Kuznetsov <vkuzn...@redhat.com> > > 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 >

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

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

2016-03-22 Thread Vitaly Kuznetsov
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. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.

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

2016-03-22 Thread Vitaly Kuznetsov
KY Srinivasan <k...@microsoft.com> writes: >> -Original Message----- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Monday, March 21, 2016 12:52 AM >> To: KY Srinivasan <k...@microsoft.com> >> Cc: de...@linuxdriverproject.org; linu

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 <k...@microsoft.com> writes: >> -Original Message----- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Monday, March 21, 2016 1:19 AM >> To: KY Srinivasan <k...@microsoft.com> >> Cc: gre...@linuxfoundatio

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

2016-03-22 Thread Vitaly Kuznetsov
KY Srinivasan <k...@microsoft.com> writes: >> -Original Message----- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Monday, March 21, 2016 12:52 AM >> To: KY Srinivasan <k...@microsoft.com> >> Cc: de...@linuxdriverproject.org; linu

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

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

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

2016-03-21 Thread Vitaly Kuznetsov
KY Srinivasan <k...@microsoft.com> 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 &l

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

2016-03-20 Thread Vitaly Kuznetsov
Radim Krcmar <rkrc...@redhat.com> 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() d

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

2016-03-18 Thread Vitaly Kuznetsov
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. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.

[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 <vkuzn...@redhat.com> --- drivers/scsi/storvsc_drv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/st

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

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

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

2016-02-29 Thread Vitaly Kuznetsov
KY Srinivasan <k...@microsoft.com> 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 <k...@microsoft.com>

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

2016-02-18 Thread Vitaly Kuznetsov
ns. Fixes: 3cace4a61610 ("Drivers: hv: utils: run polling callback always in interrupt context") Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/hv_fcopy.c| 1 + drivers/hv/hv_kvp.c | 1 + drivers/hv/hv_snapshot.c | 1 + 3 files changed, 3 insertions(+

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

[PATCH 2/4] Drivers: hv: vmbus: avoid wait_for_completion() on crash

2016-02-12 Thread Vitaly Kuznetsov
com> Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel_mgmt.c | 4 ++-- drivers/hv/connection.c | 2 +- drivers/hv/hyperv_vmbus.h | 2 +- drivers/hv/vmbus_drv.c| 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/hv/channel_mgmt.c

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

[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 <rkrc...@redhat.com> Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel_mgmt.c | 10 +-

[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 <rkrc...@redhat.com> Signed-off-by: Vitaly Kuznetsov

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

2016-02-12 Thread Vitaly Kuznetsov
there. Avoid looping in vmbus_on_msg_dpc(), we're OK with handling one message per interrupt. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/vmbus_drv.c | 68 -- 1 file changed, 33 insertions(+), 35 deletions(-) diff

Re: [PATCH net] hv_netvsc: Restore needed_headroom request

2016-02-10 Thread Vitaly Kuznetsov
Vitaly Kuznetsov <vkuzn...@redhat.com> 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

[PATCH net] hv_netvsc: Restore needed_headroom request

2016-02-05 Thread Vitaly Kuznetsov
ot give us performance penalty. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- 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/ne

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

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

2016-02-03 Thread Vitaly Kuznetsov
Haiyang Zhang <haiya...@microsoft.com> writes: >> -Original Message----- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Wednesday, February 3, 2016 8:06 AM >> To: Haiyang Zhang <haiya...@microsoft.com> >> Cc: da...@davemloft.net; n

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

2016-01-25 Thread Vitaly Kuznetsov
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 <vkuzn.

[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 <vkuzn...@redhat.com> --- drivers/hv/hv.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-)

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

2016-01-18 Thread Vitaly Kuznetsov
ges and use it if we're in an interrupt context. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel_mgmt.c | 44 +++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/chann

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

2016-01-18 Thread Vitaly Kuznetsov
nux, 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 <vkuzn...@redhat.com> --- drivers/hv/channel_mg

[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 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; > + } > + >

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

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

2016-01-05 Thread Vitaly Kuznetsov
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. > > Signed-off-by: Dexuan Cui

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,

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

2015-12-16 Thread Vitaly Kuznetsov
> de...@linuxdriverproject.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 <vkuzn...@red

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

2015-12-15 Thread Vitaly Kuznetsov
linux-ker...@vger.kernel.org; >> 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 <vkuzn

[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 <de...@microsoft.com> Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- - This is a follow-up to the previously sent 'Drivers: hv: util

[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 <vkuzn...@redhat.com> --- drivers/hv/hv_utils_transport.c | 14 +++--- drivers/hv/hv_utils_transport.h | 2 +- 2 files chan

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

2015-12-14 Thread Vitaly Kuznetsov
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 Kuznetsov (4): Drivers: hv: utils: fix memory leak

[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 <vkuzn...@redhat.com> --- Changes since v1: - Preserve the error code from on_msg(). [Dan Carpenter] --- drivers/hv/hv_utils_transport.c | 7

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

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

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

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

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

2015-12-11 Thread Vitaly Kuznetsov
wo pathes completely: let rndis_filter_send_request() call netvsc_send_pkt() 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 <vkuzn..

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

2015-12-11 Thread Vitaly Kuznetsov
Vitaly Kuznetsov <vkuzn...@redhat.com> writes: > Haiyang Zhang <haiya...@microsoft.com> 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

[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 <vkuzn...@redhat.com> --- drivers/hv/ring_buffer.c

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

2015-12-08 Thread Vitaly Kuznetsov
the 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 <vkuzn...@redhat.com> --- drivers/hv/channel.c

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

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

2015-12-08 Thread Vitaly Kuznetsov
ase 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 <vkuzn...@redhat.com> --- drivers/hv/channel.c | 65 ++-- 1 file changed, 22 insertio

[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 <vkuzn...@redhat.com> --- include/linux/hyperv.h | 2 -- 1 file chan

[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

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

2015-11-27 Thread Vitaly Kuznetsov
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 <vk

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

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

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

[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 <vkuzn...@redhat.com> --- drivers/hv/ring_buffer.c

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

[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 <vkuzn...@redhat.com> --- drivers/hv/hv_utils_transport.c | 14 +++--- drivers/hv/hv_utils_transport.h | 2 +- 2 files chan

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

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

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

2015-11-18 Thread Vitaly Kuznetsov
-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() failure Drivers: hv: utils: rename outmsg_lock

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

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

[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 <vkuzn...@redhat.com> --- Changes since v1: - Preserve the error code from on_msg(). [Dan Carpenter] --- drivers/hv/hv_utils_transport.c | 7

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

2015-11-16 Thread Vitaly Kuznetsov
Dan Carpenter <dan.carpen...@oracle.com> 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); >> >

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

2015-11-12 Thread Vitaly Kuznetsov
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 device is removed from host side drivers/hv

[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 <vkuzn...@redhat.com> --- drivers/hv/hv_utils_transport.c | 14 +++--- drivers/hv/hv_utils_transport.h | 2 +- 2 files chan

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

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

[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 <vkuzn...@redhat.com> --- drivers/hv/hv_utils_transport.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/hv/hv_utils_transport.c b/driv

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

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

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

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

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

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

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

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

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

2015-10-08 Thread Vitaly Kuznetsov
Olaf Hering <o...@aepfle.de> 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) >> >

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

2015-10-07 Thread Vitaly Kuznetsov
free them anyway)? > > This patch does appropriate cleanup in case of vmbus_connect() failure. > > Signed-off-by: Andrey Smetanin <asmeta...@virtuozzo.com> > Signed-off-by: Denis V. Lunev <d...@openvz.org> > CC: "K. Y. Srinivasan" <k...@microsoft.co

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

2015-10-02 Thread Vitaly Kuznetsov
et in eax > when querying the HYPERV_CPUID_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 Bonz

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

2015-09-29 Thread Vitaly Kuznetsov
"K. Y. Srinivasan" <k...@microsoft.com> 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 a

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

2015-09-29 Thread Vitaly Kuznetsov
15/9/23/183 ... https://lkml.org/lkml/2015/9/7/440 ... > > Fixes: b4370df2b1f5 ("Drivers: hv: vmbus: add special crash handler") > Signed-off-by: Ben Hutchings <b...@decadent.org.uk> > Cc: Vitaly Kuznetsov <vkuzn...@redhat.com> > --- > arch/x86/kernel/cpu/mshyper

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

2015-09-29 Thread Vitaly Kuznetsov
Ben Hutchings <b...@decadent.org.uk> writes: > On Tue, 2015-09-29 at 10:47 +0200, Vitaly Kuznetsov wrote: >> Ben Hutchings <b...@decadent.org.uk> writes: >> >> > Currently with this configuration I get: >> > >> > arch/x86/built-in.o: In

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

2015-09-23 Thread Vitaly Kuznetsov
Decorate all kexec related code with #ifdef CONFIG_KEXEC_CORE. Reported-by: Jim Davis <jim.ep...@gmail.com> Reported-by: Stephen Hemminger <step...@networkplumber.org> Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- Changes since v2: - Hide hv_kexec_handler/hv_cr

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

2015-09-23 Thread Vitaly Kuznetsov
Christoph Hellwig <h...@infradead.org> 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

[PATCH v2] storvsc: get rid of bounce buffer

2015-09-23 Thread Vitaly Kuznetsov
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ář <rkrc...@redhat.com> Signed-off-by:

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

2015-09-22 Thread Vitaly Kuznetsov
. 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ář <rkrc...@redhat.com> Signed-off-by: Vitaly Kuznetsov <vkuzn...@r

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

2015-09-22 Thread Vitaly Kuznetsov
Decorate all kexec related code with #ifdef CONFIG_KEXEC_CORE. Reported-by: Jim Davis <jim.ep...@gmail.com> Reported-by: Stephen Hemminger <step...@networkplumber.org> Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- Previously I tried solving the issue by defining n

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

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

2015-09-21 Thread Vitaly Kuznetsov
Olaf Hering <o...@aepfle.de> 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?)

[PATCH] hyper-v: mark TSC as unstable

2015-08-19 Thread Vitaly Kuznetsov
. Signed-off-by: Vitaly Kuznetsov vkuzn...@redhat.com --- 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

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

2015-08-13 Thread Vitaly Kuznetsov
KY Srinivasan k...@microsoft.com 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...@linuxdriverproject.org; linux

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

2015-08-13 Thread Vitaly Kuznetsov
Long Li lon...@microsoft.com 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; linux-ker...@vger.kernel.org Subject

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

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

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

2015-07-23 Thread Vitaly Kuznetsov
-by: Vitaly Kuznetsov vkuzn...@redhat.com Signed-off-by: K. Y. Srinivasan k...@microsoft.com --- drivers/hv/vmbus_drv.c | 38 -- 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index cf20400..6de65fb 100644

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

2015-07-23 Thread Vitaly Kuznetsov
() 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 vkuzn...@redhat.com Reviewed-by: Thomas Gleixner t...@linutronix.de --- Changes since v6: - make this patch first in the series [Thomas Gleixner

[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 vkuzn...@redhat.com

[PATCH v7 0/3] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention

2015-07-23 Thread Vitaly Kuznetsov
] Changes since v1: - Make cpu_hotplug_disabled a counter [Radim Krčmář] Export cpu_hotplug_enable/cpu_hotplug_disable functions from cpu.c and use them instead of altering smp_ops.cpu_disable in Hyper-V vmbus module. Vitaly Kuznetsov (3): cpu-hotplug: convert cpu_hotplug_disabled to a counter cpu

Re: [PATCH V3 3/7] Drivers: hv: vmbus: add APIs to send/recv hvsock packet and get the r/w-ability

2015-07-21 Thread Vitaly Kuznetsov
Dexuan Cui de...@microsoft.com writes: This will be used by the coming net/hvsock driver. Signed-off-by: Dexuan Cui de...@microsoft.com --- drivers/hv/channel.c | 133 ++ drivers/hv/hyperv_vmbus.h | 4 ++ drivers/hv/ring_buffer.c | 14

Re: [PATCH net-next 1/1] hv_netvsc: Wait for sub-channels to be processed during probe

2015-07-17 Thread Vitaly Kuznetsov
K. Y. Srinivasan k...@microsoft.com writes: The current code returns from probe without waiting for the proper handling of subchannels that may be requested. If the netvsc driver were to be rapidly loaded/unloaded, we can trigger a panic as the unload will be tearing down state that may not

Re: [PATCH net-next 1/1] hv_netvsc: Wait for sub-channels to be processed during probe

2015-07-17 Thread Vitaly Kuznetsov
KY Srinivasan k...@microsoft.com writes: -Original Message- From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] Sent: Friday, July 17, 2015 7:13 AM To: KY Srinivasan Cc: da...@davemloft.net; net...@vger.kernel.org; linux- ker...@vger.kernel.org; de...@linuxdriverproject.org; o

Re: [PATCH] Drivers: hv: vmbus: prevent new subchannel creation on device shutdown

2015-07-14 Thread Vitaly Kuznetsov
Dexuan Cui de...@microsoft.com writes: -Original Message- From: Vitaly Kuznetsov Sent: Monday, July 13, 2015 20:19 Subject: [PATCH] Drivers: hv: vmbus: prevent new subchannel creation on device shutdown When a new subchannel offer from host comes during device shutdown (e.g

<    2   3   4   5   6   7   8   9   10   >