All of lore.kernel.org
 help / color / mirror / Atom feed
From: <Parthiban.Veerasooran@microchip.com>
To: <ramon.nordin.rodriguez@ferroamp.se>, <andrew@lunn.ch>
Cc: <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
	<pabeni@redhat.com>, <horms@kernel.org>, <saeedm@nvidia.com>,
	<anthony.l.nguyen@intel.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <corbet@lwn.net>,
	<linux-doc@vger.kernel.org>, <robh+dt@kernel.org>,
	<krzysztof.kozlowski+dt@linaro.org>, <conor+dt@kernel.org>,
	<devicetree@vger.kernel.org>, <Horatiu.Vultur@microchip.com>,
	<ruanjinjie@huawei.com>, <Steen.Hegelund@microchip.com>,
	<vladimir.oltean@nxp.com>, <UNGLinuxDriver@microchip.com>,
	<Thorsten.Kummermehr@microchip.com>, <Pier.Beruto@onsemi.com>,
	<Selvamani.Rajagopal@onsemi.com>, <Nicolas.Ferre@microchip.com>,
	<benjamin.bigler@bernformulastudent.ch>
Subject: Re: [PATCH net-next v4 05/12] net: ethernet: oa_tc6: implement error interrupts unmasking
Date: Thu, 2 May 2024 10:10:03 +0000	[thread overview]
Message-ID: <b7c7aad7-3e93-4c57-82e9-cb3f9e7adf64@microchip.com> (raw)
In-Reply-To: <ZjKJ93uPjSgoMOM7@builder>

Hi Ramon,

On 01/05/24 11:59 pm, Ramón Nordin Rodriguez wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
>>> n  |  name     |  min  |  avg  |  max  |  rx dropped  |  samples
>>> 1  |  no mod   |  827K |  846K |  891K |      945     |     5
>>> 2  |  no log   |  711K |  726K |  744K |      562     |     5
>>> 3  |  less irq |  815K |  833K |  846K |      N/A     |     5
>>> 4  |  no irq   |  914K |  924K |  931K |      N/A     |     5
>>> 5  |  simple   |  857K |  868K |  879K |      615     |     5
>>
>> That is odd.
>>
>> Side question: What CONFIG_HZ= do you have? 100, 250, 1000?  Try
>> 1000. I've seen problems where the driver wants to sleep for a short
>> time, but the CONFIG_HZ value limits how short a time it can actually
>> sleep. It ends up sleeping much longer than it wants.
>>
> 
> I have been doing my best to abuse the link some more. In brief tweaking
> CONFIG_HZ has some but limited effect.
> Saturating the link with the rx buffer interrupt enabled breaks the driver.
> Saturating the link with the rx buffer interrupt disabled has poor
> performance.
> 
> The following scenario has been tested. Both ends of the link run:
> * server.py
> * client.py
> 
> One end is an arm64 quad core running at 1.2GHz with the lan8650 macphy.
> The other end is an amd 3950x running the lan8670 usb eval board.
> Both systems should be fast enough that running python should not be a
> limiting factor.
> 
> -- The test code --
> server.py
> #!/bin/env python3
> import socket
> 
> def serve(sock: socket.socket):
>      while True:
>          client, addr = sock.accept()
>          print(f'connection from: {addr}')
>          while len(client.recv(2048)) > 0:
>              pass
>          print('client disconnected')
>          client.close()
> 
> if __name__ == '__main__':
>      sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>      sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
>      sock.bind(('0.0.0.0', 4040))
>      sock.listen(1)
>      serve(sock)
>      print("something went wrong")
> 
> client.py
> #!/bin/env python3
> import socket
> import sys
> 
> if __name__ == '__main__':
>      sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>      sock.connect((sys.argv[1], 4040))
> 
>      while True:
>          sock.sendall(b'0'*2048)
> 
> -- test runs --
> run 1 - all interrupts enabled
> Time to failure:
> 1 min or less
> 
> Kernel output:
> [   94.361312] sched: RT throttling activated
> 
> top output:
>   PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
>   145 root     -51   0       0      0      0 R  95.5   0.0   1:11.22 oa-tc6-spi-thread
> 
> link stats:
> 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
>      link/ether 32:c2:7e:22:93:99 brd ff:ff:ff:ff:ff:ff
>      RX:  bytes packets errors dropped  missed   mcast
>         3371902    7186      0      48       0       0
>      RX errors:  length    crc   frame    fifo overrun
>                       0      0       0       0       0
>      TX:  bytes packets errors dropped carrier collsns
>        10341438    8071      0       0       0       0
>      TX errors: aborted   fifo  window heartbt transns
>                       0      0       0       0       1
> state:
> Completly borked, can't ping in or out, bringing the interface down then up
> has no effect.
> There is no SPI clock and no interrupts generated by the mac-phy.
> The worker thread seems to have live locked.
> 
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> run 2 - RX_BUFFER_OVERLOW interrupt disabled
> 
> state:
> Runs just fine but the oa-tc6-spi-thread is consuming 10-20% cpu
> Ping times have increased from 1-2ms to 8-35ms
> 
> 
> -- additional notes --
> When tweaking CONFIG_HZ I do get some changes in behaviour, the cpu
> consumption stays stable at 20%+-2 with CONFIG_HZ=250, when increased to
> CONFIG_HZ=1000 it jumps up and down between 10-20%.
> 
> I don't have access to a logic analyzer but my old oscilloscope is
> almost reliable. I could confirm that the spi clock is indeed running at
> the expected 25MHz, but I could observe some gaps of up to 320µs so
> that's 8k spi cycles spent doing something else.
> These gaps were observed on the SPI clock and the macphy interrupt was
> active for the same ammount of time(though this was measured independently
> and not on the same trigger).
> I've been drinking way to much coffe, so soldering is not gonna happen
> today (shaky hands), but if it helps I can solder wires to attach both
> probes to confirm that the gap in the SPI clock happens at the same time
> or not as the interrupt is active.
> 
> I'd be keen on hearing what Microchips plans to address. If tracking
> down performance issues is a priority I'll probably not spend any time
> on it, if not then I'll definetly dig into it more.
I tried to reproduce the issue in my setup with your above applications.
But surprisingly I couldn't reproduce the issue you are facing.

One end is Raspberry Pi 4 with lan8651 MAC-PHY and the other end is 
Raspberry Pi 4 with EVB-LAN8670-USB Stick.

lan8651 MAC-PHY side:
---------------------

pi@raspberrypi:~/lan865x/v4_mainline $ python3 server.py
connection from: ('192.168.5.101', 46608)

Top output:
-----------
top - 14:28:14 up  1:14,  4 users,  load average: 0.68, 0.67, 0.63
Tasks: 201 total,   1 running, 200 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.2 us,  1.1 sy,  0.0 ni, 98.7 id,  0.0 wa,  0.0 hi,  0.1 si, 
0.0 st
MiB Mem :   7810.0 total,   7110.5 free,    392.3 used,    432.4 
buff/cache
MiB Swap:    100.0 total,    100.0 free,      0.0 used.   7417.7 avail Mem

     PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ 
COMMAND 

    7219 root     -51   0       0      0      0 S   2.7   0.0   1:13.11 
oa-tc6-spi-thread 

   35307 pi        20   0   16280   9216   5248 S   0.7   0.1   0:16.53 
python3 

   88831 pi        20   0   11728   4864   2816 R   0.3   0.1   0:00.22 
top 

   89819 vnc       20   0    2320    384    384 S   0.3   0.0   0:00.04 
sh 

       1 root      20   0  168652  11580   8436 S   0.0   0.1   0:03.85 
systemd 

       2 root      20   0       0      0      0 S   0.0   0.0   0:00.01 
kthreadd 

       3 root      20   0       0      0      0 S   0.0   0.0   0:00.00 
pool_workqueue_release 

       4 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 
kworker/R-rcu_g 

       5 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 
kworker/R-rcu_p 

       6 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 
kworker/R-slub_ 

       7 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 
kworker/R-netns 

      11 root      20   0       0      0      0 I   0.0   0.0   0:00.03 
kworker/u8:0-ext4-rsv-conversion 

      12 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 
kworker/R-mm_pe

ifconfig output:
----------------
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
         inet 192.168.5.100  netmask 255.255.255.0  broadcast 0.0.0.0
         ether 04:05:06:01:02:03  txqueuelen 1000  (Ethernet)
         RX packets 1589879  bytes 2391045582 (2.2 GiB)
         RX errors 0  dropped 0  overruns 0  frame 0
         TX packets 1022419  bytes 71954905 (68.6 MiB)
         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
         device interrupt 55

dmesg output:
-------------
pi@raspberrypi:~/lan865x/v4_mainline $ dmesg
[  234.019968] LAN865X Rev.B0 Internal Phy spi0.0:00: attached PHY 
driver (mii_bus:phy_addr=spi0.0:00, irq=POLL)
[  234.069387] lan865x spi0.0 eth1: Link is Up - 10Mbps/Half - flow 
control off

EVB-LAN8670-USB stick side:
---------------------------
pi@pv-rpi-tp2:~/microchip/t1s-usb $ python3 client.py 192.168.5.100

ifconfig output:
----------------
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
         inet 192.168.5.101  netmask 255.255.255.0  broadcast 192.168.5.255
         ether 00:1e:c0:d1:ca:39  txqueuelen 1000  (Ethernet)
         RX packets 1034606  bytes 58330335 (55.6 MiB)
         RX errors 0  dropped 0  overruns 0  frame 0
         TX packets 1722400  bytes 2628199197 (2.4 GiB)
         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Let me know if you want to try anything more.

Best regards,
Parthiban V
> 
> Let me know if anything is unclear or if I can help out with anything
> specific.
> 
> R


  parent reply	other threads:[~2024-05-02 10:10 UTC|newest]

Thread overview: 121+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-18 12:56 [PATCH net-next v4 00/12] Add support for OPEN Alliance 10BASE-T1x MACPHY Serial Interface Parthiban Veerasooran
2024-04-18 12:56 ` [PATCH net-next v4 01/12] Documentation: networking: add OPEN Alliance 10BASE-T1x MAC-PHY serial interface Parthiban Veerasooran
2024-04-28  9:33   ` Bagas Sanjaya
2024-04-29 11:31     ` Parthiban.Veerasooran
2024-04-29 16:17   ` Simon Horman
2024-04-30 11:30     ` Parthiban.Veerasooran
2024-04-18 12:56 ` [PATCH net-next v4 02/12] net: ethernet: oa_tc6: implement register write operation Parthiban Veerasooran
2024-04-22 23:48   ` Andrew Lunn
2024-04-23  4:38     ` Parthiban.Veerasooran
2024-04-23 23:14   ` Andrew Lunn
2024-04-26  5:55     ` Parthiban.Veerasooran
2024-04-29 16:36   ` Simon Horman
2024-04-30  8:14     ` Parthiban.Veerasooran
2024-04-18 12:56 ` [PATCH net-next v4 03/12] net: ethernet: oa_tc6: implement register read operation Parthiban Veerasooran
2024-04-23 23:17   ` Andrew Lunn
2024-04-26  5:56     ` Parthiban.Veerasooran
2024-04-18 12:56 ` [PATCH net-next v4 04/12] net: ethernet: oa_tc6: implement software reset Parthiban Veerasooran
2024-04-23 23:26   ` Andrew Lunn
2024-04-26  6:38     ` Parthiban.Veerasooran
2024-04-18 12:56 ` [PATCH net-next v4 05/12] net: ethernet: oa_tc6: implement error interrupts unmasking Parthiban Veerasooran
2024-04-23 23:27   ` Andrew Lunn
2024-04-27 19:52   ` Ramón Nordin Rodriguez
2024-04-27 21:17     ` Andrew Lunn
2024-04-27 21:55       ` Ramón Nordin Rodriguez
2024-04-28 14:48         ` Andrew Lunn
2024-04-28  9:54       ` Ramón Nordin Rodriguez
2024-04-28 14:59         ` Andrew Lunn
2024-04-28 22:04           ` Ramón Nordin Rodriguez
2024-05-01 18:29           ` Ramón Nordin Rodriguez
2024-05-01 19:58             ` Andrew Lunn
2024-05-01 20:07             ` Andrew Lunn
2024-05-02 10:10             ` Parthiban.Veerasooran [this message]
2024-05-02 10:19               ` Ramón Nordin Rodriguez
2024-05-03  7:10                 ` Parthiban.Veerasooran
2024-05-06  1:21                   ` Andrew Lunn
2024-05-06  6:47                     ` Piergiorgio Beruto
2024-05-07 12:44                       ` Ramón Nordin Rodriguez
2024-05-13  6:41                       ` Ramón Nordin Rodriguez
2024-05-13 13:00                         ` Andrew Lunn
2024-05-13 13:50                           ` Ramón Nordin Rodriguez
2024-05-13 14:04                             ` Andrew Lunn
2024-05-15 21:45                               ` Ramón Nordin Rodriguez
2024-05-14  4:46                             ` Parthiban.Veerasooran
2024-05-15 21:48                               ` Ramón Nordin Rodriguez
2024-05-17  9:38                                 ` Parthiban.Veerasooran
2024-05-17 12:43                                   ` Ramón Nordin Rodriguez
2024-05-24 18:12                                   ` Ramón Nordin Rodriguez
2024-05-24 18:31                                     ` Andrew Lunn
2024-05-24 18:49                                       ` Piergiorgio Beruto
2024-04-18 12:56 ` [PATCH net-next v4 06/12] net: ethernet: oa_tc6: implement internal PHY initialization Parthiban Veerasooran
2024-04-23 23:48   ` Andrew Lunn
2024-04-26 13:17     ` Parthiban.Veerasooran
2024-04-18 12:56 ` [PATCH net-next v4 07/12] net: ethernet: oa_tc6: enable open alliance tc6 data communication Parthiban Veerasooran
2024-04-23 23:49   ` Andrew Lunn
2024-04-18 12:56 ` [PATCH net-next v4 08/12] net: ethernet: oa_tc6: implement transmit path to transfer tx ethernet frames Parthiban Veerasooran
2024-04-24  0:02   ` Andrew Lunn
2024-04-26 13:19     ` Parthiban.Veerasooran
2024-04-18 12:56 ` [PATCH net-next v4 09/12] net: ethernet: oa_tc6: implement receive path to receive rx " Parthiban Veerasooran
2024-04-24  0:08   ` Andrew Lunn
2024-04-26 13:45     ` Parthiban.Veerasooran
2024-04-26 18:13       ` Andrew Lunn
2024-04-29  6:13         ` Parthiban.Veerasooran
2024-04-27 20:02   ` Ramón Nordin Rodriguez
2024-04-29  8:32     ` Parthiban.Veerasooran
2024-04-29 10:45       ` Ramón Nordin Rodriguez
2024-04-18 12:56 ` [PATCH net-next v4 10/12] net: ethernet: oa_tc6: implement mac-phy interrupt Parthiban Veerasooran
2024-04-24  0:10   ` Andrew Lunn
2024-04-18 12:56 ` [PATCH net-next v4 11/12] microchip: lan865x: add driver support for Microchip's LAN865X MAC-PHY Parthiban Veerasooran
2024-04-24  0:27   ` Andrew Lunn
2024-04-26 13:32     ` Parthiban.Veerasooran
2024-04-26 18:14       ` Andrew Lunn
2024-04-29  6:13         ` Parthiban.Veerasooran
2024-04-27 19:19   ` Ramón Nordin Rodriguez
2024-04-27 19:57     ` Conor Dooley
2024-04-27 20:13       ` Ramón Nordin Rodriguez
2024-04-27 20:22         ` Conor Dooley
2024-04-27 21:09           ` Ramón Nordin Rodriguez
2024-04-29  9:47       ` Parthiban.Veerasooran
2024-04-29 12:09         ` Andrew Lunn
2024-04-30 13:30           ` Parthiban.Veerasooran
2024-04-30 16:55             ` Conor Dooley
2024-05-02  5:56               ` Parthiban.Veerasooran
2024-04-27 20:40     ` Andrew Lunn
2024-04-27 21:06       ` Ramón Nordin Rodriguez
2024-04-28 14:18         ` Andrew Lunn
2024-04-27 19:35   ` Ramón Nordin Rodriguez
2024-04-27 20:58     ` Andrew Lunn
2024-04-27 21:29       ` Ramón Nordin Rodriguez
2024-04-28 14:25         ` Andrew Lunn
2024-04-28 22:00           ` Ramón Nordin Rodriguez
2024-04-18 12:56 ` [PATCH net-next v4 12/12] dt-bindings: net: add Microchip's LAN865X 10BASE-T1S MACPHY Parthiban Veerasooran
2024-04-18 15:39   ` Conor Dooley
2024-04-22  3:59     ` Parthiban.Veerasooran
2024-04-22 15:50       ` Conor Dooley
2024-04-23  3:27         ` Parthiban.Veerasooran
2024-04-22 20:07 ` [PATCH net-next v4 00/12] Add support for OPEN Alliance 10BASE-T1x MACPHY Serial Interface Andrew Lunn
2024-04-22 20:08 ` Andrew Lunn
2024-04-22 23:23   ` Andrew Lunn
2024-05-08 13:05     ` Parthiban.Veerasooran
2024-05-08 17:04       ` Andrew Lunn
2024-05-09 13:04         ` Parthiban.Veerasooran
2024-05-09 20:39           ` Andrew Lunn
2024-05-10 11:22             ` Parthiban.Veerasooran
2024-05-24 20:52               ` Selvamani Rajagopal
2024-05-24 21:27                 ` Andrew Lunn
2024-05-24 21:45                   ` Piergiorgio Beruto
2024-05-24 21:54                     ` Andrew Lunn
2024-05-24 22:08                       ` Piergiorgio Beruto
2024-04-22 23:43 ` Andrew Lunn
2024-04-28 21:16 ` [PATCH net-next v4 13/12] net: lan865x: optional hardware reset Ramón Nordin Rodriguez
2024-04-28 23:17   ` Andrew Lunn
2024-04-29 10:42     ` Ramón Nordin Rodriguez
2024-04-29  6:09   ` Parthiban.Veerasooran
2024-04-29 10:38     ` Ramón Nordin Rodriguez
2024-04-29 12:19       ` Andrew Lunn
2024-04-30  8:04         ` Ramón Nordin Rodriguez
2024-04-30 13:30         ` Parthiban.Veerasooran
2024-04-30 14:14           ` Andrew Lunn
2024-05-02 10:10             ` Parthiban.Veerasooran
2024-04-29  6:09   ` Krzysztof Kozlowski
2024-04-29 10:44     ` Ramón Nordin Rodriguez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b7c7aad7-3e93-4c57-82e9-cb3f9e7adf64@microchip.com \
    --to=parthiban.veerasooran@microchip.com \
    --cc=Horatiu.Vultur@microchip.com \
    --cc=Nicolas.Ferre@microchip.com \
    --cc=Pier.Beruto@onsemi.com \
    --cc=Selvamani.Rajagopal@onsemi.com \
    --cc=Steen.Hegelund@microchip.com \
    --cc=Thorsten.Kummermehr@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=benjamin.bigler@bernformulastudent.ch \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=ramon.nordin.rodriguez@ferroamp.se \
    --cc=robh+dt@kernel.org \
    --cc=ruanjinjie@huawei.com \
    --cc=saeedm@nvidia.com \
    --cc=vladimir.oltean@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.