Displaying 7 results from an estimated 7 matches for "br_mac_hash".
2007 Apr 18
0
[Bridge] [PATCH] (4/4) bridge forwarding table RCU
...ing, assumes caller has no preempt (rcu_read_lock) */
+struct net_bridge_fdb_entry *__br_fdb_get(struct net_bridge *br,
+ const unsigned char *addr)
{
struct hlist_node *h;
+ struct net_bridge_fdb_entry *fdb;
- read_lock_bh(&br->hash_lock);
-
- hlist_for_each(h, &br->hash[br_mac_hash(addr)]) {
- struct net_bridge_fdb_entry *fdb
- = hlist_entry(h, struct net_bridge_fdb_entry, hlist);
-
+ hlist_for_each_entry_rcu(fdb, h, &br->hash[br_mac_hash(addr)], hlist) {
if (!memcmp(fdb->addr.addr, addr, ETH_ALEN)) {
- if (has_expired(br, fdb))
- goto ret_null;
-
- ato...
2013 Feb 13
14
[Bridge] [PATCH v10 net-next 00/12] VLAN filtering/VLAN aware bridge
Changes since v9:
* series re-ordering so make functionality more distinct. Basic vlan
filtering is patches 1-4. Support for PVID/untagged vlans is patches
5 and 6. VLAN support for FDB/MDB is patches 7-11. Patch 12 is
still additional egress policy.
* Slight simplification to code that extracts the VID from skb. Since we
now depend on the vlan module, at the time of input skb_tci is
2013 Jan 09
16
[Bridge] [PATCH net-next V5 00/14] Add basic VLAN support to bridges
This series of patches provides an ability to add VLANs to the bridge
ports. This is similar to what can be found in most switches. The bridge
port may have any number of VLANs added to it including vlan 0 priority tagged
traffic. When vlans are added to the port, only traffic tagged with particular
vlan will forwarded over this port. Additionally, vlan ids are added to FDB
entries and become
2007 Apr 18
1
[Bridge] [PATCH] (1/4) bridge: use jenkins hash
...db.c 2005-03-10 15:05:11 -08:00
@@ -19,6 +19,7 @@
#include <linux/times.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
+#include <linux/jhash.h>
#include <asm/atomic.h>
#include "br_private.h"
@@ -57,18 +58,7 @@
static __inline__ int br_mac_hash(const unsigned char *mac)
{
- unsigned long x;
-
- x = mac[0];
- x = (x << 2) ^ mac[1];
- x = (x << 2) ^ mac[2];
- x = (x << 2) ^ mac[3];
- x = (x << 2) ^ mac[4];
- x = (x << 2) ^ mac[5];
-
- x ^= x >> 8;
-
- return x & (BR_HASH_SIZE - 1);
+ return jhash(mac...
2009 Jun 15
1
[Bridge] [PATCH][RFC] net/bridge: add basic VEPA support
...telimit())
@@ -415,3 +424,16 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
spin_unlock(&br->hash_lock);
}
}
+
+struct net_bridge_port *br_vepa_find_src(struct net_bridge *br,
+ const unsigned char *addr)
+{
+ struct hlist_head *head = &br->hash[br_mac_hash(addr)];
+ struct net_bridge_fdb_entry *fdb;
+
+ fdb = fdb_find(head, addr);
+ if (fdb)
+ return fdb->dst;
+ else
+ return NULL;
+}
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
index d2c27c8..ff1135e 100644
--- a/net/bridge/br_forward.c
+++ b/net/bridge/br_forward.c
@@ -22,7 +...
2009 Jun 15
1
[Bridge] [PATCH][RFC] net/bridge: add basic VEPA support
...telimit())
@@ -415,3 +424,16 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
spin_unlock(&br->hash_lock);
}
}
+
+struct net_bridge_port *br_vepa_find_src(struct net_bridge *br,
+ const unsigned char *addr)
+{
+ struct hlist_head *head = &br->hash[br_mac_hash(addr)];
+ struct net_bridge_fdb_entry *fdb;
+
+ fdb = fdb_find(head, addr);
+ if (fdb)
+ return fdb->dst;
+ else
+ return NULL;
+}
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
index d2c27c8..ff1135e 100644
--- a/net/bridge/br_forward.c
+++ b/net/bridge/br_forward.c
@@ -22,7 +...
2009 Jun 15
1
[Bridge] [PATCH][RFC] net/bridge: add basic VEPA support
...telimit())
@@ -415,3 +424,16 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
spin_unlock(&br->hash_lock);
}
}
+
+struct net_bridge_port *br_vepa_find_src(struct net_bridge *br,
+ const unsigned char *addr)
+{
+ struct hlist_head *head = &br->hash[br_mac_hash(addr)];
+ struct net_bridge_fdb_entry *fdb;
+
+ fdb = fdb_find(head, addr);
+ if (fdb)
+ return fdb->dst;
+ else
+ return NULL;
+}
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
index d2c27c8..ff1135e 100644
--- a/net/bridge/br_forward.c
+++ b/net/bridge/br_forward.c
@@ -22,7 +...