Commit 3247b272 authored by Nikolay Aleksandrov's avatar Nikolay Aleksandrov Committed by David S. Miller

net: bridge: mcast: add delete due to fast-leave mdb flag

In user-space there's no way to distinguish why an mdb entry was deleted
and that is a problem for daemons which would like to keep the mdb in
sync with remote ends (e.g. mlag) but would also like to converge faster.
In almost all cases we'd like to age-out the remote entry for performance
and convergence reasons except when fast-leave is enabled. In that case we
want explicit immediate remote delete, thus add mdb flag which is set only
when the entry is being deleted due to fast-leave.
Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0eba31ef
...@@ -237,6 +237,7 @@ struct br_mdb_entry { ...@@ -237,6 +237,7 @@ struct br_mdb_entry {
#define MDB_PERMANENT 1 #define MDB_PERMANENT 1
__u8 state; __u8 state;
#define MDB_FLAGS_OFFLOAD (1 << 0) #define MDB_FLAGS_OFFLOAD (1 << 0)
#define MDB_FLAGS_FAST_LEAVE (1 << 1)
__u8 flags; __u8 flags;
__u16 vid; __u16 vid;
struct { struct {
......
...@@ -60,6 +60,8 @@ static void __mdb_entry_fill_flags(struct br_mdb_entry *e, unsigned char flags) ...@@ -60,6 +60,8 @@ static void __mdb_entry_fill_flags(struct br_mdb_entry *e, unsigned char flags)
e->flags = 0; e->flags = 0;
if (flags & MDB_PG_FLAGS_OFFLOAD) if (flags & MDB_PG_FLAGS_OFFLOAD)
e->flags |= MDB_FLAGS_OFFLOAD; e->flags |= MDB_FLAGS_OFFLOAD;
if (flags & MDB_PG_FLAGS_FAST_LEAVE)
e->flags |= MDB_FLAGS_FAST_LEAVE;
} }
static void __mdb_entry_to_br_ip(struct br_mdb_entry *entry, struct br_ip *ip) static void __mdb_entry_to_br_ip(struct br_mdb_entry *entry, struct br_ip *ip)
......
...@@ -1393,7 +1393,7 @@ br_multicast_leave_group(struct net_bridge *br, ...@@ -1393,7 +1393,7 @@ br_multicast_leave_group(struct net_bridge *br,
del_timer(&p->timer); del_timer(&p->timer);
kfree_rcu(p, rcu); kfree_rcu(p, rcu);
br_mdb_notify(br->dev, port, group, RTM_DELMDB, br_mdb_notify(br->dev, port, group, RTM_DELMDB,
p->flags); p->flags | MDB_PG_FLAGS_FAST_LEAVE);
if (!mp->ports && !mp->host_joined && if (!mp->ports && !mp->host_joined &&
netif_running(br->dev)) netif_running(br->dev))
......
...@@ -199,6 +199,7 @@ struct net_bridge_fdb_entry { ...@@ -199,6 +199,7 @@ struct net_bridge_fdb_entry {
#define MDB_PG_FLAGS_PERMANENT BIT(0) #define MDB_PG_FLAGS_PERMANENT BIT(0)
#define MDB_PG_FLAGS_OFFLOAD BIT(1) #define MDB_PG_FLAGS_OFFLOAD BIT(1)
#define MDB_PG_FLAGS_FAST_LEAVE BIT(2)
struct net_bridge_port_group { struct net_bridge_port_group {
struct net_bridge_port *port; struct net_bridge_port *port;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment