netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@mellanox.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:STAGING SUBSYSTEM" <devel@driverdev.osuosl.org>,
	"moderated list:ETHERNET BRIDGE"
	<bridge@lists.linux-foundation.org>,
	Jiri Pirko <jiri@mellanox.com>, "andrew@lunn.ch" <andrew@lunn.ch>,
	"vivien.didelot@gmail.com" <vivien.didelot@gmail.com>
Subject: Re: [PATCH net-next 4/8] mlxsw: spectrum_switchdev: Handle SWITCHDEV_PORT_ATTR_SET
Date: Sat, 23 Feb 2019 10:36:54 +0000	[thread overview]
Message-ID: <20190223103651.GC13070@splinter> (raw)
In-Reply-To: <20190222235927.10295-5-f.fainelli@gmail.com>

On Fri, Feb 22, 2019 at 03:59:22PM -0800, Florian Fainelli wrote:
> Following patches will change the way we communicate setting a port's
> attribute and use a notifier to perform those tasks.
> 
> Prepare mlxsw to support receiving notifier events targeting
> SWITCHDEV_PORT_ATTR_SET and utilize the switchdev_handle_port_attr_set()
> to handle stacking of devices.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  .../net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
> index 766f5b5f1cf5..c1aedfea3a31 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
> @@ -3123,6 +3123,13 @@ static int mlxsw_sp_switchdev_event(struct notifier_block *unused,
>  	struct net_device *br_dev;
>  	int err;
>  
> +	if (event == SWITCHDEV_PORT_ATTR_SET) {
> +		err = switchdev_handle_port_attr_set(dev, ptr,
> +						     mlxsw_sp_port_dev_check,
> +						     mlxsw_sp_port_attr_set);
> +		return notifier_from_errno(err);

I don't think this code is ever executed. And if it was executed, we
would have problems because switchdev_handle_port_attr_set() might
block.

> +	}
> +
>  	/* Tunnel devices are not our uppers, so check their master instead */
>  	br_dev = netdev_master_upper_dev_get_rcu(dev);
>  	if (!br_dev)
> @@ -3446,6 +3453,11 @@ static int mlxsw_sp_switchdev_blocking_event(struct notifier_block *unused,
>  							mlxsw_sp_port_dev_check,
>  							mlxsw_sp_port_obj_del);
>  		return notifier_from_errno(err);
> +	case SWITCHDEV_PORT_ATTR_SET:
> +		err = switchdev_handle_port_attr_set(dev, ptr,
> +						     mlxsw_sp_port_dev_check,
> +						     mlxsw_sp_port_attr_set);
> +		return notifier_from_errno(err);
>  	}
>  
>  	return NOTIFY_DONE;
> -- 
> 2.17.1
> 

  reply	other threads:[~2019-02-23 10:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22 23:59 [PATCH net-next 0/8] net: Remove switchdev_ops Florian Fainelli
2019-02-22 23:59 ` [PATCH net-next 1/8] switchdev: Add SWITCHDEV_PORT_ATTR_SET Florian Fainelli
2019-02-23 10:33   ` Ido Schimmel
2019-02-22 23:59 ` [PATCH net-next 2/8] rocker: Handle SWITCHDEV_PORT_ATTR_SET Florian Fainelli
2019-02-22 23:59 ` [PATCH net-next 3/8] net: dsa: " Florian Fainelli
2019-02-22 23:59 ` [PATCH net-next 4/8] mlxsw: spectrum_switchdev: " Florian Fainelli
2019-02-23 10:36   ` Ido Schimmel [this message]
2019-02-22 23:59 ` [PATCH net-next 5/8] net: mscc: ocelot: " Florian Fainelli
2019-02-22 23:59 ` [PATCH net-next 6/8] staging: fsl-dpaa2: ethsw: " Florian Fainelli
2019-02-22 23:59 ` [PATCH net-next 7/8] net: switchdev: Replace port attr set SDO with a notification Florian Fainelli
2019-02-23 10:32   ` Ido Schimmel
2019-02-24 16:47     ` Florian Fainelli
2019-02-25  9:49       ` Ido Schimmel
2019-02-25 19:47         ` Florian Fainelli
2019-02-27 12:32           ` Ido Schimmel
2019-02-22 23:59 ` [PATCH net-next 8/8] net: Remove switchdev_ops Florian Fainelli
2019-02-22 23:59 ` [PATCH 1/8] switchdev: Add SWITCHDEV_PORT_ATTR_SET Florian Fainelli

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=20190223103651.GC13070@splinter \
    --to=idosch@mellanox.com \
    --cc=andrew@lunn.ch \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=f.fainelli@gmail.com \
    --cc=jiri@mellanox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@gmail.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;
as well as URLs for NNTP newsgroup(s).