We will not be able to send packets over a channel that has been
rescinded. Make necessary adjustments so we can properly cleanup
even when the channel is rescinded. This issue can be trigerred
in the NIC hot-remove path.
Signed-off-by: K. Y. Srinivasan <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit 73e64fa4f417b22d8d5521999a631ced8e2d442e)
Signed-off-by: Marcelo Henrique Cerri <email address hidden>
The netvsc device supports full duplex by default.
This warnings in log from bonding device which did not like
seeing UNKNOWN duplex.
Signed-off-by: Simon Xiao <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit f3c9d40ee12926f330a1dfebce0bebadd1406ba6)
Signed-off-by: Marcelo Henrique Cerri <email address hidden>
Fix warning from unused set_complete variable. And rearrange code
to eliminate unnecessary goto's.
Signed-off-by: Stephen Hemminger <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit ce12b81061a0a2647ca90c04d131d90edd5c5063)
Signed-off-by: Marcelo Henrique Cerri <email address hidden>
Since there already is a special case goto for control messages (skb == NULL)
in netvsc_send, there is no need for later checks in same code path.
Signed-off-by: Stephen Hemminger <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit ebc1dcf6008e562a8f88a6b1f4a4705f4d4c4fdd)
Signed-off-by: Marcelo Henrique Cerri <email address hidden>
The channel inbound lock was not being used at all by the netvsc
device, but the spin_lock was helpful by providing necessary
barrier before waiting.
Signed-off-by: Stephen Hemminger <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit 00ecfb3b34b69dd702dee1bd6de6fc100be384db)
Signed-off-by: Marcelo Henrique Cerri <email address hidden>
Rather than a lock and variable, use a refcount_t to keep track
of the number of sub channels. Don't need to wait for subchannels
on device removal since wait was already done in device_add.
Also fix the error handling; don't wait forever in case of
an error on request to create sub channels.
Signed-off-by: Stephen Hemminger <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit 43c7bd1ffcd1621c64cedf1be52156e2f95bba9b)
Signed-off-by: Marcelo Henrique Cerri <email address hidden>
Originally in upstream, hyperv_net.h include refcount.h via
linux/kref.h. In order to avoid several backports to kref.h, include
refcount.h locally for hyperv_net.h instead.
It is cleaner to use RCU protected pointer (nvdev_ctx->nvdev)
to indicate device is in removed state, rather than having a separate
boolean flag. By using the pointer the context can be checked
by static checkers and dynamic lockdep.
Signed-off-by: Stephen Hemminger <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit a0be450e19d397e9ff215e32ed31bc51339b460a)
Signed-off-by: Marcelo Henrique Cerri <email address hidden>