Subject: Re: [PATCH net-next v4 2/3] newly configured FDB ageing time becomes effective immediately

From: Sergei Shtylyov <[email-masked]>
Date: Tue, 17 Mar 2015 17:41:47 +0300

Hello.

On 3/17/2015 2:02 AM, Siva Mannem wrote:

> This patch ensures that the newly configured FDB ageing time becomes effective
> immediately. It also makes the behavior consistent when the ageing_timer is set
> using any of the three existing mechanisms(sysfs, ioctl, netlink).

> Signed-off-by: Siva Mannem <[email-masked]>
> Suggested-by: Scott Feldman <[email-masked]>
> ---
>   net/bridge/br_device.c   | 4 ++++
>   net/bridge/br_ioctl.c    | 3 +--
>   net/bridge/br_sysfs_br.c | 8 +-------
>   3 files changed, 6 insertions(+), 9 deletions(-)

> diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
> index 1a665aa..293a113 100644
> --- a/net/bridge/br_device.c
> +++ b/net/bridge/br_device.c
> @@ -396,12 +396,16 @@ void br_dev_setup(struct net_device *dev)
>   int br_set_ageing_time(struct net_bridge *br, unsigned long val)
>   {
>   	unsigned long t = clock_t_to_jiffies(val);
> +	unsigned long old_ageing_time;
>
>   	if (t < BR_MIN_AGEING_TIME || t > BR_MAX_AGEING_TIME)
>   		return -ERANGE;
>
>   	spin_lock_bh(&br->lock);
> +	old_ageing_time =  br->ageing_time;

    One space is enough after '='...

>   	br->ageing_time = t;
> +	if (br->ageing_time < old_ageing_time)

    Isn't it enough to compare just 't' instead of 'br->ageing_time'?

> +		mod_timer(&br->gc_timer, jiffies);
>   	spin_unlock_bh(&br->lock);
>   	return 0;
>   }
[...]

WBR, Sergei