lkml.org 
[lkml]   [2019]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next 05/17] net: dsa: Add more convenient functions for installing port VLANs
On Sun, Mar 31, 2019 at 08:42:20PM +0300, Vladimir Oltean wrote:
> This hides the need to perform a two-phase transaction and construct a
> switchdev_obj_port_vlan struct.
>
> Call graph (including a function that will be introduced in a follow-up
> patch) looks like this now (same for the *_vlan_del function):
>
> dsa_slave_vlan_rx_add_vid dsa_port_setup_8021q_tagging
> | |
> | |
> | +-------------+
> | |
> v v
> __dsa_port_vlan_add dsa_slave_port_obj_add
> | |
> +-------+ +-------+
> | |
> v v
> dsa_port_vlan_add
>
> Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
> ---
> net/dsa/dsa_priv.h | 2 ++
> net/dsa/port.c | 31 +++++++++++++++++++++++++++++++
> net/dsa/slave.c | 16 ++--------------
> 3 files changed, 35 insertions(+), 14 deletions(-)
>
> diff --git a/net/dsa/dsa_priv.h b/net/dsa/dsa_priv.h
> index 093b7d145eb1..766d015f6f38 100644
> --- a/net/dsa/dsa_priv.h
> +++ b/net/dsa/dsa_priv.h
> @@ -169,6 +169,8 @@ int dsa_port_vlan_add(struct dsa_port *dp,
> struct switchdev_trans *trans);
> int dsa_port_vlan_del(struct dsa_port *dp,
> const struct switchdev_obj_port_vlan *vlan);
> +int __dsa_port_vlan_add(struct dsa_port *dp, u16 vid, u16 flags);
> +int __dsa_port_vlan_del(struct dsa_port *dp, u16 vid);
> int dsa_port_link_register_of(struct dsa_port *dp);
> void dsa_port_link_unregister_of(struct dsa_port *dp);
>
> diff --git a/net/dsa/port.c b/net/dsa/port.c
> index a86fe3be1261..10065a622ada 100644
> --- a/net/dsa/port.c
> +++ b/net/dsa/port.c
> @@ -326,6 +326,37 @@ int dsa_port_vlan_del(struct dsa_port *dp,
> return 0;
> }
>
> +int __dsa_port_vlan_add(struct dsa_port *dp, u16 vid, u16 flags)
> +{

Hi Vladimir

Maybe call this dsa_port_vlan_add_trans()?

I don't like the __, especially when the symbol is not static.

Andrew

\
 
 \ /
  Last update: 2019-04-02 22:55    [W:2.904 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site