netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/7] bridge: don't age out externally added FDB entries
@ 2015-09-20 15:48 sfeldma
  2015-09-20 15:48 ` [PATCH net-next v2 1/7] rocker: track when FDB entry is touched sfeldma
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: sfeldma @ 2015-09-20 15:48 UTC (permalink / raw)
  To: netdev
  Cc: jiri, siva.mannem.lnx, pjonnala, stephen, roopa, andrew,
	f.fainelli, vivien.didelot

From: Scott Feldman <sfeldma@gmail.com>

v2: Per Jiri review comment: add BR_DEFAULT_AGEING_TIME to defines

Siva originally proposed skipping externally added FDB entries in the bridge's
FDB garbage collection func, and moving the ageing of externally added entries
to the port driver/device.  This broke rocker, since rocker didn't have a
hardware (or software) mechanism for ageing out its learned FDB entries.

This patchset reintroduces Siva's bridge driver patch to skip externally added
entries and adds support in rocker so rocker can age out its own entries.
Rocker does this using a software timer similar to the bridge's FDB garbage
collection timer.  Other switchdev devices/drivers can use this software timer
method or program the device to nofity aged-out entries to the driver.

Updated switchdev.txt documentation to reflect current state-of-the-art.  This
removes one more XXX todo comment in switchdev.txt.

Scott Feldman (6):
  rocker: track when FDB entry is touched.
  rocker: store rocker_port in fdb key rather than pport
  bridge: define some min/max/default ageing time constants
  rocker: adding port ageing_time for ageing out FDB entries
  rocker: add FDB cleanup timer
  switchdev: update documentation on FDB ageing_time

Siva Mannem (1):
  bridge: don't age externally added FDB entries

 Documentation/networking/switchdev.txt |   24 +++++------
 drivers/net/ethernet/rocker/rocker.c   |   69 +++++++++++++++++++++++++++-----
 include/linux/if_bridge.h              |    6 +++
 net/bridge/br_device.c                 |    2 +-
 net/bridge/br_fdb.c                    |    2 +
 5 files changed, 80 insertions(+), 23 deletions(-)

-- 
1.7.10.4

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

* [PATCH net-next v2 1/7] rocker: track when FDB entry is touched.
  2015-09-20 15:48 [PATCH net-next v2 0/7] bridge: don't age out externally added FDB entries sfeldma
@ 2015-09-20 15:48 ` sfeldma
  2015-09-20 15:48 ` [PATCH net-next v2 2/7] rocker: store rocker_port in fdb key rather than pport sfeldma
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: sfeldma @ 2015-09-20 15:48 UTC (permalink / raw)
  To: netdev
  Cc: jiri, siva.mannem.lnx, pjonnala, stephen, roopa, andrew,
	f.fainelli, vivien.didelot

From: Scott Feldman <sfeldma@gmail.com>

The entry is touched once when created, and touched again for each update.
The touched time is used to calculate FDB entry age.

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
---
 drivers/net/ethernet/rocker/rocker.c |   18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
index 34ac41a..e517e9c 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -152,6 +152,7 @@ struct rocker_fdb_tbl_entry {
 	struct hlist_node entry;
 	u32 key_crc32; /* key */
 	bool learned;
+	unsigned long touched;
 	struct rocker_fdb_tbl_key {
 		u32 pport;
 		u8 addr[ETH_ALEN];
@@ -3629,6 +3630,7 @@ static int rocker_port_fdb(struct rocker_port *rocker_port,
 		return -ENOMEM;
 
 	fdb->learned = (flags & ROCKER_OP_FLAG_LEARNED);
+	fdb->touched = jiffies;
 	fdb->key.pport = rocker_port->pport;
 	ether_addr_copy(fdb->key.addr, addr);
 	fdb->key.vlan_id = vlan_id;
@@ -3638,13 +3640,17 @@ static int rocker_port_fdb(struct rocker_port *rocker_port,
 
 	found = rocker_fdb_tbl_find(rocker, fdb);
 
-	if (removing && found) {
-		rocker_port_kfree(trans, fdb);
-		if (trans != SWITCHDEV_TRANS_PREPARE)
-			hash_del(&found->entry);
-	} else if (!removing && !found) {
+	if (found) {
+		found->touched = jiffies;
+		if (removing) {
+			rocker_port_kfree(trans, fdb);
+			if (trans != SWITCHDEV_TRANS_PREPARE)
+				hash_del(&found->entry);
+		}
+	} else if (!removing) {
 		if (trans != SWITCHDEV_TRANS_PREPARE)
-			hash_add(rocker->fdb_tbl, &fdb->entry, fdb->key_crc32);
+			hash_add(rocker->fdb_tbl, &fdb->entry,
+				 fdb->key_crc32);
 	}
 
 	spin_unlock_irqrestore(&rocker->fdb_tbl_lock, lock_flags);
-- 
1.7.10.4

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

* [PATCH net-next v2 2/7] rocker: store rocker_port in fdb key rather than pport
  2015-09-20 15:48 [PATCH net-next v2 0/7] bridge: don't age out externally added FDB entries sfeldma
  2015-09-20 15:48 ` [PATCH net-next v2 1/7] rocker: track when FDB entry is touched sfeldma
@ 2015-09-20 15:48 ` sfeldma
  2015-09-20 15:48 ` [PATCH net-next v2 3/7] bridge: define some min/max/default ageing time constants sfeldma
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: sfeldma @ 2015-09-20 15:48 UTC (permalink / raw)
  To: netdev
  Cc: jiri, siva.mannem.lnx, pjonnala, stephen, roopa, andrew,
	f.fainelli, vivien.didelot

From: Scott Feldman <sfeldma@gmail.com>

We'll need more info from rocker_port than just pport when we age out fdb
entries, so store rocker_port rather than pport in each fdb entry.

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
---
 drivers/net/ethernet/rocker/rocker.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
index e517e9c..f55ed2c 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -154,7 +154,7 @@ struct rocker_fdb_tbl_entry {
 	bool learned;
 	unsigned long touched;
 	struct rocker_fdb_tbl_key {
-		u32 pport;
+		struct rocker_port *rocker_port;
 		u8 addr[ETH_ALEN];
 		__be16 vlan_id;
 	} key;
@@ -3631,7 +3631,7 @@ static int rocker_port_fdb(struct rocker_port *rocker_port,
 
 	fdb->learned = (flags & ROCKER_OP_FLAG_LEARNED);
 	fdb->touched = jiffies;
-	fdb->key.pport = rocker_port->pport;
+	fdb->key.rocker_port = rocker_port;
 	ether_addr_copy(fdb->key.addr, addr);
 	fdb->key.vlan_id = vlan_id;
 	fdb->key_crc32 = crc32(~0, &fdb->key, sizeof(fdb->key));
@@ -3686,7 +3686,7 @@ static int rocker_port_fdb_flush(struct rocker_port *rocker_port,
 	spin_lock_irqsave(&rocker->fdb_tbl_lock, lock_flags);
 
 	hash_for_each_safe(rocker->fdb_tbl, bkt, tmp, found, entry) {
-		if (found->key.pport != rocker_port->pport)
+		if (found->key.rocker_port != rocker_port)
 			continue;
 		if (!found->learned)
 			continue;
@@ -4553,7 +4553,7 @@ static int rocker_port_fdb_dump(const struct rocker_port *rocker_port,
 
 	spin_lock_irqsave(&rocker->fdb_tbl_lock, lock_flags);
 	hash_for_each_safe(rocker->fdb_tbl, bkt, tmp, found, entry) {
-		if (found->key.pport != rocker_port->pport)
+		if (found->key.rocker_port != rocker_port)
 			continue;
 		fdb->addr = found->key.addr;
 		fdb->ndm_state = NUD_REACHABLE;
-- 
1.7.10.4

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

* [PATCH net-next v2 3/7] bridge: define some min/max/default ageing time constants
  2015-09-20 15:48 [PATCH net-next v2 0/7] bridge: don't age out externally added FDB entries sfeldma
  2015-09-20 15:48 ` [PATCH net-next v2 1/7] rocker: track when FDB entry is touched sfeldma
  2015-09-20 15:48 ` [PATCH net-next v2 2/7] rocker: store rocker_port in fdb key rather than pport sfeldma
@ 2015-09-20 15:48 ` sfeldma
  2015-09-21  6:49   ` Jiri Pirko
  2015-09-20 15:48 ` [PATCH net-next v2 4/7] rocker: adding port ageing_time for ageing out FDB entries sfeldma
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 11+ messages in thread
From: sfeldma @ 2015-09-20 15:48 UTC (permalink / raw)
  To: netdev
  Cc: jiri, siva.mannem.lnx, pjonnala, stephen, roopa, andrew,
	f.fainelli, vivien.didelot

From: Scott Feldman <sfeldma@gmail.com>

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
---
v2: Per Jiri review comment: add BR_DEFAULT_AGEING_TIME to defines

 include/linux/if_bridge.h |    6 ++++++
 net/bridge/br_device.c    |    2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
index dad8b00..a338a68 100644
--- a/include/linux/if_bridge.h
+++ b/include/linux/if_bridge.h
@@ -46,6 +46,12 @@ struct br_ip_list {
 #define BR_LEARNING_SYNC	BIT(9)
 #define BR_PROXYARP_WIFI	BIT(10)
 
+/* values as per ieee8021QBridgeFdbAgingTime */
+#define BR_MIN_AGEING_TIME	(10 * HZ)
+#define BR_MAX_AGEING_TIME	(1000000 * HZ)
+
+#define BR_DEFAULT_AGEING_TIME	(300 * HZ)
+
 extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *));
 
 typedef int br_should_route_hook_t(struct sk_buff *skb);
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index 6ed2feb..2f81624 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -391,7 +391,7 @@ void br_dev_setup(struct net_device *dev)
 	br->bridge_max_age = br->max_age = 20 * HZ;
 	br->bridge_hello_time = br->hello_time = 2 * HZ;
 	br->bridge_forward_delay = br->forward_delay = 15 * HZ;
-	br->ageing_time = 300 * HZ;
+	br->ageing_time = BR_DEFAULT_AGEING_TIME;
 
 	br_netfilter_rtable_init(br);
 	br_stp_timer_init(br);
-- 
1.7.10.4

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

* [PATCH net-next v2 4/7] rocker: adding port ageing_time for ageing out FDB entries
  2015-09-20 15:48 [PATCH net-next v2 0/7] bridge: don't age out externally added FDB entries sfeldma
                   ` (2 preceding siblings ...)
  2015-09-20 15:48 ` [PATCH net-next v2 3/7] bridge: define some min/max/default ageing time constants sfeldma
@ 2015-09-20 15:48 ` sfeldma
  2015-09-21  6:49   ` Jiri Pirko
  2015-09-20 15:48 ` [PATCH net-next v2 5/7] rocker: add FDB cleanup timer sfeldma
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 11+ messages in thread
From: sfeldma @ 2015-09-20 15:48 UTC (permalink / raw)
  To: netdev
  Cc: jiri, siva.mannem.lnx, pjonnala, stephen, roopa, andrew,
	f.fainelli, vivien.didelot

From: Scott Feldman <sfeldma@gmail.com>

Follow-up patcheset will allow user to change ageing_time, but for now
just hard-code it to a fixed value (the same value used as the default
for the bridge driver).

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
---
 drivers/net/ethernet/rocker/rocker.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
index f55ed2c..be8bb04 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -221,6 +221,7 @@ struct rocker_port {
 	__be16 internal_vlan_id;
 	int stp_state;
 	u32 brport_flags;
+	unsigned long ageing_time;
 	bool ctrls[ROCKER_CTRL_MAX];
 	unsigned long vlan_bitmap[ROCKER_VLAN_BITMAP_LEN];
 	struct napi_struct napi_tx;
@@ -4975,6 +4976,7 @@ static int rocker_probe_port(struct rocker *rocker, unsigned int port_number)
 	rocker_port->port_number = port_number;
 	rocker_port->pport = port_number + 1;
 	rocker_port->brport_flags = BR_LEARNING | BR_LEARNING_SYNC;
+	rocker_port->ageing_time = BR_DEFAULT_AGEING_TIME;
 	INIT_LIST_HEAD(&rocker_port->trans_mem);
 
 	rocker_port_dev_addr_init(rocker_port);
-- 
1.7.10.4

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

* [PATCH net-next v2 5/7] rocker: add FDB cleanup timer
  2015-09-20 15:48 [PATCH net-next v2 0/7] bridge: don't age out externally added FDB entries sfeldma
                   ` (3 preceding siblings ...)
  2015-09-20 15:48 ` [PATCH net-next v2 4/7] rocker: adding port ageing_time for ageing out FDB entries sfeldma
@ 2015-09-20 15:48 ` sfeldma
  2015-09-22  0:11   ` David Miller
  2015-09-20 15:48 ` [PATCH net-next v2 6/7] bridge: don't age externally added FDB entries sfeldma
  2015-09-20 15:48 ` [PATCH net-next v2 7/7] switchdev: update documentation on FDB ageing_time sfeldma
  6 siblings, 1 reply; 11+ messages in thread
From: sfeldma @ 2015-09-20 15:48 UTC (permalink / raw)
  To: netdev
  Cc: jiri, siva.mannem.lnx, pjonnala, stephen, roopa, andrew,
	f.fainelli, vivien.didelot

From: Scott Feldman <sfeldma@gmail.com>

Add a timer to each rocker switch to do FDB entry cleanup by ageing out
expired entries.  The timer scheduling algo is copied from the bridge
driver, for the most part, to keep the firing of the timer to a minimum.

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
---
 drivers/net/ethernet/rocker/rocker.c |   41 ++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
index be8bb04..e4e0278 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -248,6 +248,7 @@ struct rocker {
 	u64 flow_tbl_next_cookie;
 	DECLARE_HASHTABLE(group_tbl, 16);
 	spinlock_t group_tbl_lock;		/* for group tbl accesses */
+	struct timer_list fdb_cleanup_timer;
 	DECLARE_HASHTABLE(fdb_tbl, 16);
 	spinlock_t fdb_tbl_lock;		/* for fdb tbl accesses */
 	unsigned long internal_vlan_bitmap[ROCKER_INTERNAL_VLAN_BITMAP_LEN];
@@ -3706,6 +3707,41 @@ err_out:
 	return err;
 }
 
+static void rocker_fdb_cleanup(unsigned long data)
+{
+	struct rocker *rocker = (struct rocker *)data;
+	struct rocker_port *rocker_port;
+	struct rocker_fdb_tbl_entry *entry;
+	struct hlist_node *tmp;
+	unsigned long next_timer = jiffies + BR_MIN_AGEING_TIME;
+	unsigned long expires;
+	unsigned long lock_flags;
+	int flags = ROCKER_OP_FLAG_NOWAIT | ROCKER_OP_FLAG_REMOVE |
+		    ROCKER_OP_FLAG_LEARNED;
+	int bkt;
+
+	spin_lock_irqsave(&rocker->fdb_tbl_lock, lock_flags);
+
+	hash_for_each_safe(rocker->fdb_tbl, bkt, tmp, entry, entry) {
+		if (!entry->learned)
+			continue;
+		rocker_port = entry->key.rocker_port;
+		expires = entry->touched + rocker_port->ageing_time;
+		if (time_before_eq(expires, jiffies)) {
+			rocker_port_fdb_learn(rocker_port, SWITCHDEV_TRANS_NONE,
+					      flags, entry->key.addr,
+					      entry->key.vlan_id);
+			hash_del(&entry->entry);
+		} else if (time_before(expires, next_timer)) {
+			next_timer = expires;
+		}
+	}
+
+	spin_unlock_irqrestore(&rocker->fdb_tbl_lock, lock_flags);
+
+	mod_timer(&rocker->fdb_cleanup_timer, round_jiffies_up(next_timer));
+}
+
 static int rocker_port_router_mac(struct rocker_port *rocker_port,
 				  enum switchdev_trans trans, int flags,
 				  __be16 vlan_id)
@@ -5191,6 +5227,10 @@ static int rocker_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		goto err_init_tbls;
 	}
 
+	setup_timer(&rocker->fdb_cleanup_timer, rocker_fdb_cleanup,
+		    (unsigned long) rocker);
+	mod_timer(&rocker->fdb_cleanup_timer, jiffies);
+
 	err = rocker_probe_ports(rocker);
 	if (err) {
 		dev_err(&pdev->dev, "failed to probe ports\n");
@@ -5203,6 +5243,7 @@ static int rocker_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	return 0;
 
 err_probe_ports:
+	del_timer(&rocker->fdb_cleanup_timer);
 	rocker_free_tbls(rocker);
 err_init_tbls:
 	free_irq(rocker_msix_vector(rocker, ROCKER_MSIX_VEC_EVENT), rocker);
-- 
1.7.10.4

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

* [PATCH net-next v2 6/7] bridge: don't age externally added FDB entries
  2015-09-20 15:48 [PATCH net-next v2 0/7] bridge: don't age out externally added FDB entries sfeldma
                   ` (4 preceding siblings ...)
  2015-09-20 15:48 ` [PATCH net-next v2 5/7] rocker: add FDB cleanup timer sfeldma
@ 2015-09-20 15:48 ` sfeldma
  2015-09-20 15:48 ` [PATCH net-next v2 7/7] switchdev: update documentation on FDB ageing_time sfeldma
  6 siblings, 0 replies; 11+ messages in thread
From: sfeldma @ 2015-09-20 15:48 UTC (permalink / raw)
  To: netdev
  Cc: jiri, siva.mannem.lnx, pjonnala, stephen, roopa, andrew,
	f.fainelli, vivien.didelot

From: Siva Mannem <siva.mannem.lnx@gmail.com>

Signed-off-by: Siva Mannem <siva.mannem.lnx@gmail.com>
Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Acked-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
---
 net/bridge/br_fdb.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index 9e9875d..6663cc0 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -299,6 +299,8 @@ void br_fdb_cleanup(unsigned long _data)
 			unsigned long this_timer;
 			if (f->is_static)
 				continue;
+			if (f->added_by_external_learn)
+				continue;
 			this_timer = f->updated + delay;
 			if (time_before_eq(this_timer, jiffies))
 				fdb_delete(br, f);
-- 
1.7.10.4

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

* [PATCH net-next v2 7/7] switchdev: update documentation on FDB ageing_time
  2015-09-20 15:48 [PATCH net-next v2 0/7] bridge: don't age out externally added FDB entries sfeldma
                   ` (5 preceding siblings ...)
  2015-09-20 15:48 ` [PATCH net-next v2 6/7] bridge: don't age externally added FDB entries sfeldma
@ 2015-09-20 15:48 ` sfeldma
  6 siblings, 0 replies; 11+ messages in thread
From: sfeldma @ 2015-09-20 15:48 UTC (permalink / raw)
  To: netdev
  Cc: jiri, siva.mannem.lnx, pjonnala, stephen, roopa, andrew,
	f.fainelli, vivien.didelot

From: Scott Feldman <sfeldma@gmail.com>

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
---
 Documentation/networking/switchdev.txt |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/Documentation/networking/switchdev.txt b/Documentation/networking/switchdev.txt
index 476df04..67e43ee 100644
--- a/Documentation/networking/switchdev.txt
+++ b/Documentation/networking/switchdev.txt
@@ -239,20 +239,20 @@ The driver should initialize the attributes to the hardware defaults.
 FDB Ageing
 ^^^^^^^^^^
 
-There are two FDB ageing models supported: 1) ageing by the device, and 2)
-ageing by the kernel.  Ageing by the device is preferred if many FDB entries
-are supported.  The driver calls call_switchdev_notifiers(SWITCHDEV_FDB_DEL,
-...) to age out the FDB entry.  In this model, ageing by the kernel should be
-turned off.  XXX: how to turn off ageing in kernel on a per-port basis or
-otherwise prevent the kernel from ageing out the FDB entry?
-
-In the kernel ageing model, the standard bridge ageing mechanism is used to age
-out stale FDB entries.  To keep an FDB entry "alive", the driver should refresh
-the FDB entry by calling call_switchdev_notifiers(SWITCHDEV_FDB_ADD, ...).  The
+The bridge will skip ageing FDB entries marked with NTF_EXT_LEARNED and it is
+the responsibility of the port driver/device to age out these entries.  If the
+port device supports ageing, when the FDB entry expires, it will notify the
+driver which in turn will notify the bridge with SWITCHDEV_FDB_DEL.  If the
+device does not support ageing, the driver can simulate ageing using a
+garbage collection timer to monitor FBD entries.  Expired entries will be
+notified to the bridge using SWITCHDEV_FDB_DEL.  See rocker driver for
+example of driver running ageing timer.
+
+To keep an NTF_EXT_LEARNED entry "alive", the driver should refresh the FDB
+entry by calling call_switchdev_notifiers(SWITCHDEV_FDB_ADD, ...).  The
 notification will reset the FDB entry's last-used time to now.  The driver
 should rate limit refresh notifications, for example, no more than once a
-second.  If the FDB entry expires, fdb_delete is called to remove entry from
-the device.
+second.  (The last-used time is visible using the bridge -s fdb option).
 
 STP State Change on Port
 ^^^^^^^^^^^^^^^^^^^^^^^^
-- 
1.7.10.4

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

* Re: [PATCH net-next v2 3/7] bridge: define some min/max/default ageing time constants
  2015-09-20 15:48 ` [PATCH net-next v2 3/7] bridge: define some min/max/default ageing time constants sfeldma
@ 2015-09-21  6:49   ` Jiri Pirko
  0 siblings, 0 replies; 11+ messages in thread
From: Jiri Pirko @ 2015-09-21  6:49 UTC (permalink / raw)
  To: sfeldma
  Cc: netdev, siva.mannem.lnx, pjonnala, stephen, roopa, andrew,
	f.fainelli, vivien.didelot

Sun, Sep 20, 2015 at 05:48:25PM CEST, sfeldma@gmail.com wrote:
>From: Scott Feldman <sfeldma@gmail.com>
>
>Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>

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

* Re: [PATCH net-next v2 4/7] rocker: adding port ageing_time for ageing out FDB entries
  2015-09-20 15:48 ` [PATCH net-next v2 4/7] rocker: adding port ageing_time for ageing out FDB entries sfeldma
@ 2015-09-21  6:49   ` Jiri Pirko
  0 siblings, 0 replies; 11+ messages in thread
From: Jiri Pirko @ 2015-09-21  6:49 UTC (permalink / raw)
  To: sfeldma
  Cc: netdev, siva.mannem.lnx, pjonnala, stephen, roopa, andrew,
	f.fainelli, vivien.didelot

Sun, Sep 20, 2015 at 05:48:26PM CEST, sfeldma@gmail.com wrote:
>From: Scott Feldman <sfeldma@gmail.com>
>
>Follow-up patcheset will allow user to change ageing_time, but for now
>just hard-code it to a fixed value (the same value used as the default
>for the bridge driver).
>
>Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>

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

* Re: [PATCH net-next v2 5/7] rocker: add FDB cleanup timer
  2015-09-20 15:48 ` [PATCH net-next v2 5/7] rocker: add FDB cleanup timer sfeldma
@ 2015-09-22  0:11   ` David Miller
  0 siblings, 0 replies; 11+ messages in thread
From: David Miller @ 2015-09-22  0:11 UTC (permalink / raw)
  To: sfeldma
  Cc: netdev, jiri, siva.mannem.lnx, pjonnala, stephen, roopa, andrew,
	f.fainelli, vivien.didelot

From: sfeldma@gmail.com
Date: Sun, 20 Sep 2015 08:48:27 -0700

> From: Scott Feldman <sfeldma@gmail.com>
> 
> Add a timer to each rocker switch to do FDB entry cleanup by ageing out
> expired entries.  The timer scheduling algo is copied from the bridge
> driver, for the most part, to keep the firing of the timer to a minimum.
> 
> Signed-off-by: Scott Feldman <sfeldma@gmail.com>
> Acked-by: Jiri Pirko <jiri@resnulli.us>

You need to del_timer_sync() or similar on this timer in
rocker_remove().

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

end of thread, other threads:[~2015-09-22  0:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-20 15:48 [PATCH net-next v2 0/7] bridge: don't age out externally added FDB entries sfeldma
2015-09-20 15:48 ` [PATCH net-next v2 1/7] rocker: track when FDB entry is touched sfeldma
2015-09-20 15:48 ` [PATCH net-next v2 2/7] rocker: store rocker_port in fdb key rather than pport sfeldma
2015-09-20 15:48 ` [PATCH net-next v2 3/7] bridge: define some min/max/default ageing time constants sfeldma
2015-09-21  6:49   ` Jiri Pirko
2015-09-20 15:48 ` [PATCH net-next v2 4/7] rocker: adding port ageing_time for ageing out FDB entries sfeldma
2015-09-21  6:49   ` Jiri Pirko
2015-09-20 15:48 ` [PATCH net-next v2 5/7] rocker: add FDB cleanup timer sfeldma
2015-09-22  0:11   ` David Miller
2015-09-20 15:48 ` [PATCH net-next v2 6/7] bridge: don't age externally added FDB entries sfeldma
2015-09-20 15:48 ` [PATCH net-next v2 7/7] switchdev: update documentation on FDB ageing_time sfeldma

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