diff options
author | Scott Feldman <scofeldm@cisco.com> | 2009-12-23 08:27:43 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-24 00:03:40 -0500 |
commit | 9959a18556c73ebf2936b8df183ea7b41f38d933 (patch) | |
tree | dd3f715d82e9d655e16baf0aed86c518ad9eb8ef /drivers/net/enic | |
parent | 2d6ddced5c99cf79c06b9b6ec1366ab63b970ea9 (diff) |
enic: minimize pkt filter updates to firmware
In set_multicast(), only push pkt filter changes down to firmware if
pkt filter actually changes.
Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: Scott Feldman <scofeldm@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/enic')
-rw-r--r-- | drivers/net/enic/enic.h | 1 | ||||
-rw-r--r-- | drivers/net/enic/enic_main.c | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h index 8dd0105a8d9c..b090d65ad0c8 100644 --- a/drivers/net/enic/enic.h +++ b/drivers/net/enic/enic.h | |||
@@ -89,6 +89,7 @@ struct enic { | |||
89 | spinlock_t devcmd_lock; | 89 | spinlock_t devcmd_lock; |
90 | u8 mac_addr[ETH_ALEN]; | 90 | u8 mac_addr[ETH_ALEN]; |
91 | u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN]; | 91 | u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN]; |
92 | unsigned int flags; | ||
92 | unsigned int mc_count; | 93 | unsigned int mc_count; |
93 | int csum_rx_enabled; | 94 | int csum_rx_enabled; |
94 | u32 port_mtu; | 95 | u32 port_mtu; |
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 452a6b747e3e..019b1480cc0c 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c | |||
@@ -771,6 +771,7 @@ static void enic_set_multicast_list(struct net_device *netdev) | |||
771 | int promisc = (netdev->flags & IFF_PROMISC) ? 1 : 0; | 771 | int promisc = (netdev->flags & IFF_PROMISC) ? 1 : 0; |
772 | int allmulti = (netdev->flags & IFF_ALLMULTI) || | 772 | int allmulti = (netdev->flags & IFF_ALLMULTI) || |
773 | (netdev->mc_count > ENIC_MULTICAST_PERFECT_FILTERS); | 773 | (netdev->mc_count > ENIC_MULTICAST_PERFECT_FILTERS); |
774 | unsigned int flags = netdev->flags | (allmulti ? IFF_ALLMULTI : 0); | ||
774 | u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN]; | 775 | u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN]; |
775 | unsigned int mc_count = netdev->mc_count; | 776 | unsigned int mc_count = netdev->mc_count; |
776 | unsigned int i, j; | 777 | unsigned int i, j; |
@@ -780,8 +781,11 @@ static void enic_set_multicast_list(struct net_device *netdev) | |||
780 | 781 | ||
781 | spin_lock(&enic->devcmd_lock); | 782 | spin_lock(&enic->devcmd_lock); |
782 | 783 | ||
783 | vnic_dev_packet_filter(enic->vdev, directed, | 784 | if (enic->flags != flags) { |
784 | multicast, broadcast, promisc, allmulti); | 785 | enic->flags = flags; |
786 | vnic_dev_packet_filter(enic->vdev, directed, | ||
787 | multicast, broadcast, promisc, allmulti); | ||
788 | } | ||
785 | 789 | ||
786 | /* Is there an easier way? Trying to minimize to | 790 | /* Is there an easier way? Trying to minimize to |
787 | * calls to add/del multicast addrs. We keep the | 791 | * calls to add/del multicast addrs. We keep the |