[PATCH net-26] cxgb4vf: fix setting unicast/multicast addresses ...

Previous thread: [PATCH] hso: fix disable_net by Filip Aben on Wednesday, November 24, 2010 - 12:35 pm. (4 messages)

Next thread: [net-next-2.6 PATCH] 8021q: vlan device is lockless do not transfer real_num_{tx|rx}_queues by John Fastabend on Wednesday, November 24, 2010 - 4:14 pm. (2 messages)
From: Casey Leedom
Date: Wednesday, November 24, 2010 - 3:23 pm

We were truncating the number of unicast and multicast MAC addresses
supported.  Additionally, we were incorrectly computing the MAC Address
hash (a "1 << N" where we needed a "1ULL << N").

Signed-off-by: Casey Leedom <leedom@chelsio.com>
---
 drivers/net/cxgb4vf/cxgb4vf_main.c |   73 +++++++++++++++++----------
 drivers/net/cxgb4vf/t4vf_hw.c      |   96 ++++++++++++++++++++++-------------
 2 files changed, 105 insertions(+), 64 deletions(-)

diff --git a/drivers/net/cxgb4vf/cxgb4vf_main.c b/drivers/net/cxgb4vf/cxgb4vf_main.c
index 9246d2f..f54af48 100644
--- a/drivers/net/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/cxgb4vf/cxgb4vf_main.c
@@ -814,40 +814,48 @@ static struct net_device_stats *cxgb4vf_get_stats(struct net_device *dev)
 }
 
 /*
- * Collect up to maxaddrs worth of a netdevice's unicast addresses into an
- * array of addrss pointers and return the number collected.
+ * Collect up to maxaddrs worth of a netdevice's unicast addresses, starting
+ * at a specified offset within the list, into an array of addrss pointers and
+ * return the number collected.
  */
-static inline int collect_netdev_uc_list_addrs(const struct net_device *dev,
-					       const u8 **addr,
-					       unsigned int maxaddrs)
+static inline unsigned int collect_netdev_uc_list_addrs(const struct net_device *dev,
+							const u8 **addr,
+							unsigned int offset,
+							unsigned int maxaddrs)
 {
+	unsigned int index = 0;
 	unsigned int naddr = 0;
 	const struct netdev_hw_addr *ha;
 
-	for_each_dev_addr(dev, ha) {
-		addr[naddr++] = ha->addr;
-		if (naddr >= maxaddrs)
-			break;
-	}
+	for_each_dev_addr(dev, ha)
+		if (index++ >= offset) {
+			addr[naddr++] = ha->addr;
+			if (naddr >= maxaddrs)
+				break;
+		}
 	return naddr;
 }
 
 /*
- * Collect up to maxaddrs worth of a netdevice's multicast addresses into an
- * array of addrss pointers and return the number collected.
+ * Collect up to maxaddrs worth of a netdevice's multicast addresses, starting
+ * at a specified ...
From: David Miller
Date: Sunday, November 28, 2010 - 12:40 pm

From: Casey Leedom <leedom@chelsio.com>

I'll apply this, thanks.
--

Previous thread: [PATCH] hso: fix disable_net by Filip Aben on Wednesday, November 24, 2010 - 12:35 pm. (4 messages)

Next thread: [net-next-2.6 PATCH] 8021q: vlan device is lockless do not transfer real_num_{tx|rx}_queues by John Fastabend on Wednesday, November 24, 2010 - 4:14 pm. (2 messages)