All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 00/14] hv_netvsc: cleanups
@ 2016-08-23 19:29 sthemmin
  2016-08-23 19:05 ` David Miller
                   ` (14 more replies)
  0 siblings, 15 replies; 17+ messages in thread
From: sthemmin @ 2016-08-23 19:29 UTC (permalink / raw)
  Cc: netdev, Stephen Hemminger

From: Stephen Hemminger <sthemmin@microsoft.com>

Hyper-V network driver cleanups.

The only new functionality is minor extensions to ethtool.

Apologies if this was already sent, still working out the
new email send methodolgy.

Stephen Hemminger (14):
  hv_netvsc: fix rtnl locking in callback
  hv_netvsc: make RSS hash key static
  hv_netvsc: use kcalloc
  hv_netvsc: style cleanups
  hv_netvsc: make inline functions static
  hv_netvsc: use ARRAY_SIZE() for NDIS versions
  hv_netvsc: make device_remove void
  hv_netvsc: init completion during alloc
  hv_netvsc: rearrange start_xmit
  hv_netvsc: refactor completion function
  hv_netvsc: make netvsc_destroy_buf void
  hv_netvsc: make variable local
  hv_netvsc: report vmbus name in ethtool
  hv_netvsc: add ethtool statistics for tx packet issues

 drivers/net/hyperv/hyperv_net.h   |   13 ++-
 drivers/net/hyperv/netvsc.c       |  242 ++++++++++++++++++++++++-------------
 drivers/net/hyperv/netvsc_drv.c   |  194 ++++++++++++++++++------------
 drivers/net/hyperv/rndis_filter.c |   11 +--
 include/linux/hyperv.h            |   91 +-------------
 5 files changed, 297 insertions(+), 254 deletions(-)

-- 
1.7.4.1

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [PATCH 01/14] hv_netvsc: fix rtnl locking in callback
@ 2016-08-23 19:17 sthemmin
  2016-08-23 19:17 ` [PATCH 09/14] hv_netvsc: rearrange start_xmit sthemmin
  0 siblings, 1 reply; 17+ messages in thread
From: sthemmin @ 2016-08-23 19:17 UTC (permalink / raw)
  To: K. Y. Srinivasan, Haiyang Zhang, David Miller; +Cc: netdev, Stephen Hemminger

From: Stephen Hemminger <sthemmin@microsoft.com>

The function get_netvsc_net_device had conditional locking. This was
unnecessary, incorrect, but harmless. It was unnecessary since the
code is only called from netlink netdev event callback where RTNL
is always acquired before the callbacks are run. It was incorrect
because of use of trylock and then continuing.
Fix by replacing with proper assertion.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 drivers/net/hyperv/netvsc_drv.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index eb2c122..6924d01a 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -1167,9 +1167,8 @@ static void netvsc_free_netdev(struct net_device *netdev)
 static struct net_device *get_netvsc_net_device(char *mac)
 {
 	struct net_device *dev, *found = NULL;
-	int rtnl_locked;
 
-	rtnl_locked = rtnl_trylock();
+	ASSERT_RTNL();
 
 	for_each_netdev(&init_net, dev) {
 		if (memcmp(dev->dev_addr, mac, ETH_ALEN) == 0) {
@@ -1179,8 +1178,6 @@ static struct net_device *get_netvsc_net_device(char *mac)
 			break;
 		}
 	}
-	if (rtnl_locked)
-		rtnl_unlock();
 
 	return found;
 }
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2016-08-23 19:05 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-23 19:29 [PATCH net-next 00/14] hv_netvsc: cleanups sthemmin
2016-08-23 19:05 ` David Miller
2016-08-23 19:29 ` [PATCH 01/14] hv_netvsc: fix rtnl locking in callback sthemmin
2016-08-23 19:29 ` [PATCH 02/14] hv_netvsc: make RSS hash key static sthemmin
2016-08-23 19:29 ` [PATCH 03/14] hv_netvsc: use kcalloc sthemmin
2016-08-23 19:29 ` [PATCH 04/14] hv_netvsc: style cleanups sthemmin
2016-08-23 19:29 ` [PATCH 05/14] hv_netvsc: make inline functions static sthemmin
2016-08-23 19:29 ` [PATCH 06/14] hv_netvsc: use ARRAY_SIZE() for NDIS versions sthemmin
2016-08-23 19:29 ` [PATCH 07/14] hv_netvsc: make device_remove void sthemmin
2016-08-23 19:29 ` [PATCH 08/14] hv_netvsc: init completion during alloc sthemmin
2016-08-23 19:29 ` [PATCH 09/14] hv_netvsc: rearrange start_xmit sthemmin
2016-08-23 19:29 ` [PATCH 10/14] hv_netvsc: refactor completion function sthemmin
2016-08-23 19:29 ` [PATCH 11/14] hv_netvsc: make netvsc_destroy_buf void sthemmin
2016-08-23 19:29 ` [PATCH 12/14] hv_netvsc: make variable local sthemmin
2016-08-23 19:29 ` [PATCH 13/14] hv_netvsc: report vmbus name in ethtool sthemmin
2016-08-23 19:29 ` [PATCH 14/14] hv_netvsc: add ethtool statistics for tx packet issues sthemmin
  -- strict thread matches above, loose matches on Subject: below --
2016-08-23 19:17 [PATCH 01/14] hv_netvsc: fix rtnl locking in callback sthemmin
2016-08-23 19:17 ` [PATCH 09/14] hv_netvsc: rearrange start_xmit sthemmin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.