All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	idosch@mellanox.com, linux-kernel@vger.kernel.org,
	devel@driverdev.osuosl.org, bridge@lists.linux-foundation.org,
	jiri@mellanox.com, andrew@lunn.ch, vivien.didelot@gmail.com
Subject: [PATCH net-next v2 07/16] net: Remove SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT
Date: Sun, 10 Feb 2019 09:50:56 -0800	[thread overview]
Message-ID: <20190210175105.31629-8-f.fainelli@gmail.com> (raw)
In-Reply-To: <20190210175105.31629-1-f.fainelli@gmail.com>

Now that we have converted the bridge code and the drivers to check for
bridge port(s) flags at the time we try to set them, there is no need
for a get() -> set() sequence anymore and
SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT therefore becomes unused.

Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 .../net/ethernet/mellanox/mlxsw/spectrum_switchdev.c   |  4 ----
 drivers/net/ethernet/rocker/rocker_main.c              |  4 ----
 drivers/staging/fsl-dpaa2/ethsw/ethsw.c                |  3 ---
 include/net/switchdev.h                                |  2 --
 net/dsa/slave.c                                        | 10 +---------
 5 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
index 468a6d513074..8242a373f6e7 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
@@ -455,10 +455,6 @@ static int mlxsw_sp_port_attr_get(struct net_device *dev,
 		mlxsw_sp_port_bridge_flags_get(mlxsw_sp->bridge, attr->orig_dev,
 					       &attr->u.brport_flags);
 		break;
-	case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT:
-		attr->u.brport_flags_support = BR_LEARNING | BR_FLOOD |
-					       BR_MCAST_FLOOD;
-		break;
 	default:
 		return -EOPNOTSUPP;
 	}
diff --git a/drivers/net/ethernet/rocker/rocker_main.c b/drivers/net/ethernet/rocker/rocker_main.c
index 8657313b6f30..375c4c908bea 100644
--- a/drivers/net/ethernet/rocker/rocker_main.c
+++ b/drivers/net/ethernet/rocker/rocker_main.c
@@ -2075,10 +2075,6 @@ static int rocker_port_attr_get(struct net_device *dev,
 		err = rocker_world_port_attr_bridge_flags_get(rocker_port,
 							      &attr->u.brport_flags);
 		break;
-	case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT:
-		err = rocker_world_port_attr_bridge_flags_support_get(rocker_port,
-								      &attr->u.brport_flags_support);
-		break;
 	default:
 		return -EOPNOTSUPP;
 	}
diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
index 6228c4375835..79635d1091df 100644
--- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
+++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
@@ -651,9 +651,6 @@ static int swdev_port_attr_get(struct net_device *netdev,
 			(port_priv->ethsw_data->learning ? BR_LEARNING : 0) |
 			(port_priv->flood ? BR_FLOOD : 0);
 		break;
-	case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT:
-		attr->u.brport_flags_support = BR_LEARNING | BR_FLOOD;
-		break;
 	default:
 		return -EOPNOTSUPP;
 	}
diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index 5e87b54c5dc5..e2083824e577 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -45,7 +45,6 @@ enum switchdev_attr_id {
 	SWITCHDEV_ATTR_ID_UNDEFINED,
 	SWITCHDEV_ATTR_ID_PORT_STP_STATE,
 	SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS,
-	SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT,
 	SWITCHDEV_ATTR_ID_PORT_MROUTER,
 	SWITCHDEV_ATTR_ID_BRIDGE_AGEING_TIME,
 	SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING,
@@ -62,7 +61,6 @@ struct switchdev_attr {
 	union {
 		u8 stp_state;				/* PORT_STP_STATE */
 		unsigned long brport_flags;		/* PORT_BRIDGE_FLAGS */
-		unsigned long brport_flags_support;	/* PORT_BRIDGE_FLAGS_SUPPORT */
 		bool mrouter;				/* PORT_MROUTER */
 		clock_t ageing_time;			/* BRIDGE_AGEING_TIME */
 		bool vlan_filtering;			/* BRIDGE_VLAN_FILTERING */
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 9b499ba88aa7..7b33be6f1954 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -385,15 +385,7 @@ static int dsa_slave_get_port_parent_id(struct net_device *dev,
 static int dsa_slave_port_attr_get(struct net_device *dev,
 				   struct switchdev_attr *attr)
 {
-	switch (attr->id) {
-	case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT:
-		attr->u.brport_flags_support = 0;
-		break;
-	default:
-		return -EOPNOTSUPP;
-	}
-
-	return 0;
+	return -EOPNOTSUPP;
 }
 
 static inline netdev_tx_t dsa_slave_netpoll_send_skb(struct net_device *dev,
-- 
2.19.1


WARNING: multiple messages have this Message-ID (diff)
From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Cc: devel@driverdev.osuosl.org, andrew@lunn.ch,
	Florian Fainelli <f.fainelli@gmail.com>,
	bridge@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
	idosch@mellanox.com, jiri@mellanox.com, vivien.didelot@gmail.com
Subject: [Bridge] [PATCH net-next v2 07/16] net: Remove SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT
Date: Sun, 10 Feb 2019 09:50:56 -0800	[thread overview]
Message-ID: <20190210175105.31629-8-f.fainelli@gmail.com> (raw)
In-Reply-To: <20190210175105.31629-1-f.fainelli@gmail.com>

Now that we have converted the bridge code and the drivers to check for
bridge port(s) flags at the time we try to set them, there is no need
for a get() -> set() sequence anymore and
SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT therefore becomes unused.

Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 .../net/ethernet/mellanox/mlxsw/spectrum_switchdev.c   |  4 ----
 drivers/net/ethernet/rocker/rocker_main.c              |  4 ----
 drivers/staging/fsl-dpaa2/ethsw/ethsw.c                |  3 ---
 include/net/switchdev.h                                |  2 --
 net/dsa/slave.c                                        | 10 +---------
 5 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
index 468a6d513074..8242a373f6e7 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
@@ -455,10 +455,6 @@ static int mlxsw_sp_port_attr_get(struct net_device *dev,
 		mlxsw_sp_port_bridge_flags_get(mlxsw_sp->bridge, attr->orig_dev,
 					       &attr->u.brport_flags);
 		break;
-	case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT:
-		attr->u.brport_flags_support = BR_LEARNING | BR_FLOOD |
-					       BR_MCAST_FLOOD;
-		break;
 	default:
 		return -EOPNOTSUPP;
 	}
diff --git a/drivers/net/ethernet/rocker/rocker_main.c b/drivers/net/ethernet/rocker/rocker_main.c
index 8657313b6f30..375c4c908bea 100644
--- a/drivers/net/ethernet/rocker/rocker_main.c
+++ b/drivers/net/ethernet/rocker/rocker_main.c
@@ -2075,10 +2075,6 @@ static int rocker_port_attr_get(struct net_device *dev,
 		err = rocker_world_port_attr_bridge_flags_get(rocker_port,
 							      &attr->u.brport_flags);
 		break;
-	case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT:
-		err = rocker_world_port_attr_bridge_flags_support_get(rocker_port,
-								      &attr->u.brport_flags_support);
-		break;
 	default:
 		return -EOPNOTSUPP;
 	}
diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
index 6228c4375835..79635d1091df 100644
--- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
+++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
@@ -651,9 +651,6 @@ static int swdev_port_attr_get(struct net_device *netdev,
 			(port_priv->ethsw_data->learning ? BR_LEARNING : 0) |
 			(port_priv->flood ? BR_FLOOD : 0);
 		break;
-	case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT:
-		attr->u.brport_flags_support = BR_LEARNING | BR_FLOOD;
-		break;
 	default:
 		return -EOPNOTSUPP;
 	}
diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index 5e87b54c5dc5..e2083824e577 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -45,7 +45,6 @@ enum switchdev_attr_id {
 	SWITCHDEV_ATTR_ID_UNDEFINED,
 	SWITCHDEV_ATTR_ID_PORT_STP_STATE,
 	SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS,
-	SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT,
 	SWITCHDEV_ATTR_ID_PORT_MROUTER,
 	SWITCHDEV_ATTR_ID_BRIDGE_AGEING_TIME,
 	SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING,
@@ -62,7 +61,6 @@ struct switchdev_attr {
 	union {
 		u8 stp_state;				/* PORT_STP_STATE */
 		unsigned long brport_flags;		/* PORT_BRIDGE_FLAGS */
-		unsigned long brport_flags_support;	/* PORT_BRIDGE_FLAGS_SUPPORT */
 		bool mrouter;				/* PORT_MROUTER */
 		clock_t ageing_time;			/* BRIDGE_AGEING_TIME */
 		bool vlan_filtering;			/* BRIDGE_VLAN_FILTERING */
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 9b499ba88aa7..7b33be6f1954 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -385,15 +385,7 @@ static int dsa_slave_get_port_parent_id(struct net_device *dev,
 static int dsa_slave_port_attr_get(struct net_device *dev,
 				   struct switchdev_attr *attr)
 {
-	switch (attr->id) {
-	case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT:
-		attr->u.brport_flags_support = 0;
-		break;
-	default:
-		return -EOPNOTSUPP;
-	}
-
-	return 0;
+	return -EOPNOTSUPP;
 }
 
 static inline netdev_tx_t dsa_slave_netpoll_send_skb(struct net_device *dev,
-- 
2.19.1


  parent reply	other threads:[~2019-02-10 17:54 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-10 17:50 [PATCH net-next v2 00/16] net: Remove switchdev_ops Florian Fainelli
2019-02-10 17:50 ` [Bridge] " Florian Fainelli
2019-02-10 17:50 ` [PATCH net-next v2 01/16] Documentation: networking: switchdev: Update port parent ID section Florian Fainelli
2019-02-10 17:50   ` [Bridge] " Florian Fainelli
2019-02-10 17:50 ` [PATCH net-next v2 02/16] mlxsw: spectrum: Check bridge flags during prepare phase Florian Fainelli
2019-02-10 17:50   ` [Bridge] " Florian Fainelli
2019-02-10 17:50 ` [PATCH net-next v2 03/16] staging: fsl-dpaa2: ethsw: Check bridge port flags during set Florian Fainelli
2019-02-10 17:50   ` [Bridge] " Florian Fainelli
2019-02-10 17:50 ` [PATCH net-next v2 04/16] net: dsa: Add setter for SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS Florian Fainelli
2019-02-10 17:50   ` [Bridge] " Florian Fainelli
2019-02-10 17:50 ` [PATCH net-next v2 05/16] rocker: Check bridge flags during prepare phase Florian Fainelli
2019-02-10 17:50   ` [Bridge] " Florian Fainelli
2019-02-10 17:50 ` [PATCH net-next v2 06/16] net: bridge: Stop calling switchdev_port_attr_get() Florian Fainelli
2019-02-10 17:50   ` [Bridge] " Florian Fainelli
2019-02-10 19:05   ` Ido Schimmel
2019-02-10 19:05     ` [Bridge] " Ido Schimmel
2019-02-10 19:34     ` Florian Fainelli
2019-02-10 19:34       ` [Bridge] " Florian Fainelli
2019-02-12 14:20       ` Ido Schimmel
2019-02-12 14:20         ` [Bridge] " Ido Schimmel
2019-02-10 17:50 ` Florian Fainelli [this message]
2019-02-10 17:50   ` [Bridge] [PATCH net-next v2 07/16] net: Remove SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT Florian Fainelli
2019-02-10 17:50 ` [PATCH net-next v2 08/16] net: Get rid of switchdev_port_attr_get() Florian Fainelli
2019-02-10 17:50   ` [Bridge] " Florian Fainelli
2019-02-10 17:50 ` [PATCH net-next v2 09/16] switchdev: Add SWITCHDEV_PORT_ATTR_SET Florian Fainelli
2019-02-10 17:50   ` [Bridge] " Florian Fainelli
2019-02-10 17:50 ` [PATCH net-next v2 10/16] rocker: Handle SWITCHDEV_PORT_ATTR_SET Florian Fainelli
2019-02-10 17:50   ` [Bridge] " Florian Fainelli
2019-02-10 17:51 ` [PATCH net-next v2 11/16] net: dsa: " Florian Fainelli
2019-02-10 17:51   ` [Bridge] " Florian Fainelli
2019-02-10 17:51 ` [PATCH net-next v2 12/16] mlxsw: spectrum_switchdev: " Florian Fainelli
2019-02-10 17:51   ` [Bridge] " Florian Fainelli
2019-02-10 17:51 ` [PATCH net-next v2 13/16] net: mscc: ocelot: " Florian Fainelli
2019-02-10 17:51   ` [Bridge] " Florian Fainelli
2019-02-10 17:51 ` [PATCH net-next v2 14/16] staging: fsl-dpaa2: ethsw: " Florian Fainelli
2019-02-10 17:51   ` [Bridge] " Florian Fainelli
2019-02-10 17:51 ` [PATCH net-next v2 15/16] net: switchdev: Replace port attr set SDO with a notification Florian Fainelli
2019-02-10 17:51   ` [Bridge] " Florian Fainelli
2019-02-10 17:51 ` [PATCH net-next v2 16/16] net: Remove switchdev_ops Florian Fainelli
2019-02-10 17:51   ` [Bridge] " Florian Fainelli
2019-02-10 20:44 ` [PATCH net-next v2 00/16] " Florian Fainelli
2019-02-10 20:44   ` [Bridge] " Florian Fainelli
2019-02-10 20:51   ` David Miller
2019-02-10 20:51     ` [Bridge] " David Miller

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=20190210175105.31629-8-f.fainelli@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=bridge@lists.linux-foundation.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=idosch@mellanox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.