Skip to contentSkip to conversation

netvsc: fix RCU warning in get_stats

PATCH In review Stephen Hemminger 2 participants 3 messages Apr 14, 2017 – Apr 17, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 netvsc: fix RCU warning in get_stats

The statistics functionis called with RTNL held during probe but with RCU held during access from /proc and elsewhere. This is safe so update the lockdep annotation.

---
 drivers/net/hyperv/netvsc_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/hyperv/netvsc_drv.c +1 -1
index f24c2891dd0c..76489a06ef3b 100644
@@ -897,7 +897,7 @@ static void netvsc_get_stats64(struct net_device *net,
 			       struct rtnl_link_stats64 *t)
 {
 	struct net_device_context *ndev_ctx = netdev_priv(net);
-	struct netvsc_device *nvdev = rcu_dereference(ndev_ctx->nvdev);
+	struct netvsc_device *nvdev = rcu_dereference_rtnl(ndev_ctx->nvdev);
 	int i;
 
 	if (!nvdev)
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/2 hv_netvsc: change netvsc device default duplex to FULL

From: Simon Xiao <[email protected]>

The netvsc device supports full duplex by default. This warnings in log from bonding device which did not like seeing UNKNOWN duplex.

---
 drivers/net/hyperv/netvsc_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/hyperv/netvsc_drv.c +1 -1
index 76489a06ef3b..fad5a57765b9 100644
@@ -815,7 +815,7 @@ static void netvsc_init_settings(struct net_device *dev)
 	struct net_device_context *ndc = netdev_priv(dev);
 
 	ndc->speed = SPEED_UNKNOWN;
-	ndc->duplex = DUPLEX_UNKNOWN;
+	ndc->duplex = DUPLEX_FULL;
 }
 
 static int netvsc_get_link_ksettings(struct net_device *dev,
Signature · 1 line
2.11.0