Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1367540

Re: [PATCH] bridge: Allow set bridge ageing time when switchdev disabled

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH] bridge: Allow set bridge ageing time when switchdev disabled
Date 2016-03-30 21:50 +0200
Message-ID <riuhQ-1Jv-13@gated-at.bofh.it> (permalink)
References <rhZnH-4Qd-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
Date: Tue, 29 Mar 2016 18:48:08 +0800

> When NET_SWITCHDEV=n, switchdev_port_attr_set will return -EOPNOTSUPP,
> we should ignore this error code and continue to set the ageing time.
> 
> Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>

Applied and queued up for -stable, thanks.

> @@ -582,7 +582,7 @@ int br_set_ageing_time(struct net_bridge *br, u32 ageing_time)
>  	int err;
>  
>  	err = switchdev_port_attr_set(br->dev, &attr);
> -	if (err)
> +	if (err && err != -EOPNOTSUPP)
>  		return err;
>  
>  	br->ageing_time = t;

This is at least the 5th time I've had to apply a bug fix exactly like
this one.

If this doesn't convince everyone that this whole -EOPNOTSUPP
mechanism is extremely error prone, I don't know what will.

There should be only one or two strictly controlled locations that
reinterpret the return value from all of these routines that have this
special way of signalling lack of switchdev support via -EOPNOTSUPP.

It can't be spread all over the place like this, it simply does NOT work.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] bridge: Allow set bridge ageing time when switchdev disabled Haishuang Yan <yanhaishuang@cmss.chinamobile.com> - 2016-03-29 12:50 +0200
  Re: [PATCH] bridge: Allow set bridge ageing time when switchdev  disabled Ido Schimmel <idosch@mellanox.com> - 2016-03-30 00:10 +0200
  Re: [PATCH] bridge: Allow set bridge ageing time when switchdev  disabled David Miller <davem@davemloft.net> - 2016-03-30 21:50 +0200

csiph-web