All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ramón Nordin Rodriguez" <ramon.nordin.rodriguez@ferroamp.se>
To: Parthiban Veerasooran <Parthiban.Veerasooran@microchip.com>
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, andrew@lunn.ch, 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: Sat, 27 Apr 2024 21:52:15 +0200	[thread overview]
Message-ID: <Zi1Xbz7ARLm3HkqW@builder> (raw)
In-Reply-To: <20240418125648.372526-6-Parthiban.Veerasooran@microchip.com>

> +static int oa_tc6_unmask_macphy_error_interrupts(struct oa_tc6 *tc6)
> +{
> +	u32 regval;
> +	int ret;
> +
> +	ret = oa_tc6_read_register(tc6, OA_TC6_REG_INT_MASK0, &regval);
> +	if (ret)
> +		return ret;
> +
> +	regval &= ~(INT_MASK0_TX_PROTOCOL_ERR_MASK |
> +		    INT_MASK0_RX_BUFFER_OVERFLOW_ERR_MASK |
> +		    INT_MASK0_LOSS_OF_FRAME_ERR_MASK |
> +		    INT_MASK0_HEADER_ERR_MASK);
> +
> +	return oa_tc6_write_register(tc6, OA_TC6_REG_INT_MASK0, regval);
> +}
> +

This togheter with patch 11 works poorly for me. I get alot of kernel
output, dropped packets and lower performance.
Below is an example for a run when I curl a 10MB blob

time curl 20.0.0.55:8000/rdump -o dump -w '{%speed_download}'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  U[  387.944737] net_ratelimit: 38 callbacks suppressed
pload   Total   Spent    Left  Sp[  387.944755] eth0: Receive buffer overflow error
eed
  0     0    0     0    0     0      0      0 --:--:-- --:-[  387.961424] eth0: Receive buffer overflow error
  0 10.0M    0  2896    0     0  13031      0  0:13:24 --:--:--  0:13:24 12986[  388.204257] eth0: Receive buffer overflow error
[  388.209848] eth0: Receive buffer overflow error
[  388.240705] eth0: Receive buffer overflow error
[  388.246205] eth0: Receive buffer overflow error
[  388.360265] eth0: Receive buffer overflow error
[  388.365755] eth0: Receive buffer overflow error
[  388.371328] eth0: Receive buffer overflow error
[  388.396937] eth0: Receive buffer overflow error
 32 10.0M   32 3362k    0     0   826k      0  0:00:12  0:00:04  0:00:08  826k[  392.950696] net_ratelimit: 84 callbacks suppressed
[  392.950711] eth0: Receive buffer overflow error
 41 10.0M   41 4259k    0     0   840k      0  0:00:12  0:00:05  0:00:07  878k[  393.009785] eth0: Receive buffer overflow error
[  393.016651] eth0: Receive buffer overflow error
[  393.121278] eth0: Receive buffer overflow error
[  393.126876] eth0: Receive buffer overflow error
[  393.204983] eth0: Receive buffer overflow error
[  393.210590] eth0: Receive buffer overflow error
[  393.248977] eth0: Receive buffer overflow error
[  393.254575] eth0: Receive buffer overflow error
[  393.352949] eth0: Receive buffer overflow error
 77 10.0M   77 7903k    0     0   870k      0  0:00:11  0:00:09  0:00:02  906k[  397.956674] net_ratelimit: 88 callbacks suppressed
[  397.956691] eth0: Receive buffer overflow error
[  397.967182] eth0: Receive buffer overflow error
 86 10.0M   86 8837k    0     0   877k      0  0:00:11  0:00:10  0:00:01  915k[  398.048630] eth0: Receive buffer overflow error
[  398.054171] eth0: Receive buffer overflow error
[  398.092858] eth0: Receive buffer overflow error
[  398.113975] eth0: Receive buffer overflow error
[  398.177558] eth0: Receive buffer overflow error
[  398.209782] eth0: Receive buffer overflow error
[  398.272621] eth0: Receive buffer overflow error
[  398.278306] eth0: Receive buffer overflow error
100 10.0M  100 10.0M    0     0   877k      0  0:00:11  0:00:11 --:--:--  921k
{%speed_download}
real    0m11.681s
user    0m0.117s
sys     0m0.226s

I tried this patch

diff --git a/drivers/net/ethernet/oa_tc6.c b/drivers/net/ethernet/oa_tc6.c
index 9f17f3712137..bd7bd3ef6897 100644
--- a/drivers/net/ethernet/oa_tc6.c
+++ b/drivers/net/ethernet/oa_tc6.c
@@ -615,21 +615,9 @@ static int oa_tc6_sw_reset_macphy(struct oa_tc6 *tc6)
        return oa_tc6_write_register(tc6, OA_TC6_REG_STATUS0, regval);
 }

-static int oa_tc6_unmask_macphy_error_interrupts(struct oa_tc6 *tc6)
+static int oa_tc6_disable_imask0_interrupts(struct oa_tc6 *tc6)
 {
-       u32 regval;
-       int ret;
-
-       ret = oa_tc6_read_register(tc6, OA_TC6_REG_INT_MASK0, &regval);
-       if (ret)
-               return ret;
-
-       regval &= ~(INT_MASK0_TX_PROTOCOL_ERR_MASK |
-                   INT_MASK0_RX_BUFFER_OVERFLOW_ERR_MASK |
-                   INT_MASK0_LOSS_OF_FRAME_ERR_MASK |
-                   INT_MASK0_HEADER_ERR_MASK);
-
-       return oa_tc6_write_register(tc6, OA_TC6_REG_INT_MASK0, regval);
+       return oa_tc6_write_register(tc6, OA_TC6_REG_INT_MASK0, (u32)-1);
 }

 static int oa_tc6_enable_data_transfer(struct oa_tc6 *tc6)
@@ -1234,7 +1222,7 @@ struct oa_tc6 *oa_tc6_init(struct spi_device *spi, struct net_device *netdev)
                return NULL;
        }

-       ret = oa_tc6_unmask_macphy_error_interrupts(tc6);
+       ret = oa_tc6_disable_imask0_interrupts(tc6);
        if (ret) {
                dev_err(&tc6->spi->dev,
                        "MAC-PHY error interrupts unmask failed: %d\n", ret);

Which results in no log spam, ~5-10% higher throughput and no dropped
packets when I look at /sys/class/net/eth0/statistics/rx_dropped

Wheras when I did an equivalent run with a 100MB file I got 1918
rx_dropped with interrupts enabled.

When I dig through wireshark I can see some retransmissions when
interrupts are disabled, but the network stack seems to handle that with
grace.

Maybe the decision on wheter to enable interrupts or not should be on
the mac driver level, not network framework level?
If this really is preferrable for some reason, could a module option be
added so that it does not require running a fork to disable interrupts?

There is also a interrupt mask 1 register that is not touched in this
patch series, and since things started working better for me with just
touching reg0 I didn't bother tweaking anything int reg1.

BR
Ramón

  parent reply	other threads:[~2024-04-27 19:52 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 [this message]
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
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=Zi1Xbz7ARLm3HkqW@builder \
    --to=ramon.nordin.rodriguez@ferroamp.se \
    --cc=Nicolas.Ferre@microchip.com \
    --cc=Parthiban.Veerasooran@microchip.com \
    --cc=Pier.Beruto@onsemi.com \
    --cc=Selvamani.Rajagopal@onsemi.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=horatiu.vultur@microchip.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=robh+dt@kernel.org \
    --cc=ruanjinjie@huawei.com \
    --cc=saeedm@nvidia.com \
    --cc=steen.hegelund@microchip.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.