Commit 9959a185 authored by Scott Feldman's avatar Scott Feldman Committed by David S. Miller

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: default avatarVasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: default avatarScott Feldman <scofeldm@cisco.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2d6ddced
...@@ -89,6 +89,7 @@ struct enic { ...@@ -89,6 +89,7 @@ struct enic {
spinlock_t devcmd_lock; spinlock_t devcmd_lock;
u8 mac_addr[ETH_ALEN]; u8 mac_addr[ETH_ALEN];
u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN]; u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN];
unsigned int flags;
unsigned int mc_count; unsigned int mc_count;
int csum_rx_enabled; int csum_rx_enabled;
u32 port_mtu; u32 port_mtu;
......
...@@ -771,6 +771,7 @@ static void enic_set_multicast_list(struct net_device *netdev) ...@@ -771,6 +771,7 @@ static void enic_set_multicast_list(struct net_device *netdev)
int promisc = (netdev->flags & IFF_PROMISC) ? 1 : 0; int promisc = (netdev->flags & IFF_PROMISC) ? 1 : 0;
int allmulti = (netdev->flags & IFF_ALLMULTI) || int allmulti = (netdev->flags & IFF_ALLMULTI) ||
(netdev->mc_count > ENIC_MULTICAST_PERFECT_FILTERS); (netdev->mc_count > ENIC_MULTICAST_PERFECT_FILTERS);
unsigned int flags = netdev->flags | (allmulti ? IFF_ALLMULTI : 0);
u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN]; u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN];
unsigned int mc_count = netdev->mc_count; unsigned int mc_count = netdev->mc_count;
unsigned int i, j; unsigned int i, j;
...@@ -780,8 +781,11 @@ static void enic_set_multicast_list(struct net_device *netdev) ...@@ -780,8 +781,11 @@ static void enic_set_multicast_list(struct net_device *netdev)
spin_lock(&enic->devcmd_lock); spin_lock(&enic->devcmd_lock);
vnic_dev_packet_filter(enic->vdev, directed, if (enic->flags != flags) {
multicast, broadcast, promisc, allmulti); enic->flags = flags;
vnic_dev_packet_filter(enic->vdev, directed,
multicast, broadcast, promisc, allmulti);
}
/* Is there an easier way? Trying to minimize to /* Is there an easier way? Trying to minimize to
* calls to add/del multicast addrs. We keep the * calls to add/del multicast addrs. We keep the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment