[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54E3A0D5.5020801@roeck-us.net>
Date: Tue, 17 Feb 2015 12:13:09 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: Florian Fainelli <f.fainelli@...il.com>, netdev@...r.kernel.org
CC: davem@...emloft.net, vivien.didelot@...oirfairelinux.com,
jerome.oufella@...oirfairelinux.com, andrew@...n.ch,
cphealy@...il.com
Subject: Re: [PATCH RFC 1/2] net: dsa: integrate with SWITCHDEV for HW bridging
On 02/17/2015 11:26 AM, Florian Fainelli wrote:
> In order to support bridging offloads in DSA switch drivers, select
> NET_SWITCHDEV to get access to the port_stp_update and parent_get_id
> NDOs that we are required to implement.
>
> To facilitate the integratation at the DSA driver level, we implement 3
> types of operations:
>
> - port_join_bridge
> - port_leave_bridge
> - port_stp_update
>
> DSA will resolve which switch ports that are currently bridge port
> members as some Switch hardware/drivers need to know about that to limit
> the register programming to just the relevant registers (especially for
> slow MDIO buses).
>
> Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
> ---
> include/net/dsa.h | 10 +++++
> net/dsa/Kconfig | 1 +
> net/dsa/dsa.c | 7 ++++
> net/dsa/dsa_priv.h | 2 +
> net/dsa/slave.c | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++
> 5 files changed, 137 insertions(+)
>
> diff --git a/include/net/dsa.h b/include/net/dsa.h
> index ed3c34bbb67a..92be34791963 100644
> --- a/include/net/dsa.h
> +++ b/include/net/dsa.h
> @@ -275,6 +275,16 @@ struct dsa_switch_driver {
> int (*get_regs_len)(struct dsa_switch *ds, int port);
> void (*get_regs)(struct dsa_switch *ds, int port,
> struct ethtool_regs *regs, void *p);
> +
> + /*
> + * Bridge integration
> + */
> + int (*port_join_bridge)(struct dsa_switch *ds, int port,
> + u32 br_port_mask);
> + int (*port_leave_bridge)(struct dsa_switch *ds, int port,
> + u32 br_port_mask);
> + int (*port_stp_update)(struct dsa_switch *ds, int port,
> + u8 state);
> };
>
> void register_switch_driver(struct dsa_switch_driver *type);
> diff --git a/net/dsa/Kconfig b/net/dsa/Kconfig
> index 5f8ac404535b..b45206e8dd3e 100644
> --- a/net/dsa/Kconfig
> +++ b/net/dsa/Kconfig
> @@ -8,6 +8,7 @@ config NET_DSA
> tristate
> depends on HAVE_NET_DSA
> select PHYLIB
> + select NET_SWITCHDEV
Should this be "select" or "depends on" ?
Downside of depends is that we'll need some ifdefs in the code,
but on the other side it would let people disable it if it is
not needed.
Thanks,
Guenter
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists