<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/net/hyperv, branch v4.7</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.7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-05-16T17:26:01Z</updated>
<entry>
<title>hv_netvsc: set nvdev link after populating chn_table</title>
<updated>2016-05-16T17:26:01Z</updated>
<author>
<name>Vitaly Kuznetsov</name>
<email>vkuznets@redhat.com</email>
</author>
<published>2016-05-13T11:55:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=88098834827025cc04c15f1b4b0d9bbef3cf55af'/>
<id>urn:sha1:88098834827025cc04c15f1b4b0d9bbef3cf55af</id>
<content type='text'>
Crash in netvsc_send() is observed when netvsc device is re-created on
mtu change/set channels. The crash is caused by dereferencing of NULL
channel pointer which comes from chn_table. The root cause is a mixture
of two facts:
- we set nvdev pointer in net_device_context in alloc_net_device()
  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 &lt;vkuznets@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>hv_netvsc: synchronize netvsc_change_mtu()/netvsc_set_channels() with netvsc_remove()</title>
<updated>2016-05-16T17:26:01Z</updated>
<author>
<name>Vitaly Kuznetsov</name>
<email>vkuznets@redhat.com</email>
</author>
<published>2016-05-13T11:55:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6da7225f5a95ba68e3c6225c4051182bef30eed4'/>
<id>urn:sha1:6da7225f5a95ba68e3c6225c4051182bef30eed4</id>
<content type='text'>
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 &lt;vkuznets@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>hv_netvsc: get rid of struct net_device pointer in struct netvsc_device</title>
<updated>2016-05-16T17:26:00Z</updated>
<author>
<name>Vitaly Kuznetsov</name>
<email>vkuznets@redhat.com</email>
</author>
<published>2016-05-13T11:55:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0a1275ca5128b84ffffc149960969ed351ae00eb'/>
<id>urn:sha1:0a1275ca5128b84ffffc149960969ed351ae00eb</id>
<content type='text'>
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 &lt;vkuznets@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>hv_netvsc: untangle the pointer mess</title>
<updated>2016-05-16T17:26:00Z</updated>
<author>
<name>Vitaly Kuznetsov</name>
<email>vkuznets@redhat.com</email>
</author>
<published>2016-05-13T11:55:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3d541ac5a92af708d0085925d136f875f3a58d57'/>
<id>urn:sha1:3d541ac5a92af708d0085925d136f875f3a58d57</id>
<content type='text'>
We have the following structures keeping netvsc adapter state:
- struct net_device
- struct net_device_context
- struct netvsc_device
- struct rndis_device
- struct hv_device
and there are pointers/dependencies between them:
- struct net_device_context is contained in struct net_device
- struct hv_device has driver_data pointer which points to
  'struct net_device' OR 'struct netvsc_device' depending on driver's
  state (!).
- struct net_device_context has a pointer to 'struct hv_device'.
- struct netvsc_device has pointers to 'struct hv_device' and
  'struct net_device_context'.
- struct rndis_device has a pointer to 'struct netvsc_device'.

Different functions get different structures as parameters and use these
pointers for traveling. The problem is (in addition to keeping in mind
this complex graph) that some of these structures (struct netvsc_device
and struct rndis_device) are being removed and re-created on mtu change
(as we implement it as re-creation of hyper-v device) so our travel using
these pointers is dangerous.

Simplify this to a the following:
- add struct netvsc_device pointer to struct net_device_context (which is
  a part of struct net_device and thus never disappears)
- remove struct hv_device and struct net_device_context pointers from
  struct netvsc_device
- replace pointer to 'struct netvsc_device' with pointer to
  'struct net_device'.
- always keep 'struct net_device' in hv_device driver_data.

We'll end up with the following 'circular' structure:

net_device:
 [net_device_context] -&gt; netvsc_device -&gt; rndis_device -&gt; net_device
                      -&gt; hv_device -&gt; net_device

On MTU change we'll be removing the 'netvsc_device -&gt; 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 &lt;vkuznets@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>hv_netvsc: use start_remove flag to protect netvsc_link_change()</title>
<updated>2016-05-16T17:26:00Z</updated>
<author>
<name>Vitaly Kuznetsov</name>
<email>vkuznets@redhat.com</email>
</author>
<published>2016-05-13T11:55:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1bdcec8a5f05445752a0639edd603ac09ae6c553'/>
<id>urn:sha1:1bdcec8a5f05445752a0639edd603ac09ae6c553</id>
<content type='text'>
netvsc_link_change() can race with netvsc_change_mtu() or
netvsc_set_channels() as these functions destroy struct netvsc_device and
rndis filter. Use start_remove flag for syncronization. As
netvsc_change_mtu()/netvsc_set_channels() are called with rtnl lock held
we need to take it before checking start_remove value in
netvsc_link_change().

Reported-by: Haiyang Zhang &lt;haiyangz@microsoft.com&gt;
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: move start_remove flag to net_device_context</title>
<updated>2016-05-16T17:26:00Z</updated>
<author>
<name>Vitaly Kuznetsov</name>
<email>vkuznets@redhat.com</email>
</author>
<published>2016-05-13T11:55:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f580aec4bfd7babe51f086e599400027def08ed8'/>
<id>urn:sha1:f580aec4bfd7babe51f086e599400027def08ed8</id>
<content type='text'>
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 &lt;vkuznets@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>hv_netvsc: Fix the list processing for network change event</title>
<updated>2016-04-25T03:27:58Z</updated>
<author>
<name>Haiyang Zhang</name>
<email>haiyangz@microsoft.com</email>
</author>
<published>2016-04-21T23:13:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=15cfd40771e18a4e9b788c64c9db2606f958b93d'/>
<id>urn:sha1:15cfd40771e18a4e9b788c64c9db2606f958b93d</id>
<content type='text'>
RNDIS_STATUS_NETWORK_CHANGE event is handled as two "half events" --
media disconnect &amp; connect. The second half should be added to the list
head, not to the tail. So all events are processed in normal order.

Signed-off-by: Haiyang Zhang &lt;haiyangz@microsoft.com&gt;
Reviewed-by: K. Y. Srinivasan &lt;kys@microsoft.com&gt;
Reviewed-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: Implement support for VF drivers on Hyper-V</title>
<updated>2016-04-18T18:51:47Z</updated>
<author>
<name>KY Srinivasan</name>
<email>kys@microsoft.com</email>
</author>
<published>2016-04-14T23:31:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=84bf9cefb162b197da20a0f4388929f4b5ba5db4'/>
<id>urn:sha1:84bf9cefb162b197da20a0f4388929f4b5ba5db4</id>
<content type='text'>
Support VF drivers on Hyper-V. On Hyper-V, each VF instance presented to
the guest has an associated synthetic interface that shares the MAC address
with the VF instance. Typically these are bonded together to support
live migration. By default, the host delivers all the incoming packets
on the synthetic interface. Once the VF is up, we need to explicitly switch
the data path on the host to divert traffic onto the VF interface. Even after
switching the data path, broadcast and multicast packets are always delivered
on the synthetic interface and these will have to be injected back onto the
VF interface (if VF is up).
This patch implements the necessary support in netvsc to support Linux
VF drivers.

Signed-off-by: K. Y. Srinivasan &lt;kys@microsoft.com&gt;
Reviewed-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 the order of num_sc_offered decrement</title>
<updated>2016-03-24T01:51:08Z</updated>
<author>
<name>Haiyang Zhang</name>
<email>haiyangz@microsoft.com</email>
</author>
<published>2016-03-23T21:54:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3f735131d9c2523eb54a6c5099fa8c60a4292d48'/>
<id>urn:sha1:3f735131d9c2523eb54a6c5099fa8c60a4292d48</id>
<content type='text'>
Reorder the code in netvsc_sc_open(), so num_sc_offered is only decremented
after vmbus_open() is called. This avoid pontential race of removing device
before all channels are setup.

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>hv_netvsc: Fix the array sizes to be max supported channels</title>
<updated>2016-03-23T18:38:55Z</updated>
<author>
<name>Haiyang Zhang</name>
<email>haiyangz@microsoft.com</email>
</author>
<published>2016-03-23T16:43:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9efc2f7dcd06e04d7b6a3032ae65bfd628b1aebe'/>
<id>urn:sha1:9efc2f7dcd06e04d7b6a3032ae65bfd628b1aebe</id>
<content type='text'>
The VRSS_CHANNEL_MAX is the max number of channels supported by Hyper-V
hosts. We use it for the related array sizes instead of using NR_CPUS,
which may be set to several thousands.
This patch reduces possible memory allocation failures.

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