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


Groups > linux.kernel > #1245901 > unrolled thread

[PATCH net-next v2 3/6] net: dsa: mv88e6xxx: write MAC outside of ATU Get Next code

Started byVivien Didelot <vivien.didelot@savoirfairelinux.com>
First post2015-10-13 18:50 +0200
Last post2015-10-13 20:50 +0200
Articles 5 — 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 v2 3/6] net: dsa: mv88e6xxx: write MAC outside of ATU Get Next code Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2015-10-13 18:50 +0200
    Re: [PATCH net-next v2 3/6] net: dsa: mv88e6xxx: write MAC outside  of ATU Get Next code Florian Fainelli <f.fainelli@gmail.com> - 2015-10-13 19:40 +0200
      Re: [PATCH net-next v2 3/6] net: dsa: mv88e6xxx: write MAC outside  of ATU Get Next code Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2015-10-13 20:20 +0200
        Re: [PATCH net-next v2 3/6] net: dsa: mv88e6xxx: write MAC outside  of ATU Get Next code Florian Fainelli <f.fainelli@gmail.com> - 2015-10-13 20:50 +0200
    Re: [PATCH net-next v2 3/6] net: dsa: mv88e6xxx: write MAC outside  of ATU Get Next code Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2015-10-13 20:50 +0200

#1245901 — [PATCH net-next v2 3/6] net: dsa: mv88e6xxx: write MAC outside of ATU Get Next code

FromVivien Didelot <vivien.didelot@savoirfairelinux.com>
Date2015-10-13 18:50 +0200
Subject[PATCH net-next v2 3/6] net: dsa: mv88e6xxx: write MAC outside of ATU Get Next code
Message-ID<qjaVX-3T8-9@gated-at.bofh.it>
There is no need to write the MAC address before every Get Next
operation, since ATU MAC registers are not cleared between calls.

Move the _mv88e6xxx_atu_mac_write call outside of _mv88e6xxx_atu_getnext
so future code could call ATU Get Next multiple times and save a few
register access.
---
 drivers/net/dsa/mv88e6xxx.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
index 8c87b03..7b15b98 100644
--- a/drivers/net/dsa/mv88e6xxx.c
+++ b/drivers/net/dsa/mv88e6xxx.c
@@ -1751,7 +1751,6 @@ int mv88e6xxx_port_fdb_del(struct dsa_switch *ds, int port,
 }
 
 static int _mv88e6xxx_atu_getnext(struct dsa_switch *ds, u16 fid,
-				  const unsigned char *addr,
 				  struct mv88e6xxx_atu_entry *entry)
 {
 	struct mv88e6xxx_atu_entry next = { 0 };
@@ -1763,10 +1762,6 @@ static int _mv88e6xxx_atu_getnext(struct dsa_switch *ds, u16 fid,
 	if (ret < 0)
 		return ret;
 
-	ret = _mv88e6xxx_atu_mac_write(ds, addr);
-	if (ret < 0)
-		return ret;
-
 	ret = _mv88e6xxx_reg_write(ds, REG_GLOBAL, GLOBAL_ATU_FID, fid);
 	if (ret < 0)
 		return ret;
@@ -1827,7 +1822,11 @@ int mv88e6xxx_port_fdb_getnext(struct dsa_switch *ds, int port,
 			fid = vtu.fid;
 		}
 
-		ret = _mv88e6xxx_atu_getnext(ds, fid, addr, &next);
+		ret = _mv88e6xxx_atu_mac_write(ds, addr);
+		if (ret < 0)
+			goto unlock;
+
+		ret = _mv88e6xxx_atu_getnext(ds, fid, &next);
 		if (ret < 0)
 			goto unlock;
 
-- 
2.6.1

--
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/

[toc] | [next] | [standalone]


#1245961 — Re: [PATCH net-next v2 3/6] net: dsa: mv88e6xxx: write MAC outside of ATU Get Next code

FromFlorian Fainelli <f.fainelli@gmail.com>
Date2015-10-13 19:40 +0200
SubjectRe: [PATCH net-next v2 3/6] net: dsa: mv88e6xxx: write MAC outside of ATU Get Next code
Message-ID<qjbIl-53L-7@gated-at.bofh.it>
In reply to#1245901
On 13/10/15 09:46, Vivien Didelot wrote:
> There is no need to write the MAC address before every Get Next
> operation, since ATU MAC registers are not cleared between calls.
> 
> Move the _mv88e6xxx_atu_mac_write call outside of _mv88e6xxx_atu_getnext
> so future code could call ATU Get Next multiple times and save a few
> register access.

Missing SoB tag here.
-- 
Florian
--
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/

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


#1246022 — Re: [PATCH net-next v2 3/6] net: dsa: mv88e6xxx: write MAC outside of ATU Get Next code

FromVivien Didelot <vivien.didelot@savoirfairelinux.com>
Date2015-10-13 20:20 +0200
SubjectRe: [PATCH net-next v2 3/6] net: dsa: mv88e6xxx: write MAC outside of ATU Get Next code
Message-ID<qjcl4-642-15@gated-at.bofh.it>
In reply to#1245961
On Oct. Tuesday 13 (42) 10:35 AM, Florian Fainelli wrote:
> On 13/10/15 09:46, Vivien Didelot wrote:
> > There is no need to write the MAC address before every Get Next
> > operation, since ATU MAC registers are not cleared between calls.
> > 
> > Move the _mv88e6xxx_atu_mac_write call outside of _mv88e6xxx_atu_getnext
> > so future code could call ATU Get Next multiple times and save a few
> > register access.
> 
> Missing SoB tag here.

Damn, good catch. Can I add it in reply to the patch, or should I send a
v3?

Thanks,
-v
--
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/

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


#1246045 — Re: [PATCH net-next v2 3/6] net: dsa: mv88e6xxx: write MAC outside of ATU Get Next code

FromFlorian Fainelli <f.fainelli@gmail.com>
Date2015-10-13 20:50 +0200
SubjectRe: [PATCH net-next v2 3/6] net: dsa: mv88e6xxx: write MAC outside of ATU Get Next code
Message-ID<qjcO6-6Ct-11@gated-at.bofh.it>
In reply to#1246022
On 13/10/15 11:11, Vivien Didelot wrote:
> On Oct. Tuesday 13 (42) 10:35 AM, Florian Fainelli wrote:
>> On 13/10/15 09:46, Vivien Didelot wrote:
>>> There is no need to write the MAC address before every Get Next
>>> operation, since ATU MAC registers are not cleared between calls.
>>>
>>> Move the _mv88e6xxx_atu_mac_write call outside of _mv88e6xxx_atu_getnext
>>> so future code could call ATU Get Next multiple times and save a few
>>> register access.
>>
>> Missing SoB tag here.
> 
> Damn, good catch. Can I add it in reply to the patch, or should I send a
> v3?

I am fairly positive patchwork should be able to pick it up, so replying
to your patch might just do it fine.
-- 
Florian
--
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/

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


#1246042 — Re: [PATCH net-next v2 3/6] net: dsa: mv88e6xxx: write MAC outside of ATU Get Next code

FromVivien Didelot <vivien.didelot@savoirfairelinux.com>
Date2015-10-13 20:50 +0200
SubjectRe: [PATCH net-next v2 3/6] net: dsa: mv88e6xxx: write MAC outside of ATU Get Next code
Message-ID<qjcO5-6Ct-7@gated-at.bofh.it>
In reply to#1245901
On Oct. Tuesday 13 (42) 12:46 PM, Vivien Didelot wrote:
> There is no need to write the MAC address before every Get Next
> operation, since ATU MAC registers are not cleared between calls.
> 
> Move the _mv88e6xxx_atu_mac_write call outside of _mv88e6xxx_atu_getnext
> so future code could call ATU Get Next multiple times and save a few
> register access.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
--
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/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web