mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
To: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com,
	"David S. Miller" <davem@davemloft.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Subject: [PATCH net-next v2 8/9] net: dsa: add cross-chip bridging operations
Date: Thu, 30 Mar 2017 17:37:14 -0400	[thread overview]
Message-ID: <20170330213715.9666-9-vivien.didelot@savoirfairelinux.com> (raw)
In-Reply-To: <20170330213715.9666-1-vivien.didelot@savoirfairelinux.com>

Introduce crosschip_bridge_{join,leave} operations in the dsa_switch_ops
structure, which can be used by switches supporting interconnection.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
 include/net/dsa.h |  8 ++++++++
 net/dsa/switch.c  | 12 ++++++------
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/include/net/dsa.h b/include/net/dsa.h
index 951b5e49e899..ffe56cc338fe 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -456,6 +456,14 @@ struct dsa_switch_ops {
 				   bool ingress);
 	void	(*port_mirror_del)(struct dsa_switch *ds, int port,
 				   struct dsa_mall_mirror_tc_entry *mirror);
+
+	/*
+	 * Cross-chip operations
+	 */
+	int	(*crosschip_bridge_join)(struct dsa_switch *ds, int sw_index,
+					 int port, struct net_device *br);
+	void	(*crosschip_bridge_leave)(struct dsa_switch *ds, int sw_index,
+					  int port, struct net_device *br);
 };
 
 struct dsa_switch_driver {
diff --git a/net/dsa/switch.c b/net/dsa/switch.c
index 7b6f38e5fef6..ca6e26e514f0 100644
--- a/net/dsa/switch.c
+++ b/net/dsa/switch.c
@@ -20,9 +20,9 @@ static int dsa_switch_bridge_join(struct dsa_switch *ds,
 	if (ds->index == info->sw_index && ds->ops->port_bridge_join)
 		return ds->ops->port_bridge_join(ds, info->port, info->br);
 
-	if (ds->index != info->sw_index)
-		dev_dbg(ds->dev, "crosschip DSA port %d.%d bridged to %s\n",
-			info->sw_index, info->port, netdev_name(info->br));
+	if (ds->index != info->sw_index && ds->ops->crosschip_bridge_join)
+		return ds->ops->crosschip_bridge_join(ds, info->sw_index,
+						      info->port, info->br);
 
 	return 0;
 }
@@ -33,9 +33,9 @@ static int dsa_switch_bridge_leave(struct dsa_switch *ds,
 	if (ds->index == info->sw_index && ds->ops->port_bridge_leave)
 		ds->ops->port_bridge_leave(ds, info->port, info->br);
 
-	if (ds->index != info->sw_index)
-		dev_dbg(ds->dev, "crosschip DSA port %d.%d unbridged from %s\n",
-			info->sw_index, info->port, netdev_name(info->br));
+	if (ds->index != info->sw_index && ds->ops->crosschip_bridge_leave)
+		ds->ops->crosschip_bridge_leave(ds, info->sw_index, info->port,
+						info->br);
 
 	return 0;
 }
-- 
2.12.1

  parent reply	other threads:[~2017-03-30 21:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30 21:37 [PATCH net-next v2 0/9] net: dsa: mv88e6xxx: program cross-chip bridging Vivien Didelot
2017-03-30 21:37 ` [PATCH net-next v2 1/9] net: dsa: mv88e6xxx: move PVT description in info Vivien Didelot
2017-03-30 21:37 ` [PATCH net-next v2 2/9] net: dsa: mv88e6xxx: use 4-bit port for PVT data Vivien Didelot
2017-03-31 16:33   ` Andrew Lunn
2017-03-30 21:37 ` [PATCH net-next v2 3/9] net: dsa: mv88e6xxx: program the PVT with all ones Vivien Didelot
2017-03-31 16:35   ` Andrew Lunn
2017-03-30 21:37 ` [PATCH net-next v2 4/9] net: dsa: mv88e6xxx: allocate the number of ports Vivien Didelot
2017-03-31 16:27   ` Andrew Lunn
2017-03-30 21:37 ` [PATCH net-next v2 5/9] net: dsa: mv88e6xxx: rework in-chip bridging Vivien Didelot
2017-03-30 21:37 ` [PATCH net-next v2 6/9] net: dsa: mv88e6xxx: factorize in-chip bridge map Vivien Didelot
2017-03-30 21:37 ` [PATCH net-next v2 7/9] net: dsa: mv88e6xxx: remap existing bridge members Vivien Didelot
2017-03-30 21:37 ` Vivien Didelot [this message]
2017-03-30 21:37 ` [PATCH net-next v2 9/9] net: dsa: mv88e6xxx: add cross-chip bridging Vivien Didelot
2017-03-31 16:39   ` Andrew Lunn
2017-03-31 16:55     ` Vivien Didelot
2017-03-31 17:09       ` Andrew Lunn
2017-03-31 17:27         ` Vivien Didelot
2017-04-01 19:23 ` [PATCH net-next v2 0/9] net: dsa: mv88e6xxx: program " 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=20170330213715.9666-9-vivien.didelot@savoirfairelinux.com \
    --to=vivien.didelot@savoirfairelinux.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kernel@savoirfairelinux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®