netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Scott Feldman <scofeldm@cisco.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [net-next PATCH 3/6] enic: minimize pkt filter updates to firmware
Date: Fri, 18 Dec 2009 18:09:51 -0800	[thread overview]
Message-ID: <20091219020951.2745.59323.stgit@savbu-pc100.cisco.com> (raw)
In-Reply-To: <20091219020758.2745.85264.stgit@savbu-pc100.cisco.com>

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: Scott Feldman <scofeldm@cisco.com>
Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
---
 drivers/net/enic/enic.h      |    1 +
 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 dfd6024..b09b091 100644
--- a/drivers/net/enic/enic.h
+++ b/drivers/net/enic/enic.h
@@ -89,6 +89,7 @@ struct enic {
 	spinlock_t devcmd_lock;
 	u8 mac_addr[ETH_ALEN];
 	u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN];
+	unsigned int flags;
 	unsigned int mc_count;
 	int csum_rx_enabled;
 	u32 port_mtu;
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 0265b25..2708ecf 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -772,6 +772,7 @@ static void enic_set_multicast_list(struct net_device *netdev)
 	int promisc = (netdev->flags & IFF_PROMISC) ? 1 : 0;
 	int allmulti = (netdev->flags & IFF_ALLMULTI) ||
 	    (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];
 	unsigned int mc_count = netdev->mc_count;
 	unsigned int i, j;
@@ -781,8 +782,11 @@ static void enic_set_multicast_list(struct net_device *netdev)
 
 	spin_lock(&enic->devcmd_lock);
 
-	vnic_dev_packet_filter(enic->vdev, directed,
-		multicast, broadcast, promisc, allmulti);
+	if (enic->flags != flags) {
+		enic->flags = flags;
+		vnic_dev_packet_filter(enic->vdev, directed,
+			multicast, broadcast, promisc, allmulti);
+	}
 
 	/* Is there an easier way?  Trying to minimize to
 	 * calls to add/del multicast addrs.  We keep the


  parent reply	other threads:[~2009-12-19  2:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-19  2:09 [net-next PATCH 0/6] enic: updates to version 1.1.0.241 Scott Feldman
2009-12-19  2:09 ` [net-next PATCH 1/6] enic: Bug fix: use safe queue shutdown in dev->stop Scott Feldman
2009-12-19 15:34   ` Ben Hutchings
2009-12-19 20:44     ` Scott Feldman
2009-12-19  2:09 ` [net-next PATCH 2/6] enic: Bug fix: try harder to fill Rx ring on skb allocation failures Scott Feldman
2009-12-19 10:41   ` Simon Horman
2009-12-19 20:39     ` Scott Feldman
2009-12-20  1:15       ` Simon Horman
2009-12-20  1:29         ` Scott Feldman
2009-12-20  6:14           ` Simon Horman
2009-12-20  1:51     ` Scott Feldman
2009-12-20  6:54       ` Simon Horman
2009-12-19  2:09 ` Scott Feldman [this message]
2009-12-19  2:09 ` [net-next PATCH 4/6] enic: Bug fix: align desc ring sizes to 32 descs Scott Feldman
2009-12-19  2:10 ` [net-next PATCH 5/6] enic: feature add: add ethtool -c/C support Scott Feldman
2009-12-19 10:10   ` Simon Horman
2009-12-19 19:33     ` Scott Feldman
2009-12-20  1:15       ` Simon Horman
2009-12-19  2:10 ` [net-next PATCH 6/6] enic: whitespace cleanup; #define cleanup; more verbose err msg Scott Feldman
  -- strict thread matches above, loose matches on Subject: below --
2009-12-22  2:21 [net-next PATCH 0/6] enic: updates to version 1.1.0.241a Scott Feldman
2009-12-22  2:21 ` [net-next PATCH 3/6] enic: minimize pkt filter updates to firmware Scott Feldman
2009-12-23 23:27 [net-next PATCH 0/6] enic: updates to version 1.1.0.241a Scott Feldman
2009-12-23 23:27 ` [net-next PATCH 3/6] enic: minimize pkt filter updates to firmware Scott Feldman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091219020951.2745.59323.stgit@savbu-pc100.cisco.com \
    --to=scofeldm@cisco.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).