Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1598465 > unrolled thread

[PATCH net-next v2 12/17] net: dsa: add dsa_is_normal_port helper

Started byVivien Didelot <vivien.didelot@savoirfairelinux.com>
First post2017-03-11 22:20 +0100
Last post2017-03-13 16:00 +0100
Articles 4 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH net-next v2 12/17] net: dsa: add dsa_is_normal_port helper Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-03-11 22:20 +0100
    Re: [PATCH net-next v2 12/17] net: dsa: add dsa_is_normal_port helper Andrew Lunn <andrew@lunn.ch> - 2017-03-12 01:00 +0100
    Re: [PATCH net-next v2 12/17] net: dsa: add dsa_is_normal_port helper Florian Fainelli <f.fainelli@gmail.com> - 2017-03-12 03:20 +0100
      Re: [PATCH net-next v2 12/17] net: dsa: add dsa_is_normal_port helper Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-03-13 16:00 +0100

#1598465 — [PATCH net-next v2 12/17] net: dsa: add dsa_is_normal_port helper

FromVivien Didelot <vivien.didelot@savoirfairelinux.com>
Date2017-03-11 22:20 +0100
Subject[PATCH net-next v2 12/17] net: dsa: add dsa_is_normal_port helper
Message-ID<tjWAG-8vE-9@gated-at.bofh.it>
Introduce a dsa_is_normal_port helper to check if a given port is a
normal user port as opposed to a CPU port or DSA link.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
 include/net/dsa.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/net/dsa.h b/include/net/dsa.h
index 4e13e695f025..bf0e42c2a6f7 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -248,6 +248,11 @@ static inline bool dsa_is_dsa_port(struct dsa_switch *ds, int p)
 	return !!((ds->dsa_port_mask) & (1 << p));
 }
 
+static inline bool dsa_is_normal_port(struct dsa_switch *ds, int p)
+{
+	return !dsa_is_cpu_port(ds, p) && !dsa_is_dsa_port(ds, p);
+}
+
 static inline bool dsa_is_port_initialized(struct dsa_switch *ds, int p)
 {
 	return ds->enabled_port_mask & (1 << p) && ds->ports[p].netdev;
-- 
2.12.0

[toc] | [next] | [standalone]


#1598509

FromAndrew Lunn <andrew@lunn.ch>
Date2017-03-12 01:00 +0100
Message-ID<tjZ5v-1EP-11@gated-at.bofh.it>
In reply to#1598465
On Sat, Mar 11, 2017 at 04:12:58PM -0500, Vivien Didelot wrote:
> Introduce a dsa_is_normal_port helper to check if a given port is a
> normal user port as opposed to a CPU port or DSA link.
> 
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

[toc] | [prev] | [next] | [standalone]


#1598528

FromFlorian Fainelli <f.fainelli@gmail.com>
Date2017-03-12 03:20 +0100
Message-ID<tk1gZ-3eX-1@gated-at.bofh.it>
In reply to#1598465
Le 03/11/17 à 13:12, Vivien Didelot a écrit :
> Introduce a dsa_is_normal_port helper to check if a given port is a
> normal user port as opposed to a CPU port or DSA link.

net/dsa/dsa2.c uses the "user" terminology should we use something like
that here?

> 
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> ---
>  include/net/dsa.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/include/net/dsa.h b/include/net/dsa.h
> index 4e13e695f025..bf0e42c2a6f7 100644
> --- a/include/net/dsa.h
> +++ b/include/net/dsa.h
> @@ -248,6 +248,11 @@ static inline bool dsa_is_dsa_port(struct dsa_switch *ds, int p)
>  	return !!((ds->dsa_port_mask) & (1 << p));
>  }
>  
> +static inline bool dsa_is_normal_port(struct dsa_switch *ds, int p)
> +{
> +	return !dsa_is_cpu_port(ds, p) && !dsa_is_dsa_port(ds, p);
> +}
> +
>  static inline bool dsa_is_port_initialized(struct dsa_switch *ds, int p)
>  {
>  	return ds->enabled_port_mask & (1 << p) && ds->ports[p].netdev;
> 


-- 
Florian

[toc] | [prev] | [next] | [standalone]


#1599490

FromVivien Didelot <vivien.didelot@savoirfairelinux.com>
Date2017-03-13 16:00 +0100
Message-ID<tkzC2-1Yl-29@gated-at.bofh.it>
In reply to#1598528
Hi Florian,

Florian Fainelli <f.fainelli@gmail.com> writes:

> Le 03/11/17 à 13:12, Vivien Didelot a écrit :
>> Introduce a dsa_is_normal_port helper to check if a given port is a
>> normal user port as opposed to a CPU port or DSA link.
>
> net/dsa/dsa2.c uses the "user" terminology should we use something like
> that here?

I used the one suggested by Andrew, but I wouldn't mind using "user"
here if it makes more sense.

Thanks,

        Vivien

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web