linux-kernel.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 v2 8/8] net: Remove switchdev_ops
Date: Wed, 27 Feb 2019 13:13:14 +0000	[thread overview]
Message-ID: <20190227131312.GA17964@splinter> (raw)
In-Reply-To: <20190227011427.16487-9-f.fainelli@gmail.com>

On Tue, Feb 26, 2019 at 05:14:27PM -0800, Florian Fainelli wrote:
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
> index b00f6f74f91a..995426ea9a43 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
> @@ -3660,7 +3660,6 @@ static int mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u8 local_port,
>  	}
>  	mlxsw_sp_port->default_vlan = mlxsw_sp_port_vlan;
>  
> -	mlxsw_sp_port_switchdev_init(mlxsw_sp_port);
>  	mlxsw_sp->ports[local_port] = mlxsw_sp_port;
>  	err = register_netdev(dev);
>  	if (err) {
> @@ -3677,7 +3676,6 @@ static int mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u8 local_port,
>  
>  err_register_netdev:
>  	mlxsw_sp->ports[local_port] = NULL;
> -	mlxsw_sp_port_switchdev_fini(mlxsw_sp_port);
>  	mlxsw_sp_port_vlan_destroy(mlxsw_sp_port_vlan);
>  err_port_vlan_create:
>  err_port_pvid_set:
> @@ -3720,7 +3718,6 @@ static void mlxsw_sp_port_remove(struct mlxsw_sp *mlxsw_sp, u8 local_port)
>  	mlxsw_core_port_clear(mlxsw_sp->core, local_port, mlxsw_sp);
>  	unregister_netdev(mlxsw_sp_port->dev); /* This calls ndo_stop */
>  	mlxsw_sp->ports[local_port] = NULL;
> -	mlxsw_sp_port_switchdev_fini(mlxsw_sp_port);
>  	mlxsw_sp_port_vlan_flush(mlxsw_sp_port, true);
>  	mlxsw_sp_port_nve_fini(mlxsw_sp_port);
>  	mlxsw_sp_tc_qdisc_fini(mlxsw_sp_port);
> @@ -4441,12 +4438,6 @@ static int mlxsw_sp_init(struct mlxsw_core *mlxsw_core,
>  		goto err_span_init;
>  	}
>  
> -	err = mlxsw_sp_switchdev_init(mlxsw_sp);

I missed that and got a trace as soon as I tried to enslave a port. You
should only remove mlxsw_sp_port_switchdev_init() and not
mlxsw_sp_switchdev_init()

> -	if (err) {
> -		dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize switchdev\n");
> -		goto err_switchdev_init;
> -	}
> -
>  	err = mlxsw_sp_counter_pool_init(mlxsw_sp);
>  	if (err) {
>  		dev_err(mlxsw_sp->bus_info->dev, "Failed to init counter pool\n");
> @@ -4517,8 +4508,6 @@ static int mlxsw_sp_init(struct mlxsw_core *mlxsw_core,
>  err_afa_init:
>  	mlxsw_sp_counter_pool_fini(mlxsw_sp);
>  err_counter_pool_init:
> -	mlxsw_sp_switchdev_fini(mlxsw_sp);
> -err_switchdev_init:
>  	mlxsw_sp_span_fini(mlxsw_sp);
>  err_span_init:
>  	mlxsw_sp_lag_fini(mlxsw_sp);
> @@ -4585,7 +4574,6 @@ static void mlxsw_sp_fini(struct mlxsw_core *mlxsw_core)
>  	mlxsw_sp_nve_fini(mlxsw_sp);
>  	mlxsw_sp_afa_fini(mlxsw_sp);
>  	mlxsw_sp_counter_pool_fini(mlxsw_sp);
> -	mlxsw_sp_switchdev_fini(mlxsw_sp);
>  	mlxsw_sp_span_fini(mlxsw_sp);
>  	mlxsw_sp_lag_fini(mlxsw_sp);
>  	mlxsw_sp_buffers_fini(mlxsw_sp);
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
> index a61c1130d9e3..da6278b0caa4 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
> @@ -407,8 +407,6 @@ extern const struct mlxsw_sp_sb_vals mlxsw_sp2_sb_vals;
>  /* spectrum_switchdev.c */
>  int mlxsw_sp_switchdev_init(struct mlxsw_sp *mlxsw_sp);
>  void mlxsw_sp_switchdev_fini(struct mlxsw_sp *mlxsw_sp);
> -void mlxsw_sp_port_switchdev_init(struct mlxsw_sp_port *mlxsw_sp_port);
> -void mlxsw_sp_port_switchdev_fini(struct mlxsw_sp_port *mlxsw_sp_port);
>  int mlxsw_sp_rif_fdb_op(struct mlxsw_sp *mlxsw_sp, const char *mac, u16 fid,
>  			bool adding);
>  void
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
> index c1aedfea3a31..f6ce386c3036 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
> @@ -1938,10 +1938,6 @@ static struct mlxsw_sp_port *mlxsw_sp_lag_rep_port(struct mlxsw_sp *mlxsw_sp,
>  	return NULL;
>  }
>  
> -static const struct switchdev_ops mlxsw_sp_port_switchdev_ops = {
> -	.switchdev_port_attr_set	= mlxsw_sp_port_attr_set,
> -};
> -
>  static int
>  mlxsw_sp_bridge_8021q_port_join(struct mlxsw_sp_bridge_device *bridge_device,
>  				struct mlxsw_sp_bridge_port *bridge_port,
> @@ -3545,11 +3541,3 @@ void mlxsw_sp_switchdev_fini(struct mlxsw_sp *mlxsw_sp)
>  	kfree(mlxsw_sp->bridge);
>  }
>  
> -void mlxsw_sp_port_switchdev_init(struct mlxsw_sp_port *mlxsw_sp_port)
> -{
> -	mlxsw_sp_port->dev->switchdev_ops = &mlxsw_sp_port_switchdev_ops;
> -}
> -
> -void mlxsw_sp_port_switchdev_fini(struct mlxsw_sp_port *mlxsw_sp_port)
> -{
> -}

      parent reply	other threads:[~2019-02-27 13:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-27  1:14 [PATCH net-next v2 0/8] net: Remove switchdev_ops Florian Fainelli
2019-02-27  1:14 ` [PATCH net-next v2 1/8] switchdev: Add SWITCHDEV_PORT_ATTR_SET Florian Fainelli
2019-02-27 12:30   ` Ido Schimmel
2019-02-27  1:14 ` [PATCH net-next v2 2/8] rocker: Handle SWITCHDEV_PORT_ATTR_SET Florian Fainelli
2019-02-27  1:14 ` [PATCH net-next v2 3/8] net: dsa: " Florian Fainelli
2019-02-27  1:14 ` [PATCH net-next v2 4/8] mlxsw: spectrum_switchdev: " Florian Fainelli
2019-02-27 12:30   ` Ido Schimmel
2019-02-27  1:14 ` [PATCH net-next v2 5/8] net: mscc: ocelot: " Florian Fainelli
2019-02-27  1:14 ` [PATCH net-next v2 6/8] staging: fsl-dpaa2: ethsw: " Florian Fainelli
2019-02-27  1:14 ` [PATCH net-next v2 7/8] net: switchdev: Replace port attr set SDO with a notification Florian Fainelli
2019-02-27 12:28   ` Ido Schimmel
2019-02-27  1:14 ` [PATCH net-next v2 8/8] net: Remove switchdev_ops Florian Fainelli
2019-02-27 12:30   ` Ido Schimmel
2019-02-27 13:13   ` Ido Schimmel [this message]

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=20190227131312.GA17964@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).