<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/net/hyperv, branch v4.8</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.8</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.8'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-08-15T20:48:07Z</updated>
<entry>
<title>hv_netvsc: fix bonding devices check in netvsc_netdev_event()</title>
<updated>2016-08-15T20:48:07Z</updated>
<author>
<name>Vitaly Kuznetsov</name>
<email>vkuznets@redhat.com</email>
</author>
<published>2016-08-15T15:48:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0dbff144a1e7310e2f8b7a957352c4be9aeb38e4'/>
<id>urn:sha1:0dbff144a1e7310e2f8b7a957352c4be9aeb38e4</id>
<content type='text'>
Bonding driver sets IFF_BONDING on both master (the bonding device) and
slave (the real NIC) devices and in netvsc_netdev_event() we want to skip
master devices only. Currently, there is an uncertainty when a slave
interface is removed: if bonding module comes first in netdev_chain it
clears IFF_BONDING flag on the netdev and netvsc_netdev_event() correctly
handles NETDEV_UNREGISTER event, but in case netvsc comes first on the
chain it sees the device with IFF_BONDING still attached and skips it. As
we still hold vf_netdev pointer to the device we crash on the next inject.

Signed-off-by: Vitaly Kuznetsov &lt;vkuznets@redhat.com&gt;
Acked-by: Haiyang Zhang &lt;haiyangz@microsoft.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>hv_netvsc: protect module refcount by checking net_device_ctx-&gt;vf_netdev</title>
<updated>2016-08-15T20:48:07Z</updated>
<author>
<name>Vitaly Kuznetsov</name>
<email>vkuznets@redhat.com</email>
</author>
<published>2016-08-15T15:48:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0f20d795f78d182c4b743d880a5e8dc4d39892fe'/>
<id>urn:sha1:0f20d795f78d182c4b743d880a5e8dc4d39892fe</id>
<content type='text'>
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-by: Vitaly Kuznetsov &lt;vkuznets@redhat.com&gt;
Acked-by: Haiyang Zhang &lt;haiyangz@microsoft.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>hv_netvsc: reset vf_inject on VF removal</title>
<updated>2016-08-15T20:48:07Z</updated>
<author>
<name>Vitaly Kuznetsov</name>
<email>vkuznets@redhat.com</email>
</author>
<published>2016-08-15T15:48:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=57c1826b991244d2144eb6e3d5d1b13a53cbea63'/>
<id>urn:sha1:57c1826b991244d2144eb6e3d5d1b13a53cbea63</id>
<content type='text'>
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.

Signed-off-by: Vitaly Kuznetsov &lt;vkuznets@redhat.com&gt;
Acked-by: Haiyang Zhang &lt;haiyangz@microsoft.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>hv_netvsc: avoid deadlocks between rtnl lock and vf_use_cnt wait</title>
<updated>2016-08-15T20:48:07Z</updated>
<author>
<name>Vitaly Kuznetsov</name>
<email>vkuznets@redhat.com</email>
</author>
<published>2016-08-15T15:48:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d072218f214929194db06069564495b6b9fff34a'/>
<id>urn:sha1:d072218f214929194db06069564495b6b9fff34a</id>
<content type='text'>
Here is a deadlock scenario:
- netvsc_vf_up() schedules netvsc_notify_peers() work and quits.
- netvsc_vf_down() runs before netvsc_notify_peers() gets executed. As it
  is being executed from netdev notifier chain we hold rtnl lock when we
  get here.
- we enter while (atomic_read(&amp;net_device_ctx-&gt;vf_use_cnt) != 0) loop and
  wait till netvsc_notify_peers() drops vf_use_cnt.
- netvsc_notify_peers() starts on some other CPU but netdev_notify_peers()
  will hang on rtnl_lock().
- deadlock!

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 &lt;vkuznets@redhat.com&gt;
Acked-by: Haiyang Zhang &lt;haiyangz@microsoft.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>hv_netvsc: don't lose VF information</title>
<updated>2016-08-15T20:48:07Z</updated>
<author>
<name>Vitaly Kuznetsov</name>
<email>vkuznets@redhat.com</email>
</author>
<published>2016-08-15T15:48:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f9a7da9130ef0143eb900794c7863dc5c9051fbc'/>
<id>urn:sha1:f9a7da9130ef0143eb900794c7863dc5c9051fbc</id>
<content type='text'>
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 &lt;vkuznets@redhat.com&gt;
Acked-by: Haiyang Zhang &lt;haiyangz@microsoft.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>hv_netvsc: Fix VF register on bonding devices</title>
<updated>2016-07-25T18:19:22Z</updated>
<author>
<name>Haiyang Zhang</name>
<email>haiyangz@microsoft.com</email>
</author>
<published>2016-07-23T01:14:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e2b9f1f7af1dfe20df8e68849ebb4bbafed5727a'/>
<id>urn:sha1:e2b9f1f7af1dfe20df8e68849ebb4bbafed5727a</id>
<content type='text'>
Added a condition to avoid bonding devices with same MAC registering
as VF.

Signed-off-by: Haiyang Zhang &lt;haiyangz@microsoft.com&gt;
Reviewed-by: K. Y. Srinivasan &lt;kys@microsoft.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netvsc: Use the new in-place consumption APIs in the rx path</title>
<updated>2016-07-09T03:11:20Z</updated>
<author>
<name>K. Y. Srinivasan</name>
<email>kys@microsoft.com</email>
</author>
<published>2016-07-05T23:52:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=99a50bb11cad44cd1d478256d2388e7afce982ac'/>
<id>urn:sha1:99a50bb11cad44cd1d478256d2388e7afce982ac</id>
<content type='text'>
Use the new APIs for eliminating a copy on the receive path. These new APIs also
help in minimizing the number of memory barriers we end up issuing (in the
ringbuffer code) since we can better control when we want to expose the ring
state to the host.

The patch is being resent to address earlier email issues.

Signed-off-by: K. Y. Srinivasan &lt;kys@microsoft.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netvsc: get rid of completion timeouts</title>
<updated>2016-06-09T18:40:05Z</updated>
<author>
<name>Vitaly Kuznetsov</name>
<email>vkuznets@redhat.com</email>
</author>
<published>2016-06-09T10:44:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5362855aba7159aab8f7c6573eb675d9da317914'/>
<id>urn:sha1:5362855aba7159aab8f7c6573eb675d9da317914</id>
<content type='text'>
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

        net_device-&gt;max_chn = 1;
        net_device-&gt;num_chn = 1;
        net_device-&gt;num_sc_offered = 0;

but after a moment the rndis request succeeds and subchannels start to
appear. netvsc_sc_open() does unconditional nvscdev-&gt;num_sc_offered-- and
it becomes U32_MAX-1. Consequent rndis_filter_device_remove() will hang
while waiting for all U32_MAX-1 subchannels to appear and this is not
going to happen.

The immediate issue could be solved by adding num_sc_offered &gt; 0 check to
netvsc_sc_open() but we're getting out of sync with the host and it's not
easy to adjust things later, e.g. in this particular case we'll be creating
queues without a user request for it and races are expected. Same applies
to other parts of the driver which have the same completion timeout.

Following the trend in drivers/hv/* code I suggest we remove all these
timeouts completely. As a guest we can always trust the host we're running
on and if the host screws things up there is no easy way to recover anyway.

Signed-off-by: Vitaly Kuznetsov &lt;vkuznets@redhat.com&gt;
Acked-by: Haiyang Zhang &lt;haiyangz@microsoft.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>hv_netvsc: pass struct net_device to rndis_filter_set_offload_params()</title>
<updated>2016-06-06T03:16:36Z</updated>
<author>
<name>Vitaly Kuznetsov</name>
<email>vkuznets@redhat.com</email>
</author>
<published>2016-06-03T15:51:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=426d95417eebc0698e878708a8a44980e8b7570d'/>
<id>urn:sha1:426d95417eebc0698e878708a8a44980e8b7570d</id>
<content type='text'>
The only caller rndis_filter_device_add() has 'struct net_device' pointer
already.

Signed-off-by: Vitaly Kuznetsov &lt;vkuznets@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>hv_netvsc: pass struct net_device to rndis_filter_set_device_mac()</title>
<updated>2016-06-06T03:16:36Z</updated>
<author>
<name>Vitaly Kuznetsov</name>
<email>vkuznets@redhat.com</email>
</author>
<published>2016-06-03T15:51:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e834da9a40edd3117ef0a9b2a73d845fe6b622a8'/>
<id>urn:sha1:e834da9a40edd3117ef0a9b2a73d845fe6b622a8</id>
<content type='text'>
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 &lt;vkuznets@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
