Ethernet Bridge development
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Cc: ivecera@redhat.com, jiri@resnulli.us, netdev@vger.kernel.org,
	bridge@lists.linux-foundation.org,
	sergey.matyukevich.os@quantenna.com, ashevchenko@quantenna.com,
	smaksimenko@quantenna.com, dlebed@quantenna.com
Subject: Re: [Bridge] [PATCH net-next 2/5] bridge: propagate BR_ flags updates through sysfs to switchdev
Date: Sat, 10 Mar 2018 17:38:38 +0100	[thread overview]
Message-ID: <20180310163838.GG29174@lunn.ch> (raw)
In-Reply-To: <20180310030308.12947-3-igor.mitsyanko.os@quantenna.com>

On Fri, Mar 09, 2018 at 07:03:05PM -0800, Igor Mitsyanko wrote:
> sysfs interface to configure bridge flags only updates SW copy but does
> not notify hardware through switchdev interface. Make sure it is.
> 
> Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
> ---
>  net/bridge/br_sysfs_if.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/net/bridge/br_sysfs_if.c b/net/bridge/br_sysfs_if.c
> index 126a8ea..9bdd177 100644
> --- a/net/bridge/br_sysfs_if.c
> +++ b/net/bridge/br_sysfs_if.c
> @@ -51,6 +51,7 @@ static int store_flag(struct net_bridge_port *p, unsigned long v,
>  		      unsigned long mask)
>  {
>  	unsigned long flags;
> +	int err;
>  
>  	flags = p->flags;
>  
> @@ -59,10 +60,16 @@ static int store_flag(struct net_bridge_port *p, unsigned long v,
>  	else
>  		flags &= ~mask;
>  
> -	if (flags != p->flags) {
> -		p->flags = flags;
> -		br_port_flags_change(p, mask);
> -	}
> +	if (flags == p->flags)
> +		return 0;
> +
> +	err = br_switchdev_set_port_flag(p, flags, mask);
> +	if (err)
> +		return err;

You might want to consider the br_warn() in
br_switchdev_set_port_flag(). Do we want to spam the kernel log?  Or
should store_flag() do some validation before calling
br_switchdev_set_port_flag()?

	Andrew

  reply	other threads:[~2018-03-10 16:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-10  3:03 [Bridge] [PATCH net-next 0/5] Switchdev: flooding offload option Igor Mitsyanko
2018-03-10  3:03 ` [Bridge] [PATCH net-next 1/5] bridge: initialize port flags with switchdev defaults Igor Mitsyanko
2018-03-10 16:30   ` Andrew Lunn
2018-03-12 18:44     ` Igor Mitsyanko
2018-03-10 16:32   ` Stephen Hemminger
2018-03-12 19:03     ` Igor Mitsyanko
2018-03-10  3:03 ` [Bridge] [PATCH net-next 2/5] bridge: propagate BR_ flags updates through sysfs to switchdev Igor Mitsyanko
2018-03-10 16:38   ` Andrew Lunn [this message]
2018-03-12 20:07     ` Igor Mitsyanko
2018-03-10  3:03 ` [Bridge] [RFC PATCH net-next 3/5] bridge: allow switchdev port to handle flooding by itself Igor Mitsyanko
2018-03-10 16:55   ` Andrew Lunn
2018-03-12 23:00     ` Igor Mitsyanko
2018-03-13  1:11       ` Andrew Lunn
2018-03-13 14:41         ` Roopa Prabhu
2018-03-10  3:03 ` [Bridge] [RFC PATCH net-next 4/5] bridge: provide sysfs and netlink interface to set BR_FLOOD_OFFLOAD Igor Mitsyanko
2018-03-10  3:03 ` [Bridge] [RFC PATCH net-next 5/5] bridge: verify "HW only" flags can't be set without HW support Igor Mitsyanko
2018-03-10 22:08 ` [Bridge] [PATCH net-next 0/5] Switchdev: flooding offload option Andrew Lunn
2018-03-12 23:08   ` Igor Mitsyanko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180310163838.GG29174@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=ashevchenko@quantenna.com \
    --cc=bridge@lists.linux-foundation.org \
    --cc=dlebed@quantenna.com \
    --cc=igor.mitsyanko.os@quantenna.com \
    --cc=ivecera@redhat.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=sergey.matyukevich.os@quantenna.com \
    --cc=smaksimenko@quantenna.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox