Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1613506
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH net-next v2 8/9] net: dsa: add cross-chip bridging operations |
| Date | 2017-03-30 23:50 +0200 |
| Message-ID | <tqQ79-42d-41@gated-at.bofh.it> (permalink) |
| References | <tqQ77-42d-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH net-next v2 0/9] net: dsa: mv88e6xxx: program cross-chip bridging Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-03-30 23:50 +0200
[PATCH net-next v2 2/9] net: dsa: mv88e6xxx: use 4-bit port for PVT data Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-03-30 23:50 +0200
Re: [PATCH net-next v2 2/9] net: dsa: mv88e6xxx: use 4-bit port for PVT data Andrew Lunn <andrew@lunn.ch> - 2017-03-31 18:40 +0200
[PATCH net-next v2 9/9] net: dsa: mv88e6xxx: add cross-chip bridging Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-03-30 23:50 +0200
Re: [PATCH net-next v2 9/9] net: dsa: mv88e6xxx: add cross-chip bridging Andrew Lunn <andrew@lunn.ch> - 2017-03-31 18:50 +0200
Re: [PATCH net-next v2 9/9] net: dsa: mv88e6xxx: add cross-chip bridging Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-03-31 19:00 +0200
Re: [PATCH net-next v2 9/9] net: dsa: mv88e6xxx: add cross-chip bridging Andrew Lunn <andrew@lunn.ch> - 2017-03-31 19:20 +0200
Re: [PATCH net-next v2 9/9] net: dsa: mv88e6xxx: add cross-chip bridging Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-03-31 19:30 +0200
[PATCH net-next v2 5/9] net: dsa: mv88e6xxx: rework in-chip bridging Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-03-30 23:50 +0200
[PATCH net-next v2 6/9] net: dsa: mv88e6xxx: factorize in-chip bridge map Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-03-30 23:50 +0200
[PATCH net-next v2 8/9] net: dsa: add cross-chip bridging operations Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-03-30 23:50 +0200
Re: [PATCH net-next v2 0/9] net: dsa: mv88e6xxx: program cross-chip bridging David Miller <davem@davemloft.net> - 2017-04-01 21:30 +0200
csiph-web