mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
bridge: allow zero ageing time
[ Upstream commit4c656c13b2] This fixes a regression in the bridge ageing time caused by: commitc62987bbd8("bridge: push bridge setting ageing_time down to switchdev") There are users of Linux bridge which use the feature that if ageing time is set to 0 it causes entries to never expire. See: https://www.linuxfoundation.org/collaborate/workgroups/networking/bridge For a pure software bridge, it is unnecessary for the code to have arbitrary restrictions on what values are allowable. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f48c2d6d84
commit
eee4e8dbed
@@ -46,10 +46,6 @@ struct br_ip_list {
|
|||||||
#define BR_LEARNING_SYNC BIT(9)
|
#define BR_LEARNING_SYNC BIT(9)
|
||||||
#define BR_PROXYARP_WIFI BIT(10)
|
#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)
|
#define BR_DEFAULT_AGEING_TIME (300 * HZ)
|
||||||
|
|
||||||
extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *));
|
extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *));
|
||||||
|
|||||||
@@ -568,6 +568,14 @@ int br_set_max_age(struct net_bridge *br, unsigned long val)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Set time interval that dynamic forwarding entries live
|
||||||
|
* For pure software bridge, allow values outside the 802.1
|
||||||
|
* standard specification for special cases:
|
||||||
|
* 0 - entry never ages (all permanant)
|
||||||
|
* 1 - entry disappears (no persistance)
|
||||||
|
*
|
||||||
|
* Offloaded switch entries maybe more restrictive
|
||||||
|
*/
|
||||||
int br_set_ageing_time(struct net_bridge *br, u32 ageing_time)
|
int br_set_ageing_time(struct net_bridge *br, u32 ageing_time)
|
||||||
{
|
{
|
||||||
struct switchdev_attr attr = {
|
struct switchdev_attr attr = {
|
||||||
@@ -579,9 +587,6 @@ int br_set_ageing_time(struct net_bridge *br, u32 ageing_time)
|
|||||||
unsigned long t = clock_t_to_jiffies(ageing_time);
|
unsigned long t = clock_t_to_jiffies(ageing_time);
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (t < BR_MIN_AGEING_TIME || t > BR_MAX_AGEING_TIME)
|
|
||||||
return -ERANGE;
|
|
||||||
|
|
||||||
err = switchdev_port_attr_set(br->dev, &attr);
|
err = switchdev_port_attr_set(br->dev, &attr);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|||||||
Reference in New Issue
Block a user