RE: [PATCH RFC 6/6] Modify tag_ksz.c to support other KSZ switch drivers

2017-09-18 Thread Tristram.Ha
Sorry for the late response. > > diff --git a/net/dsa/tag_ksz.c b/net/dsa/tag_ksz.c index 010ca0a..d5faf14 > 100644 > > --- a/net/dsa/tag_ksz.c > > +++ b/net/dsa/tag_ksz.c > > static struct sk_buff *ksz_xmit(struct sk_buff *skb, struct net_device > *dev) { > > struct dsa_slave_priv *p =

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-18 Thread Tristram.Ha
> > +/** > > + * Some counters do not need to be read too often because they are less > likely > > + * to increase much. > > + */ > > What does comment mean? Are you caching statistics, and updating > different values at different rates? > There are 34 counters. In normal case using generic

RE: [PATCH RFC 6/6] Modify tag_ksz.c to support other KSZ switch drivers

2017-09-18 Thread Tristram.Ha
> > > This is ugly. We have a clean separation between a switch driver and a > > > tag driver. Here you are mixing them together. Don't. Look at the > > > mailing lists for what Florian and I suggested to Pavel. It will also > > > solve your include file issue above. > > > > It seems to me all

RE: [PATCH RFC 6/6] Modify tag_ksz.c to support other KSZ switch drivers

2017-09-18 Thread Tristram.Ha
> I am not really sure why this is such a concern for you so soon when > your driver is not even included yet. You should really aim for baby > steps here: get the basic driver(s) included, with a limited set of > features, and gradually add more features to the driver. When > fwd_offload_mark and

RE: [PATCH RFC 6/6] Modify tag_ksz.c to support other KSZ switch drivers

2017-09-18 Thread Tristram.Ha
> > In the old DSA implementation all the ports are partitioned into its own > device > > and the bridge joining them will do all the forwarding. This is useful for > quick > > testing with some protocols like RSTP but it is probably useless for real > > operation. > > It is a good minimal

[PATCH v1 RFC 5/7] Break KSZ9477 DSA driver into two files

2017-10-06 Thread Tristram.Ha
From: Tristram Ha Break KSZ9477 DSA driver into two files in preparation to add more KSZ switch drivers. Add common functions in ksz_common.h so that other KSZ switch drivers can access code in ksz_common.c. Add ksz_spi.h for common functions used by KSZ switch SPI

[PATCH v1 RFC 4/7] Rename ksz_spi.c to ksz9477_spi.c

2017-10-06 Thread Tristram.Ha
From: Tristram Ha Rename ksz_spi.c to ksz9477_spi.c and update Kconfig in preparation to add more KSZ switch drivers. Signed-off-by: Tristram Ha --- drivers/net/dsa/microchip/Kconfig | 12 ++--

[PATCH v1 RFC 3/7] Rename some functions with ksz9477 prefix

2017-10-06 Thread Tristram.Ha
From: Tristram Ha Rename some functions with ksz9477 prefix to separate chip specific code from common code. Signed-off-by: Tristram Ha --- drivers/net/dsa/microchip/ksz_common.c | 116 + 1 file changed, 59

[PATCH v1 RFC 1/1] Add Microchip KSZ8795 DSA driver

2017-10-06 Thread Tristram.Ha
From: Tristram Ha Add Microchip KSZ8795 DSA driver. Signed-off-by: Tristram Ha --- drivers/net/dsa/microchip/Kconfig | 17 + drivers/net/dsa/microchip/Makefile |2 + drivers/net/dsa/microchip/ksz8795.c | 1372

[PATCH v1 RFC 6/7] Add MIB counter reading support

2017-10-06 Thread Tristram.Ha
From: Tristram Ha Add MIB counter reading support. Rename ksz_9477_reg.h to ksz9477_reg.h for consistency as the product name is always KSZ. Header file ksz_priv.h no longer contains any chip specific data. Signed-off-by: Tristram Ha

[PATCH v1 RFC 0/1] Add Microchip KSZ8795 DSA driver

2017-10-06 Thread Tristram.Ha
From: Tristram Ha This patch requires the previous patches for Microchip KSZ9477 DSA driver. v1 - Return error codes instead of numbers - Add more comments to clarify operation - Use ksz8795 prefix to indicate KSZ8795 specific code - Simplify MIB counter reading code

[PATCH RFC] Add Microchip KSZ8895 DSA driver

2017-10-06 Thread Tristram.Ha
From: Tristram Ha Add Microchip KSZ8895 DSA driver. Signed-off-by: Tristram Ha --- drivers/net/dsa/microchip/Kconfig | 17 + drivers/net/dsa/microchip/Makefile |2 + drivers/net/dsa/microchip/ksz8895.c | 1288

[PATCH RFC 0/1] Add Microchip KSZ8895 DSA driver

2017-10-06 Thread Tristram.Ha
From: Tristram Ha This patch requires the previous patch for Microchip KSZ8795 DSA driver. Tristram Ha (1): Add Microchip KSZ8895 DSA driver. drivers/net/dsa/microchip/Kconfig | 17 + drivers/net/dsa/microchip/Makefile |2 +

[PATCH RFC] Add other KSZ switch support so that patch check does not complain

2017-10-06 Thread Tristram.Ha
From: Tristram Ha Add other KSZ switch support so that patch check does not complain. Signed-off-by: Tristram Ha --- Documentation/devicetree/bindings/net/dsa/ksz.txt | 189 -- 1 file changed, 136 insertions(+), 53

[PATCH v1 RFC 7/7] Modify tag_ksz.c so that tail tag code can be used by other KSZ switch drivers

2017-10-06 Thread Tristram.Ha
From: Tristram Ha Modify tag_ksz.c so that tail tag code can be used by other KSZ switch drivers. Signed-off-by: Tristram Ha --- drivers/net/dsa/microchip/Kconfig | 2 +- drivers/net/dsa/microchip/ksz9477.c | 2 +- include/net/dsa.h

[PATCH v1 RFC 0/7] Modify KSZ9477 DSA driver in preparation to add other KSZ switch drivers

2017-10-06 Thread Tristram.Ha
From: Tristram Ha This series of patches is to modify the original KSZ9477 DSA driver so that other KSZ switch drivers can be added and use the common code. There are several steps to accomplish this achievement. First is to rename some function names with a prefix

[PATCH v1 RFC 1/7] Replace license with GPL

2017-10-06 Thread Tristram.Ha
From: Tristram Ha Replace license with GPL. Signed-off-by: Tristram Ha --- drivers/net/dsa/microchip/ksz_9477_reg.h | 23 --- drivers/net/dsa/microchip/ksz_common.c | 23 ---

[PATCH v1 RFC 2/7] Clean up code according to patch check suggestions

2017-10-06 Thread Tristram.Ha
From: Tristram Ha Clean up code according to patch check suggestions. Signed-off-by: Tristram Ha --- drivers/net/dsa/microchip/ksz_common.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

RE: [PATCH v1 RFC 1/7] Replace license with GPL

2017-10-09 Thread Tristram.Ha
> From: tristram...@microchip.com > > Sent: 06 October 2017 21:33 > > Replace license with GPL. > > Don't you need permission from all the people who have updated > the files in order to make this change? > > David I am a little confused by your comment. The 4 original KSZ9477 DSA driver

RE: [PATCH v1 RFC 1/1] Add Microchip KSZ8795 DSA driver

2017-10-09 Thread Tristram.Ha
> in previous version I see that transit traffic (ping) goes to cpu, > then from cpu back to destination port. I.e. it works but with cpu > involving. Is this version supposed to work like that? Yes, it works in the old DSA way such that a software bridge is responsible to forward every packet.

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-08 Thread Tristram.Ha
> -Original Message- > From: Pavel Machek [mailto:pa...@ucw.cz] > Sent: Friday, September 08, 2017 2:19 AM > To: Tristram Ha - C24268 > Cc: and...@lunn.ch; muva...@gmail.com; nathan.leigh.con...@gmail.com; > vivien.dide...@savoirfairelinux.com; f.faine...@gmail.com; >

RE: [PATCH RFC 5/5] Add KSZ8795 SPI driver

2017-09-08 Thread Tristram.Ha
> -Original Message- > From: Pavel Machek [mailto:pa...@ucw.cz] > Sent: Friday, September 08, 2017 2:26 AM > To: Tristram Ha - C24268 > Cc: and...@lunn.ch; muva...@gmail.com; nathan.leigh.con...@gmail.com; > vivien.dide...@savoirfairelinux.com; f.faine...@gmail.com; >

RE: [PATCH RFC] Update documentation for KSZ DSA drivers so that new drivers can be added

2017-09-08 Thread Tristram.Ha
> -Original Message- > From: Andrew Lunn [mailto:and...@lunn.ch] > Sent: Friday, September 08, 2017 7:12 AM > To: Maxim Uvarov > Cc: Tristram Ha - C24268; Pavel Machek; Nathan Conrad; Vivien Didelot; Florian > Fainelli; netdev; linux-ker...@vger.kernel.org; Woojung Huh - C21699 > Subject:

RE: [PATCH RFC] Update documentation for KSZ DSA drivers so that new drivers can be added

2017-09-08 Thread Tristram.Ha
> -Original Message- > From: Maxim Uvarov [mailto:muva...@gmail.com] > Sent: Friday, September 08, 2017 12:00 PM > To: Florian Fainelli > Cc: Tristram Ha - C24268; Andrew Lunn; Pavel Machek; Nathan Conrad; Vivien > Didelot; netdev; linux-ker...@vger.kernel.org; Woojung Huh - C21699 >

RE: [PATCH RFC] Update documentation for KSZ DSA drivers so that new drivers can be added

2017-09-08 Thread Tristram.Ha
> -Original Message- > From: Florian Fainelli [mailto:f.faine...@gmail.com] > Sent: Friday, September 08, 2017 12:54 PM > To: Tristram Ha - C24268; muva...@gmail.com > Cc: and...@lunn.ch; pa...@ucw.cz; nathan.leigh.con...@gmail.com; > vivien.dide...@savoirfairelinux.com;

RE: [PATCH RFC 0/6] Modify KSZ9477 DSA driver in preparation to add other KSZ switch drivers.

2017-09-08 Thread Tristram.Ha
> -Original Message- > From: Pavel Machek [mailto:pa...@ucw.cz] > Sent: Friday, September 08, 2017 1:54 AM > To: Tristram Ha - C24268 > Cc: and...@lunn.ch; muva...@gmail.com; nathan.leigh.con...@gmail.com; > vivien.dide...@savoirfairelinux.com; f.faine...@gmail.com; >

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-08 Thread Tristram.Ha
> -Original Message- > From: Pavel Machek [mailto:pa...@ucw.cz] > Sent: Friday, September 08, 2017 2:58 PM > To: Tristram Ha - C24268 > Cc: and...@lunn.ch; muva...@gmail.com; nathan.leigh.con...@gmail.com; > vivien.dide...@savoirfairelinux.com; f.faine...@gmail.com; >

RE: [PATCH] DSA support for Micrel KSZ8895

2017-08-30 Thread Tristram.Ha
> On Mon 2017-08-28 16:09:27, Andrew Lunn wrote: > > > I may be confused here, but AFAICT: > > > > > > 1) Yes, it has standard layout when accessed over MDIO. > > > > > > Section 4.8 of the datasheet says: > > > > All the registers defined in this section can be also accessed > > via the

[PATCH RFC 2/6] Create new file ksz9477.c from KSZ9477 code in ksz_common.c

2017-09-07 Thread Tristram.Ha
From: Tristram Ha Create new ksz9477.c file from original ksz_common.c. Signed-off-by: Tristram Ha --- diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c new file mode 100644 index 000..bc722b4 ---

[PATCH RFC 0/6] Modify KSZ9477 DSA driver in preparation to add other KSZ switch drivers.

2017-09-07 Thread Tristram.Ha
From: Tristram Ha This series of patches is to modify the original KSZ9477 DSA driver so that other KSZ switch drivers can be added and use the common code. This patch set is against net-next. drivers/net/dsa/microchip/Makefile |2 +-

[PATCH RFC 4/6] The common header ksz_priv.h does not contain chip specific data

2017-09-07 Thread Tristram.Ha
From: Tristram Ha The header ksz_priv.h is used by all KSZ switch drivers so chip specific data are removed and commonly used variables are added. Signed-off-by: Tristram Ha --- diff --git a/drivers/net/dsa/microchip/ksz_priv.h

[PATCH RFC 1/6] The file ksz_common.c will be used by other KSZ switch drivers.

2017-09-07 Thread Tristram.Ha
From: Tristram Ha Break ksz_common.c into 2 files so that the common code can be used by other KSZ switch drivers. Signed-off-by: Tristram Ha --- diff --git a/drivers/net/dsa/microchip/Makefile b/drivers/net/dsa/microchip/Makefile index

[PATCH RFC 1/5] Add KSZ8795 switch driver support in Kconfig

2017-09-07 Thread Tristram.Ha
From: Tristram Ha Add KSZ8795 switch support with SPI access. Signed-off-by: Tristram Ha --- diff --git a/drivers/net/dsa/microchip/Kconfig b/drivers/net/dsa/microchip/Kconfig index a8b8f59..0b6225e 100644 ---

[PATCH RFC 0/5] Add DSA driver support for KSZ8795 switch

2017-09-07 Thread Tristram.Ha
From: Tristram Ha This series of patches is to add DSA driver support for KSZ8795 switch. Previous patches for KSZ9477 have to be applied first before these. This patch set is against net-next. drivers/net/dsa/microchip/Kconfig | 18 +

[PATCH RFC 3/6] The file ksz_common.c contains common code shared by all KSZ switch drivers

2017-09-07 Thread Tristram.Ha
From: Tristram Ha The file ksz_common.c only holds common code used by all KSZ switch drivers. Signed-off-by: Tristram Ha --- diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index

[PATCH RFC 5/6] Switch SPI driver calls its own driver switch register function

2017-09-07 Thread Tristram.Ha
From: Tristram Ha SPI driver calls own specific switch register function. Shutdown callback function is added to reset switch to default state. Signed-off-by: Tristram Ha --- diff --git a/drivers/net/dsa/microchip/ksz_spi.c

[PATCH RFC 6/6] Modify tag_ksz.c to support other KSZ switch drivers

2017-09-07 Thread Tristram.Ha
From: Tristram Ha The KSZ tail tag code can be used by different KSZ switch drivers. Signed-off-by: Tristram Ha --- diff --git a/net/dsa/tag_ksz.c b/net/dsa/tag_ksz.c index 010ca0a..d5faf14 100644 --- a/net/dsa/tag_ksz.c +++

[PATCH RFC 4/5] Add KSZ8795 register definitions

2017-09-07 Thread Tristram.Ha
From: Tristram Ha Add KSZ8795 switch support with register definitions. Signed-off-by: Tristram Ha --- diff --git a/drivers/net/dsa/microchip/ksz8795.h b/drivers/net/dsa/microchip/ksz8795.h new file mode 100644 index 000..005eda5 ---

[PATCH RFC 5/5] Add KSZ8795 SPI driver

2017-09-07 Thread Tristram.Ha
From: Tristram Ha Add KSZ8795 switch support with SPI access. Signed-off-by: Tristram Ha --- diff --git a/drivers/net/dsa/microchip/ksz8795_spi.c b/drivers/net/dsa/microchip/ksz8795_spi.c new file mode 100644 index 000..0f9c731 ---

[PATCH RFC 2/5] Add KSZ8795 switch driver support in Makefile

2017-09-07 Thread Tristram.Ha
From: Tristram Ha Add KSZ8795 switch support with SPI access. Signed-off-by: Tristram Ha --- diff --git a/drivers/net/dsa/microchip/Makefile b/drivers/net/dsa/microchip/Makefile index 0961c30..0d8ba48 100644 ---

[PATCH RFC] Update documentation for KSZ DSA drivers so that new drivers can be added

2017-09-07 Thread Tristram.Ha
From: Tristram Ha Add other KSZ switches support so that patch check does not complain. Signed-off-by: Tristram Ha --- Documentation/devicetree/bindings/net/dsa/ksz.txt | 117 -- 1 file changed, 62 insertions(+), 55

[PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-07 Thread Tristram.Ha
From: Tristram Ha Add KSZ8795 switch support with function code. Signed-off-by: Tristram Ha --- diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c new file mode 100644 index 000..e4d4e6a ---

RE: [PATCH RFC 2/6] Create new file ksz9477.c from KSZ9477 code in ksz_common.c

2017-09-07 Thread Tristram.Ha
> -Original Message- > From: Andrew Lunn [mailto:and...@lunn.ch] > Sent: Thursday, September 07, 2017 2:33 PM > To: Tristram Ha - C24268 > Cc: muva...@gmail.com; pa...@ucw.cz; nathan.leigh.con...@gmail.com; > vivien.dide...@savoirfairelinux.com; f.faine...@gmail.com; >

RE: [PATCH RFC 1/6] The file ksz_common.c will be used by other KSZ switch drivers.

2017-09-07 Thread Tristram.Ha
> -Original Message- > From: Andrew Lunn [mailto:and...@lunn.ch] > Sent: Thursday, September 07, 2017 2:25 PM > To: Tristram Ha - C24268 > Cc: muva...@gmail.com; pa...@ucw.cz; nathan.leigh.con...@gmail.com; > vivien.dide...@savoirfairelinux.com; f.faine...@gmail.com; >

RE: [PATCH RFC 2/5] Add KSZ8795 switch driver support in Makefile

2017-09-07 Thread Tristram.Ha
> -Original Message- > From: Andrew Lunn [mailto:and...@lunn.ch] > Sent: Thursday, September 07, 2017 2:56 PM > To: Tristram Ha - C24268 > Cc: muva...@gmail.com; pa...@ucw.cz; nathan.leigh.con...@gmail.com; > vivien.dide...@savoirfairelinux.com; f.faine...@gmail.com; >

RE: [PATCH] DSA support for Micrel KSZ8895

2017-09-06 Thread Tristram.Ha
> -Original Message- > From: Maxim Uvarov [mailto:muva...@gmail.com] > Sent: Wednesday, September 06, 2017 2:15 AM > To: Tristram Ha - C24268 > Cc: Pavel Machek; Woojung Huh - C21699; Nathan Conrad; Vivien Didelot; > Florian Fainelli; netdev; linux-ker...@vger.kernel.org; Andrew Lunn >

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Tristram.Ha
The actual SPI access performance will depend on the SPI host controller. The SPI access speed, ranging from 12 MHz to 50 MHz depending on the chip, is a factor but the performance of the SPI host controller is more important. Generally the SPI host controller scales down the clock by a factor of

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Tristram.Ha
> On Mon 2017-09-18 20:27:13, tristram...@microchip.com wrote: > > > > +/** > > > > + * Some counters do not need to be read too often because they are > less > > > likely > > > > + * to increase much. > > > > + */ > > > > > > What does comment mean? Are you caching statistics, and updating > > >

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Tristram.Ha
> > > > > Similar code will be needed by other drivers, right? > > > > > > > > Although KSZ8795 and KSZ8895 may use the same code, the other > > > > chips will have different code. > > > > > > Ok, please make sure code is shared between these two. > > > > The exact function probably cannot be

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Tristram.Ha
> > My concern is if a task is already running with SPI access to a lot > > of registers like reading the 32 MIB counters in every port of the > > switch, another register access has to wait until they are finished. > > Why does it have to wait? Looking at the code in > ksz_get_ethtool_stats(),

RE: [PATCH v1 RFC 1/1] Add Microchip KSZ8795 DSA driver

2017-10-18 Thread Tristram.Ha
> > +static void ksz8795_r_mib_cnt(struct ksz_device *dev, int port, u16 addr, > > + u64 *cnt) > > +{ > > + u32 data; > > + u16 ctrl_addr; > > + u8 check; > > + int loop; > > + > > + ctrl_addr = addr + SWITCH_COUNTER_NUM * port; > > + ctrl_addr |=

RE: [PATCH v1 RFC 7/7] Modify tag_ksz.c so that tail tag code can be used by other KSZ switch drivers

2017-10-18 Thread Tristram.Ha
> > +#define KSZ9477_INGRESS_TAG_LEN2 > > +#define KSZ9477_PTP_TAG_LEN4 > > +#define KSZ9477_PTP_TAG_INDICATION 0x80 > > + > > +#define KSZ9477_TAIL_TAG_OVERRIDE BIT(9) > > +#define KSZ9477_TAIL_TAG_LOOKUPBIT(10) > > + > > +static int ksz9477_get_tag(u8

RE: [PATCH v1 net-next 0/7] net: dsa: microchip: Modify KSZ9477 DSA driver in preparation to add other KSZ switch drivers

2017-11-17 Thread Tristram.Ha
> On Thu, Nov 16, 2017 at 06:41:24PM -0800, tristram...@microchip.com > wrote: > > From: Tristram Ha > > > > This series of patches is to modify the original KSZ9477 DSA driver so > > that other KSZ switch drivers can be added and use the common code. > > Hi Tristram >

RE: Microchip KSZ* DSA drivers Re: [PATCH v1 RFC 1/1] Add Microchip KSZ8795 DSA driver

2017-11-13 Thread Tristram.Ha
> Subject: Microchip KSZ* DSA drivers Re: [PATCH v1 RFC 1/1] Add Microchip > KSZ8795 DSA driver > > Hi! > > Are there any news here? Is there new release planned? Is there a git > tree somewhere? I probably should get it working, soon.. so I guess I > can help with testing. > Reviewed patches

RE: [PATCH v1 net-next 0/7] net: dsa: microchip: Modify KSZ9477 DSA driver in preparation to add other KSZ switch drivers

2017-11-18 Thread Tristram.Ha
> > I really need to monitor the DSA discussion to better contribute to its > success. > > I just found out the DSA API set_addr was removed last month due to not > > everybody is using it. It cited the Marvell switch was the only switch > > using > that > > API and found a new way to program

[PATCH v1 net-next 3/7] net: dsa: microchip: Rename some functions with ksz9477 prefix chip specific code from common code.

2017-11-16 Thread Tristram.Ha
From: Tristram Ha Rename some functions with ksz9477 prefix to separate chip specific code from common code. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh Reviewed-by: Pavel Machek

[PATCH v1 net-next 2/7] net: dsa: microchip: Clean up code according to patch check suggestions

2017-11-16 Thread Tristram.Ha
From: Tristram Ha Clean up code according to patch check suggestions. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh Reviewed-by: Pavel Machek Reviewed-by: Florian Fainelli

[PATCH v1 net-next 0/7] net: dsa: microchip: Modify KSZ9477 DSA driver in preparation to add other KSZ switch drivers

2017-11-16 Thread Tristram.Ha
From: Tristram Ha This series of patches is to modify the original KSZ9477 DSA driver so that other KSZ switch drivers can be added and use the common code. There are several steps to accomplish this achievement. First is to rename some function names with a prefix

[PATCH v2 net-next] net: dsa: microchip: Add MIB counter reading support

2017-11-16 Thread Tristram.Ha
From: Tristram Ha Add MIB counter reading support. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh --- v2 - Only MIB counter related code in patch v1 - Simplify MIB counter reading code

[PATCH v2 net-next 1/1] net: dsa: microchip: Add Microchip KSZ8795 DSA driver

2017-11-16 Thread Tristram.Ha
From: Tristram Ha Add Microchip KSZ8795 DSA driver. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh --- drivers/net/dsa/microchip/Kconfig | 17 + drivers/net/dsa/microchip/Makefile |2 +

[PATCH net-next 0/1] net: dsa: microchip: Add Microchip KSZ8895 DSA driver

2017-11-16 Thread Tristram.Ha
From: Tristram Ha This patch requires the previous patch for Microchip KSZ8795 DSA driver. Tristram Ha (1): Add Microchip KSZ8895 DSA driver. drivers/net/dsa/microchip/Kconfig | 17 + drivers/net/dsa/microchip/Makefile |2 +

[PATCH v2 net-next 0/1] net: dsa: microchip: Add Microchip KSZ8795 DSA driver

2017-11-16 Thread Tristram.Ha
From: Tristram Ha This patch requires the previous patches for Microchip KSZ9477 DSA driver. v2 - No new feature is introduced in tag_ksz.c v1 - Return error codes instead of numbers - Add more comments to clarify operation - Use ksz8795 prefix to indicate KSZ8795

[PATCH v2 net-next] net: dsa: Modify tag_ksz.c so that tail tag code can be used by other KSZ switch drivers

2017-11-16 Thread Tristram.Ha
From: Tristram Ha Modify tag_ksz.c so that tail tag code can be used by other KSZ switch drivers. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh --- v2 - No new feature is introduced v1 - Switch driver code

[PATCH net-next 1/1] net: dsa: microchip: Add Microchip KSZ8895 DSA driver

2017-11-16 Thread Tristram.Ha
From: Tristram Ha Add Microchip KSZ8895 DSA driver. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh --- drivers/net/dsa/microchip/Kconfig | 17 + drivers/net/dsa/microchip/Makefile |2 +

[PATCH v1 net-next 5/7] net: dsa: microchip: Break KSZ9477 DSA driver into two files

2017-11-16 Thread Tristram.Ha
From: Tristram Ha Break KSZ9477 DSA driver into two files in preparation to add more KSZ switch drivers. Add common functions in ksz_common.h so that other KSZ switch drivers can access code in ksz_common.c. Add ksz_spi.h for common functions used by KSZ switch SPI

[PATCH v1 net-next 6/7] net: dsa: microchip: Prepare PHY for proper advertisement

2017-11-16 Thread Tristram.Ha
From: Tristram Ha Prepare PHY for proper advertisement and get link status for the port. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh --- drivers/net/dsa/microchip/ksz9477.c| 13 +

[PATCH net-next] dt-bindings: net: dsa: Document additional Microchip KSZ family switches

2017-11-16 Thread Tristram.Ha
From: Tristram Ha Document additional Microchip KSZ family switches. Signed-off-by: Tristram Ha Reviewed-by: Pavel Machek Reviewed-by: Florian Fainelli ---

[PATCH v1 net-next 7/7] net: dsa: microchip: Rename ksz_9477_reg.h to ksz9477_reg.h

2017-11-16 Thread Tristram.Ha
From: Tristram Ha Rename ksz_9477_reg.h to ksz9477_reg.h for consistency as the product name is always KSZ. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh --- drivers/net/dsa/microchip/ksz9477.c

[PATCH v1 net-next 1/7] net: dsa: microchip: Replace license with GPL

2017-11-16 Thread Tristram.Ha
From: Tristram Ha Replace license with GPL. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh --- drivers/net/dsa/microchip/ksz_9477_reg.h | 23 --- drivers/net/dsa/microchip/ksz_common.c

[PATCH v1 net-next 4/7] net: dsa: microchip: Rename ksz_spi.c to ksz9477_spi.c

2017-11-16 Thread Tristram.Ha
From: Tristram Ha Rename ksz_spi.c to ksz9477_spi.c and update Kconfig in preparation to add more KSZ switch drivers. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh Reviewed-by: Pavel Machek

RE: [PATCH net-next 1/1] net: dsa: microchip: Add Microchip KSZ8895 DSA driver

2017-12-05 Thread Tristram.Ha
> Thanks for patches. I installed whole series on top of net-next. > > Hardware is: > > root@miro:~# cat /proc/cpuinfo > model name : ARM926EJ-S rev 5 (v5l) > Hardware: Freescale MXS (Device Tree) > > I added devicetree chunks, and enabled DSA in the config. It seems > switch is

RE: [PATCH net-next 1/1] net: dsa: microchip: Add Microchip KSZ8895 DSA driver

2017-12-05 Thread Tristram.Ha
> > Sorry to be this late for the reply. I finally got hold of a KSZ8895 board > > that > > works with my SoC board to confirm the network communication. > > > > As expected the KSZ8895 board works correctly as the chip uses the same > > tail tagging feature in KSZ8795, and I did verify that

[PATCH v3 net-next 0/1] net: dsa: microchip: Add Microchip KSZ8795 DSA driver

2017-12-05 Thread Tristram.Ha
From: Tristram Ha This patch requires the previous patches for Microchip KSZ9477 DSA driver. v3 - For latest KSZ9477 v2 patch v2 - No new feature is introduced in tag_ksz.c v1 - Return error codes instead of numbers - Add more comments to clarify operation - Use

[PATCH v1 net-next 1/1] net: dsa: microchip: Add Microchip KSZ8895 DSA driver

2017-12-05 Thread Tristram.Ha
From: Tristram Ha Add Microchip KSZ8895 DSA driver. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh --- drivers/net/dsa/microchip/Kconfig | 17 + drivers/net/dsa/microchip/Makefile |2 +

[PATCH v3 net-next 1/1] net: dsa: microchip: Add Microchip KSZ8795 DSA driver

2017-12-05 Thread Tristram.Ha
From: Tristram Ha Add Microchip KSZ8795 DSA driver. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh --- drivers/net/dsa/microchip/Kconfig | 17 + drivers/net/dsa/microchip/Makefile |2 +

[PATCH v1 net-next 0/1] net: dsa: microchip: Add Microchip KSZ8895 DSA driver

2017-12-05 Thread Tristram.Ha
From: Tristram Ha This patch requires the previous patch for Microchip KSZ8795 DSA driver. v1 - For latest KSZ8795 v3 patch Tristram Ha (1): Add Microchip KSZ8895 DSA driver. drivers/net/dsa/microchip/Kconfig | 17 + drivers/net/dsa/microchip/Makefile

[PATCH v3 net-next] net: dsa: Modify tag_ksz.c so that tail tag code can be used by other KSZ switch drivers

2017-12-05 Thread Tristram.Ha
From: Tristram Ha Modify tag_ksz.c so that tail tag code can be used by other KSZ switch drivers. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh --- v3 - For latest KSZ9477 patch v2 - No new feature is

dsa: dsa_slave_port_obj_del calls multiple times with SWITCHDEV_OBJ_ID_HOST_MDB obj id

2017-12-05 Thread Tristram.Ha
I found the latest net-next kernel calls dsa_slave_port_obj_del() multiple times, one for each port, with host port as the parameter. As the base driver cannot find an entry with that host port, it returns an error and so users will see a lot of failures from the DSA switch. Is this a new

[PATCH v2 net-next 1/8] net: dsa: microchip: Replace license with GPL

2017-12-05 Thread Tristram.Ha
From: Tristram Ha Replace license with GPL. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh Reviewed-by: Andrew Lunn --- drivers/net/dsa/microchip/ksz_9477_reg.h | 23 ---

[PATCH v2 net-next 0/8] net: dsa: microchip: Modify KSZ9477 DSA driver in preparation to add other KSZ switch drivers

2017-12-05 Thread Tristram.Ha
From: Tristram Ha This series of patches is to modify the original KSZ9477 DSA driver so that other KSZ switch drivers can be added and use the common code. There are several steps to accomplish this achievement. First is to rename some function names with a prefix

[PATCH v3 net-next] net: dsa: microchip: Add MIB counter reading support

2017-12-05 Thread Tristram.Ha
From: Tristram Ha Add MIB counter reading support. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh --- v3 - Use new timer_setup API v2 - Only MIB counter related code in patch v1 - Simplify MIB counter

[PATCH v2 net-next 4/8] net: dsa: microchip: Rename some functions with ksz9477 prefix

2017-12-05 Thread Tristram.Ha
From: Tristram Ha Rename some functions with ksz9477 prefix to separate chip specific code from common code. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh Reviewed-by: Pavel Machek

[PATCH v2 net-next 7/8] net: dsa: microchip: Prepare PHY for proper advertisement

2017-12-05 Thread Tristram.Ha
From: Tristram Ha Prepare PHY for proper advertisement and get link status for the port. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh --- drivers/net/dsa/microchip/ksz9477.c| 13 +

[PATCH v2 net-next 5/8] net: dsa: microchip: Rename ksz_spi.c to ksz9477_spi.c

2017-12-05 Thread Tristram.Ha
From: Tristram Ha Rename ksz_spi.c to ksz9477_spi.c and update Kconfig in preparation to add more KSZ switch drivers. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh Reviewed-by: Pavel Machek

[PATCH v2 net-next 3/8] net: dsa: microchip: Initialize mutex before use

2017-12-05 Thread Tristram.Ha
From: Tristram Ha Initialize mutex before use. Signed-off-by: Tristram Ha --- drivers/net/dsa/microchip/ksz_common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/microchip/ksz_common.c

[PATCH v2 net-next 8/8] net: dsa: microchip: Rename ksz_9477_reg.h to ksz9477_reg.h

2017-12-05 Thread Tristram.Ha
From: Tristram Ha Rename ksz_9477_reg.h to ksz9477_reg.h for consistency as the product name is always KSZ. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh Reviewed-by: Andrew Lunn ---

[PATCH v2 net-next 2/8] net: dsa: microchip: Clean up code according to patch check suggestions

2017-12-05 Thread Tristram.Ha
From: Tristram Ha Clean up code according to patch check suggestions. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh Reviewed-by: Pavel Machek Reviewed-by: Florian Fainelli

[PATCH v2 net-next 6/8] net: dsa: microchip: Break KSZ9477 DSA driver into two files

2017-12-05 Thread Tristram.Ha
From: Tristram Ha Break KSZ9477 DSA driver into two files in preparation to add more KSZ switch drivers. Add common functions in ksz_common.h so that other KSZ switch drivers can access code in ksz_common.c. Add ksz_spi.h for common functions used by KSZ switch SPI

RE: [PATCH net-next 1/1] net: dsa: microchip: Add Microchip KSZ8895 DSA driver

2017-12-08 Thread Tristram.Ha
> Ok, let me retry: > > > One thing to debug this problem is to dump the MIB counters. Use the > ethtool > > utility to show MIB counters of both ports: > > > > ethtool -S lan3 > > ethtool -S eth0 > > > > Assuming eth0 is the MAC controller that drives the switch, the receive > counters of > >

RE: dsa: dsa_slave_port_obj_del calls multiple times with SWITCHDEV_OBJ_ID_HOST_MDB obj id

2017-12-06 Thread Tristram.Ha
> SWITCHDEV_OBJ_ID_HOST_MDB is used, when there is a join/leave on the > bridge interface. It happens for each interface in the bridge, and it > means, packets which match the group that ingress on that interface > should be forwarded to the CPU. > > > As the base driver cannot find an entry with

RE: [PATCH v2 net-next 0/8] net: dsa: microchip: Modify KSZ9477 DSA driver in preparation to add other KSZ switch drivers

2018-08-16 Thread Tristram.Ha
> -Original Message- > From: Florian Fainelli > Sent: Wednesday, August 15, 2018 5:29 PM > To: Tristram Ha - C24268 ; Andrew Lunn > ; Pavel Machek ; Ruediger Schmitt > > Cc: Arkadi Sharshevsky ; UNGLinuxDriver > ; netdev@vger.kernel.org > Subject: Re: [PATCH v2 net-next 0/8] net: dsa:

[PATCH v3 net-next 08/11] net: dsa: microchip: Rename ksz_9477_reg.h to ksz9477_reg.h

2018-10-22 Thread Tristram.Ha
From: Tristram Ha Rename ksz_9477_reg.h to ksz9477_reg.h for consistency as the product name is always KSZ. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh Reviewed-by: Andrew Lunn --- drivers/net/dsa/microchip/ksz9477.c | 2 +-

[PATCH v3 net-next 06/11] net: dsa: microchip: Break KSZ9477 DSA driver into two files

2018-10-22 Thread Tristram.Ha
From: Tristram Ha Break KSZ9477 DSA driver into two files in preparation to add more KSZ switch drivers. Add common functions in ksz_common.h so that other KSZ switch drivers can access code in ksz_common.c. Add ksz_spi.h for common functions used by KSZ switch SPI drivers. Signed-off-by:

[PATCH v3 net-next 11/11] net: dsa: microchip: Add switch offload forwarding support

2018-10-22 Thread Tristram.Ha
From: Tristram Ha Add switch offload forwarding support. Signed-off-by: Tristram Ha --- drivers/net/dsa/microchip/ksz9477.c | 3 +++ net/dsa/tag_ksz.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/net/dsa/microchip/ksz9477.c

[PATCH v3 net-next 04/11] net: dsa: microchip: Rename some functions with ksz9477 prefix

2018-10-22 Thread Tristram.Ha
From: Tristram Ha Rename some functions with ksz9477 prefix to separate chip specific code from common code. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh Reviewed-by: Pavel Machek Reviewed-by: Florian Fainelli Reviewed-by: Andrew Lunn --- drivers/net/dsa/microchip/ksz_common.c |

[PATCH v3 net-next 00/11] net: dsa: microchip: Modify KSZ9477 DSA driver in preparation to add other KSZ switch drivers

2018-10-22 Thread Tristram.Ha
From: Tristram Ha This series of patches is to modify the original KSZ9477 DSA driver so that other KSZ switch drivers can be added and use the common code. There are several steps to accomplish this achievement. First is to rename some function names with a prefix to indicate chip specific

[PATCH v3 net-next 05/11] net: dsa: microchip: Rename ksz_spi.c to ksz9477_spi.c

2018-10-22 Thread Tristram.Ha
From: Tristram Ha Rename ksz_spi.c to ksz9477_spi.c and update Kconfig in preparation to add more KSZ switch drivers. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh Reviewed-by: Pavel Machek Reviewed-by: Florian Fainelli Reviewed-by: Andrew Lunn --- drivers/net/dsa/microchip/Kconfig

[PATCH v3 net-next 03/11] net: dsa: microchip: Initialize mutex before use

2018-10-22 Thread Tristram.Ha
From: Tristram Ha Initialize mutex before use. Signed-off-by: Tristram Ha --- drivers/net/dsa/microchip/ksz_common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index 8c5853e..88e8d2a

[PATCH v3 net-next 01/11] net: dsa: microchip: Replace license with GPL

2018-10-22 Thread Tristram.Ha
From: Tristram Ha Replace license with GPL. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh Reviewed-by: Andrew Lunn --- drivers/net/dsa/microchip/ksz_9477_reg.h | 23 --- drivers/net/dsa/microchip/ksz_common.c | 23 ---

[PATCH v3 net-next 09/11] net: dsa: microchip: Add MIB counter reading support

2018-10-22 Thread Tristram.Ha
From: Tristram Ha Add MIB counter reading support. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh --- drivers/net/dsa/microchip/ksz9477.c| 121 ++--- drivers/net/dsa/microchip/ksz_common.c | 101 +++

  1   2   >