netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/3] net:dsa:mv88e6xxx: use hashtable to store multicast entries
@ 2016-12-12 13:39 Volodymyr Bendiuga
  2016-12-12 13:54 ` Andrew Lunn
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Volodymyr Bendiuga @ 2016-12-12 13:39 UTC (permalink / raw)
  To: andrew, vivien.didelot, f.fainelli, netdev, volodymyr.bendiuga
  Cc: Volodymyr Bendiuga

Hashtable will make it extremely faster when inserting fdb entries
into the forwarding database.

Signed-off-by: Volodymyr Bendiuga <volodymyr.bendiuga@gmail.com>
---
 drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/net/dsa/mv88e6xxx/mv88e6xxx.h b/drivers/net/dsa/mv88e6xxx/mv88e6xxx.h
index 431e954..407e6db 100644
--- a/drivers/net/dsa/mv88e6xxx/mv88e6xxx.h
+++ b/drivers/net/dsa/mv88e6xxx/mv88e6xxx.h
@@ -15,6 +15,8 @@
 #include <linux/if_vlan.h>
 #include <linux/irq.h>
 #include <linux/gpio/consumer.h>
+#include <linux/crc32.h>
+#include <linux/hashtable.h>
 
 #ifndef UINT64_MAX
 #define UINT64_MAX		(u64)(~((u64)0))
@@ -672,6 +674,16 @@ struct mv88e6xxx_info {
 	const struct mv88e6xxx_ops *ops;
 };
 
+struct pvec_tbl_entry {
+        struct hlist_node entry;
+        u32 key_crc32; /* key */
+        u16 pvec;
+        struct pvec_tbl_key {
+                u8 addr[ETH_ALEN];
+                u16 fid;
+        } key;
+};
+
 struct mv88e6xxx_atu_entry {
 	u16	fid;
 	u8	state;
@@ -736,6 +748,9 @@ struct mv88e6xxx_chip {
 
 	struct mv88e6xxx_priv_port	ports[DSA_MAX_PORTS];
 
+	/* This table hold a port vector for each multicast address */
+	DECLARE_HASHTABLE(pvec_tbl, 12);
+
 	/* A switch may have a GPIO line tied to its reset pin. Parse
 	 * this from the device tree, and use it before performing
 	 * switch soft reset.
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2016-12-23 10:40 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-12 13:39 [PATCH net-next 1/3] net:dsa:mv88e6xxx: use hashtable to store multicast entries Volodymyr Bendiuga
2016-12-12 13:54 ` Andrew Lunn
2016-12-12 14:18 ` Andrew Lunn
2016-12-12 15:03 ` Vivien Didelot
     [not found]   ` <CAMr9Lbp5eCg1oyWGN+uiDEcF0VZuKUi87FH6JYTGj6pL82R+Mw@mail.gmail.com>
2016-12-12 16:07     ` Andrew Lunn
2016-12-12 16:37     ` Florian Fainelli
2016-12-12 17:11       ` Vivien Didelot
2016-12-12 19:09       ` Andrew Lunn
2016-12-12 20:03         ` Vivien Didelot
     [not found]         ` <CAMr9LbqyvrRYe_m34Ufzxkf2Vef3LbMQiuoiwVX0mK=hW6euyA@mail.gmail.com>
2016-12-13 15:09           ` Andrew Lunn
     [not found]             ` <CABHmqqB-6-L124hrAjNxd4kO3zYp9R=RM1X6PXyuQW6Hapiv4g@mail.gmail.com>
2016-12-14 10:46               ` Andrew Lunn
     [not found]                 ` <CABHmqqDpiN2kwkTgrM8Qu8EEx3Sjk2yVBy8QQAJppGfJ6-MV5Q@mail.gmail.com>
2016-12-15 17:21                   ` Vivien Didelot
2016-12-15 17:32                     ` Florian Fainelli
2016-12-15 17:50                       ` Vivien Didelot
     [not found]                         ` <CABHmqqCOYMPA-Py7Uu4gsQ=s8CrQd-tT4-Db+j8eJH9=2s4L2g@mail.gmail.com>
2016-12-16  9:31                           ` John Crispin
2016-12-16 10:08                           ` Andrew Lunn
     [not found]                             ` <CABHmqqAQddcQZqVBi7gTjR40cHx6+aQebmsY3BwJgeEbLsX5Yw@mail.gmail.com>
2016-12-16 11:01                               ` Andrew Lunn
2016-12-23  9:30                                 ` Volodymyr Bendiuga
2016-12-23 10:17                                   ` Andrew Lunn
2016-12-15 17:47                     ` John Crispin
2016-12-12 16:22 ` Vivien Didelot

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).