aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/broadcom/bnx2.c2
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c3
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c3
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c2
-rw-r--r--drivers/net/ethernet/cisco/enic/enic_main.c3
-rw-r--r--drivers/net/ethernet/intel/e1000/e1000_main.c2
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c3
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c3
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c3
-rw-r--r--drivers/net/ethernet/marvell/mv643xx_eth.c2
-rw-r--r--drivers/net/ethernet/octeon/octeon_mgmt.c3
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c13
-rw-r--r--drivers/net/ethernet/sun/niu.c5
-rw-r--r--drivers/net/virtio_net.c1
-rw-r--r--include/linux/if.h1
-rw-r--r--include/linux/netdevice.h2
-rw-r--r--net/core/dev.c12
17 files changed, 51 insertions, 12 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c
index 4b2b57018a02..4a9a8c8184d8 100644
--- a/drivers/net/ethernet/broadcom/bnx2.c
+++ b/drivers/net/ethernet/broadcom/bnx2.c
@@ -36,6 +36,7 @@
36#include <linux/time.h> 36#include <linux/time.h>
37#include <linux/ethtool.h> 37#include <linux/ethtool.h>
38#include <linux/mii.h> 38#include <linux/mii.h>
39#include <linux/if.h>
39#include <linux/if_vlan.h> 40#include <linux/if_vlan.h>
40#include <net/ip.h> 41#include <net/ip.h>
41#include <net/tcp.h> 42#include <net/tcp.h>
@@ -8370,6 +8371,7 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
8370 dev->vlan_features = dev->hw_features; 8371 dev->vlan_features = dev->hw_features;
8371 dev->hw_features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; 8372 dev->hw_features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
8372 dev->features |= dev->hw_features; 8373 dev->features |= dev->hw_features;
8374 dev->priv_flags |= IFF_UNICAST_FLT;
8373 8375
8374 if ((rc = register_netdev(dev))) { 8376 if ((rc = register_netdev(dev))) {
8375 dev_err(&pdev->dev, "Cannot register net device\n"); 8377 dev_err(&pdev->dev, "Cannot register net device\n");
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index f90e3fa61ac2..f4ab90c20891 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -39,6 +39,7 @@
39#include <linux/time.h> 39#include <linux/time.h>
40#include <linux/ethtool.h> 40#include <linux/ethtool.h>
41#include <linux/mii.h> 41#include <linux/mii.h>
42#include <linux/if.h>
42#include <linux/if_vlan.h> 43#include <linux/if_vlan.h>
43#include <net/ip.h> 44#include <net/ip.h>
44#include <net/ipv6.h> 45#include <net/ipv6.h>
@@ -10266,6 +10267,8 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev,
10266 dev->netdev_ops = &bnx2x_netdev_ops; 10267 dev->netdev_ops = &bnx2x_netdev_ops;
10267 bnx2x_set_ethtool_ops(dev); 10268 bnx2x_set_ethtool_ops(dev);
10268 10269
10270 dev->priv_flags |= IFF_UNICAST_FLT;
10271
10269 dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 10272 dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
10270 NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 | 10273 NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 |
10271 NETIF_F_RXCSUM | NETIF_F_LRO | NETIF_F_HW_VLAN_TX; 10274 NETIF_F_RXCSUM | NETIF_F_LRO | NETIF_F_HW_VLAN_TX;
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index c9957b7f17b5..90b4921cac9b 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -41,6 +41,7 @@
41#include <linux/err.h> 41#include <linux/err.h>
42#include <linux/etherdevice.h> 42#include <linux/etherdevice.h>
43#include <linux/firmware.h> 43#include <linux/firmware.h>
44#include <linux/if.h>
44#include <linux/if_vlan.h> 45#include <linux/if_vlan.h>
45#include <linux/init.h> 46#include <linux/init.h>
46#include <linux/log2.h> 47#include <linux/log2.h>
@@ -3639,6 +3640,8 @@ static int __devinit init_one(struct pci_dev *pdev,
3639 netdev->features |= netdev->hw_features | highdma; 3640 netdev->features |= netdev->hw_features | highdma;
3640 netdev->vlan_features = netdev->features & VLAN_FEAT; 3641 netdev->vlan_features = netdev->features & VLAN_FEAT;
3641 3642
3643 netdev->priv_flags |= IFF_UNICAST_FLT;
3644
3642 netdev->netdev_ops = &cxgb4_netdev_ops; 3645 netdev->netdev_ops = &cxgb4_netdev_ops;
3643 SET_ETHTOOL_OPS(netdev, &cxgb_ethtool_ops); 3646 SET_ETHTOOL_OPS(netdev, &cxgb_ethtool_ops);
3644 } 3647 }
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
index ec799139dfe2..da9072bfca8b 100644
--- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
@@ -2625,6 +2625,8 @@ static int __devinit cxgb4vf_pci_probe(struct pci_dev *pdev,
2625 if (pci_using_dac) 2625 if (pci_using_dac)
2626 netdev->features |= NETIF_F_HIGHDMA; 2626 netdev->features |= NETIF_F_HIGHDMA;
2627 2627
2628 netdev->priv_flags |= IFF_UNICAST_FLT;
2629
2628 netdev->netdev_ops = &cxgb4vf_netdev_ops; 2630 netdev->netdev_ops = &cxgb4vf_netdev_ops;
2629 SET_ETHTOOL_OPS(netdev, &cxgb4vf_ethtool_ops); 2631 SET_ETHTOOL_OPS(netdev, &cxgb4vf_ethtool_ops);
2630 2632
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index 67a27cd304dd..f342be0c51aa 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -28,6 +28,7 @@
28#include <linux/pci.h> 28#include <linux/pci.h>
29#include <linux/netdevice.h> 29#include <linux/netdevice.h>
30#include <linux/etherdevice.h> 30#include <linux/etherdevice.h>
31#include <linux/if.h>
31#include <linux/if_ether.h> 32#include <linux/if_ether.h>
32#include <linux/if_vlan.h> 33#include <linux/if_vlan.h>
33#include <linux/ethtool.h> 34#include <linux/ethtool.h>
@@ -2442,6 +2443,8 @@ static int __devinit enic_probe(struct pci_dev *pdev,
2442 if (using_dac) 2443 if (using_dac)
2443 netdev->features |= NETIF_F_HIGHDMA; 2444 netdev->features |= NETIF_F_HIGHDMA;
2444 2445
2446 netdev->priv_flags |= IFF_UNICAST_FLT;
2447
2445 err = register_netdev(netdev); 2448 err = register_netdev(netdev);
2446 if (err) { 2449 if (err) {
2447 dev_err(dev, "Cannot register net device, aborting\n"); 2450 dev_err(dev, "Cannot register net device, aborting\n");
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index f97afda941d7..7c280e5832b2 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -1080,6 +1080,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
1080 netdev->vlan_features |= NETIF_F_HW_CSUM; 1080 netdev->vlan_features |= NETIF_F_HW_CSUM;
1081 netdev->vlan_features |= NETIF_F_SG; 1081 netdev->vlan_features |= NETIF_F_SG;
1082 1082
1083 netdev->priv_flags |= IFF_UNICAST_FLT;
1084
1083 adapter->en_mng_pt = e1000_enable_mng_pass_thru(hw); 1085 adapter->en_mng_pt = e1000_enable_mng_pass_thru(hw);
1084 1086
1085 /* initialize eeprom parameters */ 1087 /* initialize eeprom parameters */
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 40d4c405fd7e..592b5c1827bc 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -39,6 +39,7 @@
39#include <linux/net_tstamp.h> 39#include <linux/net_tstamp.h>
40#include <linux/mii.h> 40#include <linux/mii.h>
41#include <linux/ethtool.h> 41#include <linux/ethtool.h>
42#include <linux/if.h>
42#include <linux/if_vlan.h> 43#include <linux/if_vlan.h>
43#include <linux/pci.h> 44#include <linux/pci.h>
44#include <linux/pci-aspm.h> 45#include <linux/pci-aspm.h>
@@ -1973,6 +1974,8 @@ static int __devinit igb_probe(struct pci_dev *pdev,
1973 netdev->features |= NETIF_F_SCTP_CSUM; 1974 netdev->features |= NETIF_F_SCTP_CSUM;
1974 } 1975 }
1975 1976
1977 netdev->priv_flags |= IFF_UNICAST_FLT;
1978
1976 adapter->en_mng_pt = igb_enable_mng_pass_thru(hw); 1979 adapter->en_mng_pt = igb_enable_mng_pass_thru(hw);
1977 1980
1978 /* before reading the NVM, reset the controller to put the device in a 1981 /* before reading the NVM, reset the controller to put the device in a
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index e86297b32733..8c70273b01bc 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -42,6 +42,7 @@
42#include <net/checksum.h> 42#include <net/checksum.h>
43#include <net/ip6_checksum.h> 43#include <net/ip6_checksum.h>
44#include <linux/ethtool.h> 44#include <linux/ethtool.h>
45#include <linux/if.h>
45#include <linux/if_vlan.h> 46#include <linux/if_vlan.h>
46#include <linux/prefetch.h> 47#include <linux/prefetch.h>
47#include <scsi/fc/fc_fcoe.h> 48#include <scsi/fc/fc_fcoe.h>
@@ -7527,6 +7528,8 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
7527 netdev->vlan_features |= NETIF_F_IPV6_CSUM; 7528 netdev->vlan_features |= NETIF_F_IPV6_CSUM;
7528 netdev->vlan_features |= NETIF_F_SG; 7529 netdev->vlan_features |= NETIF_F_SG;
7529 7530
7531 netdev->priv_flags |= IFF_UNICAST_FLT;
7532
7530 if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) 7533 if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED)
7531 adapter->flags &= ~(IXGBE_FLAG_RSS_ENABLED | 7534 adapter->flags &= ~(IXGBE_FLAG_RSS_ENABLED |
7532 IXGBE_FLAG_DCB_ENABLED); 7535 IXGBE_FLAG_DCB_ENABLED);
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 3b880a27f8d1..45b007827024 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -44,6 +44,7 @@
44#include <net/checksum.h> 44#include <net/checksum.h>
45#include <net/ip6_checksum.h> 45#include <net/ip6_checksum.h>
46#include <linux/ethtool.h> 46#include <linux/ethtool.h>
47#include <linux/if.h>
47#include <linux/if_vlan.h> 48#include <linux/if_vlan.h>
48#include <linux/prefetch.h> 49#include <linux/prefetch.h>
49 50
@@ -3358,6 +3359,8 @@ static int __devinit ixgbevf_probe(struct pci_dev *pdev,
3358 if (pci_using_dac) 3359 if (pci_using_dac)
3359 netdev->features |= NETIF_F_HIGHDMA; 3360 netdev->features |= NETIF_F_HIGHDMA;
3360 3361
3362 netdev->priv_flags |= IFF_UNICAST_FLT;
3363
3361 /* The HW MAC address was set and/or determined in sw_init */ 3364 /* The HW MAC address was set and/or determined in sw_init */
3362 memcpy(netdev->dev_addr, adapter->hw.mac.addr, netdev->addr_len); 3365 memcpy(netdev->dev_addr, adapter->hw.mac.addr, netdev->addr_len);
3363 memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len); 3366 memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len);
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 259699983ca5..1e2c9f072bfd 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -2923,6 +2923,8 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
2923 dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_RXCSUM; 2923 dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_RXCSUM;
2924 dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM; 2924 dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM;
2925 2925
2926 dev->priv_flags |= IFF_UNICAST_FLT;
2927
2926 SET_NETDEV_DEV(dev, &pdev->dev); 2928 SET_NETDEV_DEV(dev, &pdev->dev);
2927 2929
2928 if (mp->shared->win_protect) 2930 if (mp->shared->win_protect)
diff --git a/drivers/net/ethernet/octeon/octeon_mgmt.c b/drivers/net/ethernet/octeon/octeon_mgmt.c
index 429e08c84e9b..d6f96e50e2f4 100644
--- a/drivers/net/ethernet/octeon/octeon_mgmt.c
+++ b/drivers/net/ethernet/octeon/octeon_mgmt.c
@@ -13,6 +13,7 @@
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/netdevice.h> 14#include <linux/netdevice.h>
15#include <linux/etherdevice.h> 15#include <linux/etherdevice.h>
16#include <linux/if.h>
16#include <linux/if_vlan.h> 17#include <linux/if_vlan.h>
17#include <linux/slab.h> 18#include <linux/slab.h>
18#include <linux/phy.h> 19#include <linux/phy.h>
@@ -1102,6 +1103,8 @@ static int __devinit octeon_mgmt_probe(struct platform_device *pdev)
1102 tasklet_init(&p->tx_clean_tasklet, 1103 tasklet_init(&p->tx_clean_tasklet,
1103 octeon_mgmt_clean_tx_tasklet, (unsigned long)p); 1104 octeon_mgmt_clean_tx_tasklet, (unsigned long)p);
1104 1105
1106 netdev->priv_flags |= IFF_UNICAST_FLT;
1107
1105 netdev->netdev_ops = &octeon_mgmt_ops; 1108 netdev->netdev_ops = &octeon_mgmt_ops;
1106 netdev->ethtool_ops = &octeon_mgmt_ethtool_ops; 1109 netdev->ethtool_ops = &octeon_mgmt_ethtool_ops;
1107 1110
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index c6e567e04eff..68fb5b0593a0 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -42,6 +42,7 @@
42#include <linux/crc32.h> 42#include <linux/crc32.h>
43#include <linux/mii.h> 43#include <linux/mii.h>
44#include <linux/phy.h> 44#include <linux/phy.h>
45#include <linux/if.h>
45#include <linux/if_vlan.h> 46#include <linux/if_vlan.h>
46#include <linux/dma-mapping.h> 47#include <linux/dma-mapping.h>
47#include <linux/slab.h> 48#include <linux/slab.h>
@@ -1284,7 +1285,7 @@ static int stmmac_config(struct net_device *dev, struct ifmap *map)
1284} 1285}
1285 1286
1286/** 1287/**
1287 * stmmac_multicast_list - entry point for multicast addressing 1288 * stmmac_set_rx_mode - entry point for multicast addressing
1288 * @dev : pointer to the device structure 1289 * @dev : pointer to the device structure
1289 * Description: 1290 * Description:
1290 * This function is a driver entry point which gets called by the kernel 1291 * This function is a driver entry point which gets called by the kernel
@@ -1292,7 +1293,7 @@ static int stmmac_config(struct net_device *dev, struct ifmap *map)
1292 * Return value: 1293 * Return value:
1293 * void. 1294 * void.
1294 */ 1295 */
1295static void stmmac_multicast_list(struct net_device *dev) 1296static void stmmac_set_rx_mode(struct net_device *dev)
1296{ 1297{
1297 struct stmmac_priv *priv = netdev_priv(dev); 1298 struct stmmac_priv *priv = netdev_priv(dev);
1298 1299
@@ -1421,7 +1422,7 @@ static const struct net_device_ops stmmac_netdev_ops = {
1421 .ndo_stop = stmmac_release, 1422 .ndo_stop = stmmac_release,
1422 .ndo_change_mtu = stmmac_change_mtu, 1423 .ndo_change_mtu = stmmac_change_mtu,
1423 .ndo_fix_features = stmmac_fix_features, 1424 .ndo_fix_features = stmmac_fix_features,
1424 .ndo_set_multicast_list = stmmac_multicast_list, 1425 .ndo_set_rx_mode = stmmac_set_rx_mode,
1425 .ndo_tx_timeout = stmmac_tx_timeout, 1426 .ndo_tx_timeout = stmmac_tx_timeout,
1426 .ndo_do_ioctl = stmmac_ioctl, 1427 .ndo_do_ioctl = stmmac_ioctl,
1427 .ndo_set_config = stmmac_config, 1428 .ndo_set_config = stmmac_config,
@@ -1498,10 +1499,12 @@ static int stmmac_mac_device_setup(struct net_device *dev)
1498 1499
1499 struct mac_device_info *device; 1500 struct mac_device_info *device;
1500 1501
1501 if (priv->plat->has_gmac) 1502 if (priv->plat->has_gmac) {
1503 dev->priv_flags |= IFF_UNICAST_FLT;
1502 device = dwmac1000_setup(priv->ioaddr); 1504 device = dwmac1000_setup(priv->ioaddr);
1503 else 1505 } else {
1504 device = dwmac100_setup(priv->ioaddr); 1506 device = dwmac100_setup(priv->ioaddr);
1507 }
1505 1508
1506 if (!device) 1509 if (!device)
1507 return -ENOMEM; 1510 return -ENOMEM;
diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
index ed47585a6862..3c9ef1c196a9 100644
--- a/drivers/net/ethernet/sun/niu.c
+++ b/drivers/net/ethernet/sun/niu.c
@@ -17,6 +17,7 @@
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/bitops.h> 18#include <linux/bitops.h>
19#include <linux/mii.h> 19#include <linux/mii.h>
20#include <linux/if.h>
20#include <linux/if_ether.h> 21#include <linux/if_ether.h>
21#include <linux/if_vlan.h> 22#include <linux/if_vlan.h>
22#include <linux/ip.h> 23#include <linux/ip.h>
@@ -9716,7 +9717,7 @@ static const struct net_device_ops niu_netdev_ops = {
9716 .ndo_stop = niu_close, 9717 .ndo_stop = niu_close,
9717 .ndo_start_xmit = niu_start_xmit, 9718 .ndo_start_xmit = niu_start_xmit,
9718 .ndo_get_stats64 = niu_get_stats, 9719 .ndo_get_stats64 = niu_get_stats,
9719 .ndo_set_multicast_list = niu_set_rx_mode, 9720 .ndo_set_rx_mode = niu_set_rx_mode,
9720 .ndo_validate_addr = eth_validate_addr, 9721 .ndo_validate_addr = eth_validate_addr,
9721 .ndo_set_mac_address = niu_set_mac_addr, 9722 .ndo_set_mac_address = niu_set_mac_addr,
9722 .ndo_do_ioctl = niu_ioctl, 9723 .ndo_do_ioctl = niu_ioctl,
@@ -9852,6 +9853,8 @@ static int __devinit niu_pci_init_one(struct pci_dev *pdev,
9852 9853
9853 niu_set_basic_features(dev); 9854 niu_set_basic_features(dev);
9854 9855
9856 dev->priv_flags |= IFF_UNICAST_FLT;
9857
9855 np->regs = pci_ioremap_bar(pdev, 0); 9858 np->regs = pci_ioremap_bar(pdev, 0);
9856 if (!np->regs) { 9859 if (!np->regs) {
9857 dev_err(&pdev->dev, "Cannot map device registers, aborting\n"); 9860 dev_err(&pdev->dev, "Cannot map device registers, aborting\n");
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 0c7321c35ad4..4f09f88f1c28 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -949,6 +949,7 @@ static int virtnet_probe(struct virtio_device *vdev)
949 return -ENOMEM; 949 return -ENOMEM;
950 950
951 /* Set up network device as normal. */ 951 /* Set up network device as normal. */
952 dev->priv_flags |= IFF_UNICAST_FLT;
952 dev->netdev_ops = &virtnet_netdev; 953 dev->netdev_ops = &virtnet_netdev;
953 dev->features = NETIF_F_HIGHDMA; 954 dev->features = NETIF_F_HIGHDMA;
954 955
diff --git a/include/linux/if.h b/include/linux/if.h
index 03489ca92ded..db20bd4fd16b 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -78,6 +78,7 @@
78 * datapath port */ 78 * datapath port */
79#define IFF_TX_SKB_SHARING 0x10000 /* The interface supports sharing 79#define IFF_TX_SKB_SHARING 0x10000 /* The interface supports sharing
80 * skbs on transmit */ 80 * skbs on transmit */
81#define IFF_UNICAST_FLT 0x20000 /* Supports unicast filtering */
81 82
82#define IF_GET_IFACE 0x0001 /* for querying only */ 83#define IF_GET_IFACE 0x0001 /* for querying only */
83#define IF_GET_PROTO 0x0002 84#define IF_GET_PROTO 0x0002
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ddee79bb8f15..96e4f7e0ad68 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -723,6 +723,8 @@ struct netdev_tc_txq {
723 * 723 *
724 * void (*ndo_set_rx_mode)(struct net_device *dev); 724 * void (*ndo_set_rx_mode)(struct net_device *dev);
725 * This function is called device changes address list filtering. 725 * This function is called device changes address list filtering.
726 * If driver handles unicast address filtering, it should set
727 * IFF_UNICAST_FLT to its priv_flags.
726 * 728 *
727 * void (*ndo_set_multicast_list)(struct net_device *dev); 729 * void (*ndo_set_multicast_list)(struct net_device *dev);
728 * This function is called when the multicast address list changes. 730 * This function is called when the multicast address list changes.
diff --git a/net/core/dev.c b/net/core/dev.c
index a8d91a5dd909..6eb03fdaf075 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4522,9 +4522,7 @@ void __dev_set_rx_mode(struct net_device *dev)
4522 if (!netif_device_present(dev)) 4522 if (!netif_device_present(dev))
4523 return; 4523 return;
4524 4524
4525 if (ops->ndo_set_rx_mode) 4525 if (!(dev->priv_flags & IFF_UNICAST_FLT)) {
4526 ops->ndo_set_rx_mode(dev);
4527 else {
4528 /* Unicast addresses changes may only happen under the rtnl, 4526 /* Unicast addresses changes may only happen under the rtnl,
4529 * therefore calling __dev_set_promiscuity here is safe. 4527 * therefore calling __dev_set_promiscuity here is safe.
4530 */ 4528 */
@@ -4535,10 +4533,12 @@ void __dev_set_rx_mode(struct net_device *dev)
4535 __dev_set_promiscuity(dev, -1); 4533 __dev_set_promiscuity(dev, -1);
4536 dev->uc_promisc = false; 4534 dev->uc_promisc = false;
4537 } 4535 }
4538
4539 if (ops->ndo_set_multicast_list)
4540 ops->ndo_set_multicast_list(dev);
4541 } 4536 }
4537
4538 if (ops->ndo_set_rx_mode)
4539 ops->ndo_set_rx_mode(dev);
4540 else if (ops->ndo_set_multicast_list)
4541 ops->ndo_set_multicast_list(dev);
4542} 4542}
4543 4543
4544void dev_set_rx_mode(struct net_device *dev) 4544void dev_set_rx_mode(struct net_device *dev)