Thread (19 messages) 19 messages, 4 authors, 2013-06-24
STALE4760d

[PATCH net-next v4 1/2] vxlan: introduce vxlan_rdst_append

From: Mike Rapoport <hidden>
Date: 2013-06-23 16:22:36
Subsystem: networking drivers, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

to allow remotes list management for both FDB entries and default
destinations

Signed-off-by: Mike Rapoport <redacted>
---
 drivers/net/vxlan.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 212a256..e5fb6568 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -386,14 +386,13 @@ static struct vxlan_fdb *vxlan_find_mac(struct vxlan_dev *vxlan,
 	return f;
 }
 
-/* Add/update destinations for multicast */
-static int vxlan_fdb_append(struct vxlan_fdb *f,
+static int vxlan_rdst_append(struct list_head *remotes,
 			    __be32 ip, __be16 port, __u32 vni, __u32 ifindex)
 {
 	struct vxlan_rdst *rd;
 
 	/* protected by vxlan->hash_lock */
-	list_for_each_entry(rd, &f->remotes, list) {
+	list_for_each_entry(rd, remotes, list) {
 		if (rd->remote_ip == ip &&
 		    rd->remote_port == port &&
 		    rd->remote_vni == vni &&
@@ -409,11 +408,18 @@ static int vxlan_fdb_append(struct vxlan_fdb *f,
 	rd->remote_vni = vni;
 	rd->remote_ifindex = ifindex;
 
-	list_add_tail_rcu(&rd->list, &f->remotes);
+	list_add_tail_rcu(&rd->list, remotes);
 
 	return 1;
 }
 
+/* Add/update destinations for multicast */
+static int vxlan_fdb_append(struct vxlan_fdb *f,
+			    __be32 ip, __be16 port, __u32 vni, __u32 ifindex)
+{
+	return vxlan_rdst_append(&f->remotes, ip, port, vni, ifindex);
+}
+
 /* Add new entry to forwarding table -- assumes lock held */
 static int vxlan_fdb_create(struct vxlan_dev *vxlan,
 			    const u8 *mac, __be32 ip,
-- 
1.8.1.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help