Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1207151
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH net-next 1/7] net: dsa: add support for switchdev VLAN objects |
| Date | 2015-08-13 22:30 +0200 |
| Message-ID | <pX7ip-5FI-5@gated-at.bofh.it> (permalink) |
| References | <pX41b-Hx-3@gated-at.bofh.it> <pX41d-Hx-51@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, Aug 13, 2015 at 12:52:17PM -0400, Vivien Didelot wrote:
> Add new functions in DSA drivers to access hardware VLAN entries through
> SWITCHDEV_OBJ_PORT_VLAN objects:
>
> - port_pvid_get() and vlan_getnext() to dump a VLAN
> - port_vlan_del() to exclude a port from a VLAN
> - port_pvid_set() and port_vlan_add() to join a port to a VLAN
>
> The DSA infrastructure will ensure that each VLAN of the given range
> does not already belong to another bridge. If it does, it will fallback
> to software VLAN and won't program the hardware.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> ---
> include/net/dsa.h | 11 ++++
> net/dsa/slave.c | 158 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 169 insertions(+)
>
> diff --git a/include/net/dsa.h b/include/net/dsa.h
> index 6356f43..bd9b765 100644
> --- a/include/net/dsa.h
> +++ b/include/net/dsa.h
> @@ -298,6 +298,17 @@ struct dsa_switch_driver {
> u8 state);
>
> /*
> + * VLAN support
> + */
> + int (*port_pvid_get)(struct dsa_switch *ds, int port, u16 *pvid);
> + int (*port_pvid_set)(struct dsa_switch *ds, int port, u16 pvid);
> + int (*port_vlan_add)(struct dsa_switch *ds, int port, u16 vid,
> + bool untagged);
> + int (*port_vlan_del)(struct dsa_switch *ds, int port, u16 vid);
> @@ -794,6 +949,9 @@ static const struct net_device_ops dsa_slave_netdev_ops = {
> .ndo_netpoll_cleanup = dsa_slave_netpoll_cleanup,
> .ndo_poll_controller = dsa_slave_poll_controller,
> #endif
> + .ndo_bridge_getlink = switchdev_port_bridge_getlink,
> + .ndo_bridge_setlink = switchdev_port_bridge_setlink,
> + .ndo_bridge_dellink = switchdev_port_bridge_dellink,
> };
Do these changes belong here?
Thanks
Andrew
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH net-next 1/7] net: dsa: add support for switchdev VLAN objects Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2015-08-13 19:00 +0200
Re: [PATCH net-next 1/7] net: dsa: add support for switchdev VLAN objects Andrew Lunn <andrew@lunn.ch> - 2015-08-13 22:30 +0200
Re: [PATCH net-next 1/7] net: dsa: add support for switchdev VLAN objects Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2015-08-13 23:10 +0200
Re: [PATCH net-next 1/7] net: dsa: add support for switchdev VLAN objects Andrew Lunn <andrew@lunn.ch> - 2015-08-14 03:10 +0200
csiph-web