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


Groups > linux.kernel > #1742275 > unrolled thread

[PATCH net-next 2/8] net: dsa: directly fetch switch in lan9303_rcv

Started byVivien Didelot <vivien.didelot@savoirfairelinux.com>
First post2017-09-29 20:50 +0200
Last post2017-09-29 21:10 +0200
Articles 3 — 2 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 2/8] net: dsa: directly fetch switch in lan9303_rcv Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-09-29 20:50 +0200
    Re: [PATCH net-next 2/8] net: dsa: directly fetch switch in  lan9303_rcv Florian Fainelli <f.fainelli@gmail.com> - 2017-09-29 21:10 +0200
      Re: [PATCH net-next 2/8] net: dsa: directly fetch switch in lan9303_rcv Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-09-29 21:10 +0200

#1742275 — [PATCH net-next 2/8] net: dsa: directly fetch switch in lan9303_rcv

FromVivien Didelot <vivien.didelot@savoirfairelinux.com>
Date2017-09-29 20:50 +0200
Subject[PATCH net-next 2/8] net: dsa: directly fetch switch in lan9303_rcv
Message-ID<uv8wh-1rx-7@gated-at.bofh.it>
In a single-chip switch fabric, there is no need to fetch the dsa_switch
structure from the tree, directly use the CPU port's "ds" member.

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

diff --git a/net/dsa/tag_lan9303.c b/net/dsa/tag_lan9303.c
index 0b9826105e42..f0b51acf36ac 100644
--- a/net/dsa/tag_lan9303.c
+++ b/net/dsa/tag_lan9303.c
@@ -72,11 +72,10 @@ static struct sk_buff *lan9303_rcv(struct sk_buff *skb, struct net_device *dev,
 {
 	u16 *lan9303_tag;
 	struct dsa_switch_tree *dst = dev->dsa_ptr;
-	struct dsa_switch *ds;
+	struct dsa_port *cpu_dp = dst->cpu_dp;
+	struct dsa_switch *ds = cpu_dp->ds;
 	unsigned int source_port;
 
-	ds = dst->ds[0];
-
 	if (unlikely(!ds)) {
 		dev_warn_ratelimited(&dev->dev, "Dropping packet, due to missing DSA switch device\n");
 		return NULL;
-- 
2.14.1

[toc] | [next] | [standalone]


#1742291 — Re: [PATCH net-next 2/8] net: dsa: directly fetch switch in lan9303_rcv

FromFlorian Fainelli <f.fainelli@gmail.com>
Date2017-09-29 21:10 +0200
SubjectRe: [PATCH net-next 2/8] net: dsa: directly fetch switch in lan9303_rcv
Message-ID<uv8PD-1NK-3@gated-at.bofh.it>
In reply to#1742275
On 09/29/2017 11:36 AM, Vivien Didelot wrote:
> In a single-chip switch fabric, there is no need to fetch the dsa_switch
> structure from the tree, directly use the CPU port's "ds" member.
> 
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> ---
>  net/dsa/tag_lan9303.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/net/dsa/tag_lan9303.c b/net/dsa/tag_lan9303.c
> index 0b9826105e42..f0b51acf36ac 100644
> --- a/net/dsa/tag_lan9303.c
> +++ b/net/dsa/tag_lan9303.c
> @@ -72,11 +72,10 @@ static struct sk_buff *lan9303_rcv(struct sk_buff *skb, struct net_device *dev,
>  {
>  	u16 *lan9303_tag;
>  	struct dsa_switch_tree *dst = dev->dsa_ptr;
> -	struct dsa_switch *ds;
> +	struct dsa_port *cpu_dp = dst->cpu_dp;
> +	struct dsa_switch *ds = cpu_dp->ds;
>  	unsigned int source_port;
>  
> -	ds = dst->ds[0];
> -
>  	if (unlikely(!ds)) {
>  		dev_warn_ratelimited(&dev->dev, "Dropping packet, due to missing DSA switch device\n");
>  		return NULL;

Similarly to the patch before, you can probably drop this test, I don't
actually see how we could trigger it.
-- 
Florian

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


#1742293

FromVivien Didelot <vivien.didelot@savoirfairelinux.com>
Date2017-09-29 21:10 +0200
Message-ID<uv8PD-1NK-11@gated-at.bofh.it>
In reply to#1742291
Hi Florian,

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

>> @@ -72,11 +72,10 @@ static struct sk_buff *lan9303_rcv(struct sk_buff *skb, struct net_device *dev,
>>  {
>>  	u16 *lan9303_tag;
>>  	struct dsa_switch_tree *dst = dev->dsa_ptr;
>> -	struct dsa_switch *ds;
>> +	struct dsa_port *cpu_dp = dst->cpu_dp;
>> +	struct dsa_switch *ds = cpu_dp->ds;
>>  	unsigned int source_port;
>>  
>> -	ds = dst->ds[0];
>> -
>>  	if (unlikely(!ds)) {
>>  		dev_warn_ratelimited(&dev->dev, "Dropping packet, due to missing DSA switch device\n");
>>  		return NULL;
>
> Similarly to the patch before, you can probably drop this test, I don't
> actually see how we could trigger it.

Good catch, I'll respin after eventually more reviews.


Thanks,

        Vivien

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web