Re: [PATCH net-next v2 01/10] net: dsa: lan9303: Fixed MDIO interface

2017-07-28 Thread Egil Hjelmeland
On 26. juli 2017 18:55, Andrew Lunn wrote: On Tue, Jul 25, 2017 at 06:15:44PM +0200, Egil Hjelmeland wrote: It is better to use mdiobus_read/write or if you are nesting mdio busses, mdiobus_read_nested/mdiobus_write_nested. Please test this code with lockdep enabled. I have

Re: [PATCH net-next v2 07/10] net: dsa: lan9303: Added basic offloading of unicast traffic

2017-07-27 Thread Egil Hjelmeland
On 27. juli 2017 15:31, Andrew Lunn wrote: I think you are over-simplifying here. Say i have a layer 2 VPN and i bridge port 1 and the VPN? The software bridge still wants to do STP on port 1, in order to solve loops. Problem is that the mainline lan9303_separate_ports() does its work by setti

Re: [PATCH net-next v2 07/10] net: dsa: lan9303: Added basic offloading of unicast traffic

2017-07-27 Thread Egil Hjelmeland
On 26. juli 2017 19:24, Andrew Lunn wrote: Hi Egil +/* forward special tagged packets from port 0 to port 1 *or* port 2 */ +static int lan9303_setup_tagging(struct lan9303 *chip) +{ + int ret; Blank line please. + /* enable defining the destination port via special VLAN tagging

Re: [PATCH net-next v2 08/10] net: dsa: lan9303: Added ALR/fdb/mdb handling

2017-07-27 Thread Egil Hjelmeland
On 26. juli 2017 19:41, Andrew Lunn wrote: Hi Egil +/* This function will wait a while until mask & reg == value */ +/* Otherwise, return timeout */ +static int lan9303_csr_reg_wait(struct lan9303 *chip, int regno, + int mask, char value) +{ + int i; + +

Re: [PATCH net-next v2 06/10] net: dsa: lan9303: added sysfs node swe_bcst_throt

2017-07-27 Thread Egil Hjelmeland
On 26. juli 2017 19:14, Andrew Lunn wrote: On Tue, Jul 25, 2017 at 06:15:49PM +0200, Egil Hjelmeland wrote: Allowing per-port access to Switch Engine Broadcast Throttling Register Hi Egil In general, we are against using sysfs. If there is a generic mechanism, that applies for all sorts of

Re: [PATCH net-next v2 04/10] net: dsa: lan9303: Added adjust_link() method

2017-07-27 Thread Egil Hjelmeland
On 26. juli 2017 19:09, Andrew Lunn wrote: On Tue, Jul 25, 2017 at 06:15:47PM +0200, Egil Hjelmeland wrote: This makes the driver react to device tree "fixed-link" declaration on CPU port. - turn off autonegotiation - force speed 10 or 100 mb/s - force duplex mode Signed-of

Re: [PATCH net-next v2 02/10] net: dsa: lan9303: Do not disable/enable switch fabric port 0 at startup

2017-07-27 Thread Egil Hjelmeland
On 26. juli 2017 18:58, Andrew Lunn wrote: On Tue, Jul 25, 2017 at 06:15:45PM +0200, Egil Hjelmeland wrote: For some mysterious reason enable switch fabric port 0 TX fails to work, when the TX has previous been disabled. Resolved by not disable/enable switch fabric port 0 at startup. Port 1 and

Re: [PATCH net-next v2 01/10] net: dsa: lan9303: Fixed MDIO interface

2017-07-26 Thread Egil Hjelmeland
Den 26. juli 2017 22:07, skrev David Miller: From: Andrew Lunn Date: Wed, 26 Jul 2017 19:52:24 +0200 So I really want to group the patches into only a few series in order to not spend months on the process. I strongly agree with Vivien here. Good patches get accepted in about 3 days. You sho

Re: [PATCH net-next v2 01/10] net: dsa: lan9303: Fixed MDIO interface

2017-07-26 Thread Egil Hjelmeland
On 26. juli 2017 16:30, Vivien Didelot wrote: Hi Egil, Egil Hjelmeland writes: I'd suggest you to split up this one commit in several *atomic* and easy to review patches and send them separately as on thread named "net: dsa: lan9303: fix MDIO interface" (also note that imperat

Re: [PATCH net-next v2 01/10] net: dsa: lan9303: Fixed MDIO interface

2017-07-26 Thread Egil Hjelmeland
On 25. juli 2017 21:15, Vivien Didelot wrote: Hi Egil, Egil Hjelmeland writes: Fixes after testing on actual HW: - lan9303_mdio_write()/_read() must multiply register number by 4 to get offset - Indirect access (PMI) to phy register only work in I2C mode. In MDIO mode phy registers

[PATCH net-next v2 06/10] net: dsa: lan9303: added sysfs node swe_bcst_throt

2017-07-25 Thread Egil Hjelmeland
Allowing per-port access to Switch Engine Broadcast Throttling Register Also added lan9303_write_switch_reg_mask() Signed-off-by: Egil Hjelmeland --- drivers/net/dsa/lan9303-core.c | 83 ++ 1 file changed, 83 insertions(+) diff --git a/drivers/net/dsa

[PATCH net-next v2 02/10] net: dsa: lan9303: Do not disable/enable switch fabric port 0 at startup

2017-07-25 Thread Egil Hjelmeland
For some mysterious reason enable switch fabric port 0 TX fails to work, when the TX has previous been disabled. Resolved by not disable/enable switch fabric port 0 at startup. Port 1 and 2 are still disabled in early init. Signed-off-by: Egil Hjelmeland --- drivers/net/dsa/lan9303-core.c | 7

[PATCH net-next v2 05/10] net: dsa: added dsa_net_device_to_dsa_port()

2017-07-25 Thread Egil Hjelmeland
Allowing dsa drivers to attach sysfs nodes. Signed-off-by: Egil Hjelmeland --- include/net/dsa.h | 1 + net/dsa/slave.c | 10 ++ 2 files changed, 11 insertions(+) diff --git a/include/net/dsa.h b/include/net/dsa.h index 88da272d20d0..a71c0a2401ee 100644 --- a/include/net/dsa.h +++ b

[PATCH net-next v2 08/10] net: dsa: lan9303: Added ALR/fdb/mdb handling

2017-07-25 Thread Egil Hjelmeland
entry, the driver caches all static entries - in a flat table. Signed-off-by: Egil Hjelmeland --- drivers/net/dsa/lan9303-core.c | 369 + drivers/net/dsa/lan9303.h | 11 ++ 2 files changed, 380 insertions(+) diff --git a/drivers/net/dsa/lan9303

[PATCH net-next v2 10/10] net: dsa: lan9303: Only allocate 3 ports

2017-07-25 Thread Egil Hjelmeland
Saving 2628 bytes. Signed-off-by: Egil Hjelmeland Reviewed-by: Florian Fainelli --- drivers/net/dsa/lan9303-core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c index dc95973d62ed..ad7a4c72e1fb 100644

[PATCH net-next v2 09/10] net: dsa: lan9303: Added Documentation/networking/dsa/lan9303.txt

2017-07-25 Thread Egil Hjelmeland
Signed-off-by: Egil Hjelmeland --- Documentation/networking/dsa/lan9303.txt | 63 1 file changed, 63 insertions(+) create mode 100644 Documentation/networking/dsa/lan9303.txt diff --git a/Documentation/networking/dsa/lan9303.txt b/Documentation/networking/dsa

[PATCH net-next v2 07/10] net: dsa: lan9303: Added basic offloading of unicast traffic

2017-07-25 Thread Egil Hjelmeland
port_bridge_join, port_bridge_leave and port_stp_state_set. Signed-off-by: Egil Hjelmeland --- drivers/net/dsa/lan9303-core.c | 115 ++--- drivers/net/dsa/lan9303.h | 1 + 2 files changed, 98 insertions(+), 18 deletions(-) diff --git a/drivers/net/dsa

[PATCH net-next v2 01/10] net: dsa: lan9303: Fixed MDIO interface

2017-07-25 Thread Egil Hjelmeland
. Renamed functions to clarify. - lan9303_detect_phy_setup() : Failed MDIO read return 0x. Handle that. Signed-off-by: Egil Hjelmeland --- drivers/net/dsa/lan9303-core.c | 42 +++--- drivers/net/dsa/lan9303.h | 11 +++ drivers/net/dsa

[PATCH net-next v2 03/10] net: dsa: lan9303: Refactor lan9303_enable_packet_processing()

2017-07-25 Thread Egil Hjelmeland
lan9303_enable_packet_processing, lan9303_disable_packet_processing() Pass port number (0,1,2) as parameter instead of port offset. Simplify accordingly. Signed-off-by: Egil Hjelmeland --- drivers/net/dsa/lan9303-core.c | 66 -- 1 file changed, 32

[PATCH net-next v2 04/10] net: dsa: lan9303: Added adjust_link() method

2017-07-25 Thread Egil Hjelmeland
This makes the driver react to device tree "fixed-link" declaration on CPU port. - turn off autonegotiation - force speed 10 or 100 mb/s - force duplex mode Signed-off-by: Egil Hjelmeland --- drivers/net/dsa/lan9303-core.c | 33 + 1 file changed, 33

[PATCH net-next v2 00/10] net: dsa: lan9303: unicast offload, fdb,mdb,STP

2017-07-25 Thread Egil Hjelmeland
rom private account in order to avoid company disclaimer in emails. - Removed the three last "work around" patches. But first moved one doc paragraph to the document patch. Egil Hjelmeland (10): net: dsa: lan9303: Fixed MDIO interface net: dsa: lan9303: Do not disable/enable switch

Re: [PATCH 11/13] net: dsa: lan9303: Added "alr_dump" sysfs port attribute

2017-07-25 Thread Egil Hjelmeland
On 24. juli 2017 18:54, Florian Fainelli wrote: On 07/20/2017 01:49 AM, Egil Hjelmeland wrote: Added read only file /sys/class/net//lan9303/alr_dump, that output 168 first ALR entires. Currently "bridge fdb show" does not include the CPU port, while "alr_dump" list all t

Re: [PATCH 12/13] net: dsa: lan9303: Added "stp_enable" sysfs attribute

2017-07-25 Thread Egil Hjelmeland
On 24. juli 2017 18:55, Florian Fainelli wrote: On 07/20/2017 06:42 AM, Egil Hjelmeland wrote: Must be set to 1 by user space when STP is used on the lan9303. If bridging without local STP, leave at 0, so external STP BPDUs are forwarded. Hopefully the kernel can be improved so the driver can

Re: [PATCH 13/13] net: dsa: lan9303: lan9303_port_mdb_del remove port 0

2017-07-25 Thread Egil Hjelmeland
On 24. juli 2017 18:57, Florian Fainelli wrote: On 07/20/2017 06:57 AM, Egil Hjelmeland wrote: Workaround for dsa_switch_mdb_add adding CPU port to group, but forgetting to remove it: Should not we move this logic one layer above into DSA then such that insertions and removals are strictly

Re: [PATCH 00/13] net: dsa: lan9303: unicast offload, fdb,mdb,STP

2017-07-25 Thread Egil Hjelmeland
On 24. juli 2017 22:32, David Miller wrote: They are all over the place, over a period of 3 days. I will do "git rebase --ignore-date master" from now on. You must also say in your subject line which of my two GIT networking trees ('net' or 'net-next') your changes are targetting. If you don

Re: [PATCH 00/13] net: dsa: lan9303: unicast offload, fdb,mdb,STP

2017-07-25 Thread Egil Hjelmeland
On 24. juli 2017 18:54, Florian Fainelli wrote: > > First thing would be to get your patch submissions square, because the > patches do not appear to have been sent as a reply to this cover letter, > and worse yet, they are all appearing with their commit date, which is > highly confusing since th

[PATCH 04/13] net: dsa: lan9303: Added adjust_link() method

2017-07-24 Thread Egil Hjelmeland
This makes the driver react to device tree "fixed-link" declaration on CPU port. - turn off autonegotiation - force speed 10 or 100 mb/s - force duplex mode Signed-off-by: Egil Hjelmeland --- drivers/net/dsa/lan9303-core.c | 33 + 1 file changed, 33

[PATCH 08/13] net: dsa: lan9303: Added ALR/fdb/mdb handling

2017-07-24 Thread Egil Hjelmeland
entry, the driver caches all static entries - in a flat table. Signed-off-by: Egil Hjelmeland --- drivers/net/dsa/lan9303-core.c | 369 + drivers/net/dsa/lan9303.h | 11 ++ 2 files changed, 380 insertions(+) diff --git a/drivers/net/dsa/lan9303

[PATCH 02/13] net: dsa: lan9303: Do not disable/enable switch fabric port 0 at startup

2017-07-24 Thread Egil Hjelmeland
For some mysterious reason enable switch fabric port 0 TX fails to work, when the TX has previous been disabled. Resolved by not disable/enable switch fabric port 0 at startup. Port 1 and 2 are still disabled in early init. Signed-off-by: Egil Hjelmeland --- drivers/net/dsa/lan9303-core.c | 7

[PATCH 13/13] net: dsa: lan9303: lan9303_port_mdb_del remove port 0

2017-07-24 Thread Egil Hjelmeland
Workaround for dsa_switch_mdb_add adding CPU port to group, but forgetting to remove it: Remove port 0 if only port 0 is only port left. Signed-off-by: Egil Hjelmeland --- drivers/net/dsa/lan9303-core.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/dsa/lan9303

[PATCH 12/13] net: dsa: lan9303: Added "stp_enable" sysfs attribute

2017-07-24 Thread Egil Hjelmeland
Must be set to 1 by user space when STP is used on the lan9303. If bridging without local STP, leave at 0, so external STP BPDUs are forwarded. Hopefully the kernel can be improved so the driver can handle this without user intervention, and this control can be removed. Signed-off-by: Egil

[PATCH 11/13] net: dsa: lan9303: Added "alr_dump" sysfs port attribute

2017-07-24 Thread Egil Hjelmeland
01:95 0 s 10:f3:11:f5:6f:cf 2 l 48:4d:7e:f4:59:a8 2 l 01:00:5e:00:01:0a 0 2 s ec:f4:bb:0f:e2:fd 2 l Signed-off-by: Egil Hjelmeland --- Documentation/networking/dsa/lan9303.txt | 3 ++ drivers/net/dsa/lan9303-core.c | 58 2 files changed, 61 inser

[PATCH 10/13] net: dsa: lan9303: Only allocate 3 ports

2017-07-24 Thread Egil Hjelmeland
Saving 2628 bytes. Signed-off-by: Egil Hjelmeland --- drivers/net/dsa/lan9303-core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c index dc95973d62ed..ad7a4c72e1fb 100644 --- a/drivers/net/dsa/lan9303

[PATCH 09/13] net: dsa: lan9303: Added Documentation/networking/dsa/lan9303.txt

2017-07-24 Thread Egil Hjelmeland
Signed-off-by: Egil Hjelmeland --- Documentation/networking/dsa/lan9303.txt | 48 1 file changed, 48 insertions(+) create mode 100644 Documentation/networking/dsa/lan9303.txt diff --git a/Documentation/networking/dsa/lan9303.txt b/Documentation/networking/dsa

[PATCH 03/13] net: dsa: lan9303: Refactor lan9303_enable_packet_processing()

2017-07-24 Thread Egil Hjelmeland
lan9303_enable_packet_processing, lan9303_disable_packet_processing() Pass port number (0,1,2) as parameter instead of port offset. Simplify accordingly. Signed-off-by: Egil Hjelmeland --- drivers/net/dsa/lan9303-core.c | 66 -- 1 file changed, 32

[PATCH 07/13] net: dsa: lan9303: Added basic offloading of unicast traffic

2017-07-24 Thread Egil Hjelmeland
port_bridge_join, port_bridge_leave and port_stp_state_set. Signed-off-by: Egil Hjelmeland --- drivers/net/dsa/lan9303-core.c | 115 ++--- drivers/net/dsa/lan9303.h | 1 + 2 files changed, 98 insertions(+), 18 deletions(-) diff --git a/drivers/net/dsa

[PATCH 06/13] net: dsa: lan9303: added sysfs node swe_bcst_throt

2017-07-24 Thread Egil Hjelmeland
Allowing per-port access to Switch Engine Broadcast Throttling Register Also added lan9303_write_switch_reg_mask() Signed-off-by: Egil Hjelmeland --- drivers/net/dsa/lan9303-core.c | 83 ++ 1 file changed, 83 insertions(+) diff --git a/drivers/net/dsa

[PATCH 05/13] net: dsa: added dsa_net_device_to_dsa_port()

2017-07-24 Thread Egil Hjelmeland
Allowing dsa drivers to attach sysfs nodes. Signed-off-by: Egil Hjelmeland --- include/net/dsa.h | 1 + net/dsa/slave.c | 10 ++ 2 files changed, 11 insertions(+) diff --git a/include/net/dsa.h b/include/net/dsa.h index 88da272d20d0..a71c0a2401ee 100644 --- a/include/net/dsa.h +++ b

[PATCH 01/13] net: dsa: lan9303: Fixed MDIO interface

2017-07-24 Thread Egil Hjelmeland
. Renamed functions to clarify. - lan9303_detect_phy_setup() : Failed MDIO read return 0x. Handle that. Signed-off-by: Egil Hjelmeland --- drivers/net/dsa/lan9303-core.c | 42 +++--- drivers/net/dsa/lan9303.h | 11 +++ drivers/net/dsa

[PATCH 00/13] net: dsa: lan9303: unicast offload, fdb,mdb,STP

2017-07-24 Thread Egil Hjelmeland
first patches submitted to the kernel, so I am looking forward to comments. Egil Hjelmeland (13): net: dsa: lan9303: Fixed MDIO interface net: dsa: lan9303: Do not disable/enable switch fabric port 0 at startup net: dsa: lan9303: Refactor lan9303_enable_packet_processing() net: dsa