@@ -1238,10 +1238,6 @@ static int netvsc_register_vf(struct net_device *vf_netdev)
1238
1238
struct net_device * ndev ;
1239
1239
struct net_device_context * net_device_ctx ;
1240
1240
struct netvsc_device * netvsc_dev ;
1241
- const struct ethtool_ops * eth_ops = vf_netdev -> ethtool_ops ;
1242
-
1243
- if (eth_ops == NULL || eth_ops == & ethtool_ops )
1244
- return NOTIFY_DONE ;
1245
1241
1246
1242
/*
1247
1243
* We will use the MAC address to locate the synthetic interface to
@@ -1286,12 +1282,8 @@ static int netvsc_vf_up(struct net_device *vf_netdev)
1286
1282
{
1287
1283
struct net_device * ndev ;
1288
1284
struct netvsc_device * netvsc_dev ;
1289
- const struct ethtool_ops * eth_ops = vf_netdev -> ethtool_ops ;
1290
1285
struct net_device_context * net_device_ctx ;
1291
1286
1292
- if (eth_ops == & ethtool_ops )
1293
- return NOTIFY_DONE ;
1294
-
1295
1287
ndev = get_netvsc_net_device (vf_netdev -> dev_addr );
1296
1288
if (!ndev )
1297
1289
return NOTIFY_DONE ;
@@ -1329,10 +1321,6 @@ static int netvsc_vf_down(struct net_device *vf_netdev)
1329
1321
struct net_device * ndev ;
1330
1322
struct netvsc_device * netvsc_dev ;
1331
1323
struct net_device_context * net_device_ctx ;
1332
- const struct ethtool_ops * eth_ops = vf_netdev -> ethtool_ops ;
1333
-
1334
- if (eth_ops == & ethtool_ops )
1335
- return NOTIFY_DONE ;
1336
1324
1337
1325
ndev = get_netvsc_net_device (vf_netdev -> dev_addr );
1338
1326
if (!ndev )
@@ -1361,12 +1349,8 @@ static int netvsc_unregister_vf(struct net_device *vf_netdev)
1361
1349
{
1362
1350
struct net_device * ndev ;
1363
1351
struct netvsc_device * netvsc_dev ;
1364
- const struct ethtool_ops * eth_ops = vf_netdev -> ethtool_ops ;
1365
1352
struct net_device_context * net_device_ctx ;
1366
1353
1367
- if (eth_ops == & ethtool_ops )
1368
- return NOTIFY_DONE ;
1369
-
1370
1354
ndev = get_netvsc_net_device (vf_netdev -> dev_addr );
1371
1355
if (!ndev )
1372
1356
return NOTIFY_DONE ;
@@ -1542,13 +1526,21 @@ static int netvsc_netdev_event(struct notifier_block *this,
1542
1526
{
1543
1527
struct net_device * event_dev = netdev_notifier_info_to_dev (ptr );
1544
1528
1529
+ /* Skip our own events */
1530
+ if (event_dev -> netdev_ops == & device_ops )
1531
+ return NOTIFY_DONE ;
1532
+
1533
+ /* Avoid non-Ethernet type devices */
1534
+ if (event_dev -> type != ARPHRD_ETHER )
1535
+ return NOTIFY_DONE ;
1536
+
1545
1537
/* Avoid Vlan dev with same MAC registering as VF */
1546
1538
if (event_dev -> priv_flags & IFF_802_1Q_VLAN )
1547
1539
return NOTIFY_DONE ;
1548
1540
1549
1541
/* Avoid Bonding master dev with same MAC registering as VF */
1550
- if (event_dev -> priv_flags & IFF_BONDING &&
1551
- event_dev -> flags & IFF_MASTER )
1542
+ if (( event_dev -> priv_flags & IFF_BONDING ) &&
1543
+ ( event_dev -> flags & IFF_MASTER ) )
1552
1544
return NOTIFY_DONE ;
1553
1545
1554
1546
switch (event ) {
0 commit comments