@@ -56,37 +56,12 @@ static int debug = -1;
56
56
module_param (debug , int , S_IRUGO );
57
57
MODULE_PARM_DESC (debug , "Debug level (0=none,...,16=all)" );
58
58
59
- static void do_set_multicast (struct work_struct * w )
60
- {
61
- struct net_device_context * ndevctx =
62
- container_of (w , struct net_device_context , work );
63
- struct hv_device * device_obj = ndevctx -> device_ctx ;
64
- struct net_device * ndev = hv_get_drvdata (device_obj );
65
- struct netvsc_device * nvdev = rcu_dereference (ndevctx -> nvdev );
66
- struct rndis_device * rdev ;
67
-
68
- if (!nvdev )
69
- return ;
70
-
71
- rdev = nvdev -> extension ;
72
- if (rdev == NULL )
73
- return ;
74
-
75
- if (ndev -> flags & IFF_PROMISC )
76
- rndis_filter_set_packet_filter (rdev ,
77
- NDIS_PACKET_TYPE_PROMISCUOUS );
78
- else
79
- rndis_filter_set_packet_filter (rdev ,
80
- NDIS_PACKET_TYPE_BROADCAST |
81
- NDIS_PACKET_TYPE_ALL_MULTICAST |
82
- NDIS_PACKET_TYPE_DIRECTED );
83
- }
84
-
85
59
static void netvsc_set_multicast_list (struct net_device * net )
86
60
{
87
61
struct net_device_context * net_device_ctx = netdev_priv (net );
62
+ struct netvsc_device * nvdev = rtnl_dereference (net_device_ctx -> nvdev );
88
63
89
- schedule_work ( & net_device_ctx -> work );
64
+ rndis_filter_update ( nvdev );
90
65
}
91
66
92
67
static int netvsc_open (struct net_device * net )
@@ -123,8 +98,6 @@ static int netvsc_close(struct net_device *net)
123
98
124
99
netif_tx_disable (net );
125
100
126
- /* Make sure netvsc_set_multicast_list doesn't re-enable filter! */
127
- cancel_work_sync (& net_device_ctx -> work );
128
101
ret = rndis_filter_close (nvdev );
129
102
if (ret != 0 ) {
130
103
netdev_err (net , "unable to close device (ret %d).\n" , ret );
@@ -1028,7 +1001,7 @@ static const struct {
1028
1001
static int netvsc_get_sset_count (struct net_device * dev , int string_set )
1029
1002
{
1030
1003
struct net_device_context * ndc = netdev_priv (dev );
1031
- struct netvsc_device * nvdev = rcu_dereference (ndc -> nvdev );
1004
+ struct netvsc_device * nvdev = rtnl_dereference (ndc -> nvdev );
1032
1005
1033
1006
if (!nvdev )
1034
1007
return - ENODEV ;
@@ -1158,11 +1131,22 @@ netvsc_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info,
1158
1131
}
1159
1132
1160
1133
#ifdef CONFIG_NET_POLL_CONTROLLER
1161
- static void netvsc_poll_controller (struct net_device * net )
1134
+ static void netvsc_poll_controller (struct net_device * dev )
1162
1135
{
1163
- /* As netvsc_start_xmit() works synchronous we don't have to
1164
- * trigger anything here.
1165
- */
1136
+ struct net_device_context * ndc = netdev_priv (dev );
1137
+ struct netvsc_device * ndev ;
1138
+ int i ;
1139
+
1140
+ rcu_read_lock ();
1141
+ ndev = rcu_dereference (ndc -> nvdev );
1142
+ if (ndev ) {
1143
+ for (i = 0 ; i < ndev -> num_chn ; i ++ ) {
1144
+ struct netvsc_channel * nvchan = & ndev -> chan_table [i ];
1145
+
1146
+ napi_schedule (& nvchan -> napi );
1147
+ }
1148
+ }
1149
+ rcu_read_unlock ();
1166
1150
}
1167
1151
#endif
1168
1152
@@ -1552,7 +1536,6 @@ static int netvsc_probe(struct hv_device *dev,
1552
1536
hv_set_drvdata (dev , net );
1553
1537
1554
1538
INIT_DELAYED_WORK (& net_device_ctx -> dwork , netvsc_link_change );
1555
- INIT_WORK (& net_device_ctx -> work , do_set_multicast );
1556
1539
1557
1540
spin_lock_init (& net_device_ctx -> lock );
1558
1541
INIT_LIST_HEAD (& net_device_ctx -> reconfig_events );
@@ -1622,7 +1605,6 @@ static int netvsc_remove(struct hv_device *dev)
1622
1605
netif_device_detach (net );
1623
1606
1624
1607
cancel_delayed_work_sync (& ndev_ctx -> dwork );
1625
- cancel_work_sync (& ndev_ctx -> work );
1626
1608
1627
1609
/*
1628
1610
* Call to the vsc driver to let it know that the device is being
0 commit comments