Re: [PATCH net-next v2 03/10] tun: switch to net core provided statistics counters

2020-11-06 Thread Heiner Kallweit
On 06.11.2020 08:48, Heiner Kallweit wrote: > On 06.11.2020 02:14, Jakub Kicinski wrote: >> On Wed, 4 Nov 2020 15:25:24 +0100 Heiner Kallweit wrote: >>> @@ -1066,7 +1054,7 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, >>> struct net_device *dev)

Re: [PATCH net-next v2 03/10] tun: switch to net core provided statistics counters

2020-11-05 Thread Heiner Kallweit
On 06.11.2020 02:14, Jakub Kicinski wrote: > On Wed, 4 Nov 2020 15:25:24 +0100 Heiner Kallweit wrote: >> @@ -1066,7 +1054,7 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, >> struct net_device *dev) >> return NETDEV_TX_OK; >> >> drop: >

[PATCH v2 net] r8169: disable hw csum for short packets on all chip versions

2020-11-05 Thread Heiner Kallweit
le hw checksumming for short packets in general. v2: - remove the version checks and disable short packet hw csum in general - reflect this in commit title and message Fixes: 0439297be951 ("r8169: add support for RTL8125B") Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8

Re: [PATCH net] r8169: disable hw csum for short packets and chip versions with hw padding bug

2020-11-05 Thread Heiner Kallweit
On 05.11.2020 15:20, David Laight wrote: > From: Heiner Kallweit >> Sent: 05 November 2020 13:58 >> >> RTL8125B has same or similar short packet hw padding bug as RTL8168evl. >> The main workaround has been extended accordingly, however we have to >> disable also

[PATCH net] r8169: fix potential skb double free in an error path

2020-11-05 Thread Heiner Kallweit
.c to r8169_main.c") Reported-by: Jakub Kicinski Signed-off-by: Heiner Kallweit --- The Fixes tag refers to the change from which on the patch applies. However it will apply with a little fuzz only on versions up to 5.9. --- drivers/net/ethernet/realtek/r8169_main.c | 3 ++- 1 file changed, 2

[PATCH net] r8169: disable hw csum for short packets and chip versions with hw padding bug

2020-11-05 Thread Heiner Kallweit
have to add them in one place only. Fixes: 0439297be951 ("r8169: add support for RTL8125B") Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/d

Re: [PATCH net] r8169: work around short packet hw bug on RTL8125

2020-11-05 Thread Heiner Kallweit
On 05.11.2020 02:45, Jakub Kicinski wrote: > On Tue, 3 Nov 2020 18:52:18 +0100 Heiner Kallweit wrote: >> Network problems with RTL8125B have been reported [0] and with help >> from Realtek it turned out that this chip version has a hw problem >> with short packets (similar t

Re: Very slow realtek 8169 ethernet performance, but only one interface, on ThinkPad T14.

2020-11-05 Thread Heiner Kallweit
On 05.11.2020 08:42, Qu Wenruo wrote: > > > On 2020/11/5 下午3:01, Heiner Kallweit wrote: >> On 05.11.2020 03:48, Qu Wenruo wrote: >>> Hi, >>> >>> Not sure if this is a regression or not, but just find out that after >>> upgrading to v5.9 kernel

Re: Very slow realtek 8169 ethernet performance, but only one interface, on ThinkPad T14.

2020-11-04 Thread Heiner Kallweit
On 05.11.2020 03:48, Qu Wenruo wrote: > Hi, > > Not sure if this is a regression or not, but just find out that after > upgrading to v5.9 kernel, one of my ethernet port on my ThinkPad T14 (ryzen > version) becomes very slow. > > Only *2~3* Mbps. > > The laptop has two ethernet interfaces, one

[PATCH net-next v2 10/10] net: remove ip_tunnel_get_stats64

2020-11-04 Thread Heiner Kallweit
After having migrated all users remove ip_tunnel_get_stats64(). Signed-off-by: Heiner Kallweit --- include/net/ip_tunnels.h | 2 -- net/ipv4/ip_tunnel_core.c | 9 - 2 files changed, 11 deletions(-) diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h index 02ccd3254

[PATCH net-next v2 08/10] vti: switch to dev_get_tstats64

2020-11-04 Thread Heiner Kallweit
Replace ip_tunnel_get_stats64() with the new identical core fucntion dev_get_tstats64(). Signed-off-by: Heiner Kallweit --- net/ipv4/ip_vti.c | 2 +- net/ipv6/ip6_vti.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c index b957cbee2

[PATCH net-next v2 07/10] wireguard: switch to dev_get_tstats64

2020-11-04 Thread Heiner Kallweit
Replace ip_tunnel_get_stats64() with the new identical core fucntion dev_get_tstats64(). Signed-off-by: Heiner Kallweit --- drivers/net/wireguard/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireguard/device.c b/drivers/net/wireguard/device.c index

[PATCH net-next v2 01/10] net: core: add dev_get_tstats64 as a ndo_get_stats64 implementation

2020-11-04 Thread Heiner Kallweit
It's a frequent pattern to use netdev->stats for the less frequently accessed counters and per-cpu counters for the frequently accessed counters (rx/tx bytes/packets). Add a default ndo_get_stats64() implementation for this use case. Reviewed-by: Florian Fainelli Signed-off-by: Heiner

[PATCH net-next v2 03/10] tun: switch to net core provided statistics counters

2020-11-04 Thread Heiner Kallweit
Switch tun to the standard statistics pattern: - use netdev->stats for the less frequently accessed counters - use netdev->tstats for the frequently accessed per-cpu counters Signed-off-by: Heiner Kallweit --- drivers/net/tun.c | 127 +++---

[PATCH net-next v2 02/10] net: dsa: use net core stats64 handling

2020-11-04 Thread Heiner Kallweit
Use netdev->tstats instead of a member of dsa_slave_priv for storing a pointer to the per-cpu counters. This allows us to use core functionality for statistics handling. Reviewed-by: Florian Fainelli Tested-by: Vladimir Oltean Signed-off-by: Heiner Kallweit --- net/dsa/dsa.c |

[PATCH net-next v2 05/10] net: switch to dev_get_tstats64

2020-11-04 Thread Heiner Kallweit
Replace ip_tunnel_get_stats64() with the new identical core fucntion dev_get_tstats64(). Signed-off-by: Heiner Kallweit --- drivers/net/bareudp.c | 2 +- drivers/net/geneve.c | 2 +- drivers/net/vxlan.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net

[PATCH net-next v2 06/10] gtp: switch to dev_get_tstats64

2020-11-04 Thread Heiner Kallweit
Replace ip_tunnel_get_stats64() with the new identical core fucntion dev_get_tstats64(). Signed-off-by: Heiner Kallweit --- drivers/net/gtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index dc668ed28..4c04e271f 100644 --- a/drivers

[PATCH net-next v2 09/10] ipv4/ipv6: switch to dev_get_tstats64

2020-11-04 Thread Heiner Kallweit
Replace ip_tunnel_get_stats64() with the new identical core fucntion dev_get_tstats64(). Signed-off-by: Heiner Kallweit --- net/ipv4/ip_gre.c | 6 +++--- net/ipv4/ipip.c| 2 +- net/ipv6/ip6_gre.c | 6 +++--- net/ipv6/sit.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff

[PATCH net-next v2 04/10] ip6_tunnel: switch to dev_get_tstats64

2020-11-04 Thread Heiner Kallweit
Switch ip6_tunnel to the standard statistics pattern: - use dev->stats for the less frequently accessed counters - use dev->tstats for the frequently accessed counters An additional benefit is that we now have 64bit statistics also on 32bit systems. Signed-off-by: Heiner Kallweit --- ne

[PATCH net-next v2 00/10] net: add and use dev_get_tstats64

2020-11-04 Thread Heiner Kallweit
2: - add patches for replacing ip_tunnel_get_stats64 Requested additional migrations will come in a separate series. Heiner Kallweit (10): net: core: add dev_get_tstats64 as a ndo_get_stats64 implementation net: dsa: use net core stats64 handling tun: switch to net core provided statistics

[PATCH net] r8169: work around short packet hw bug on RTL8125

2020-11-03 Thread Heiner Kallweit
RTL8125A too, even though they're not 100% sure yet which RTL8125 versions are affected. [0] https://bugzilla.kernel.org/show_bug.cgi?id=209839 Fixes: 0439297be951 ("r8169: add support for RTL8125B") Reported-by: Maxim Plotnikov Tested-by: Maxim Plotnikov Signed-off-by: Heiner Kallwei

Re: [PATCH net-next 0/5] net: add and use dev_get_tstats64

2020-11-03 Thread Heiner Kallweit
On 02.11.2020 23:36, Saeed Mahameed wrote: > On Sun, 2020-11-01 at 13:33 +0100, Heiner Kallweit wrote: >> It's a frequent pattern to use netdev->stats for the less frequently >> accessed counters and per-cpu counters for the frequently accessed >> counters (rx/tx

Re: Fwd: Problem with r8169 module

2020-11-02 Thread Heiner Kallweit
0xF8: Func Preset State 0x0003 > 0xFC: Func Force Event 0x > > > I also noticed this message when ran update-initramfs -k all -u when > installed kernel 5.9.3. > I had made a git clone from linux-firmware and copied this missed &g

Re: [PATCH net-next] r8169: set IRQF_NO_THREAD if MSI(X) is enabled

2020-11-02 Thread Heiner Kallweit
On 02.11.2020 13:41, Vladimir Oltean wrote: > On Mon, Nov 02, 2020 at 09:01:00AM +0100, Heiner Kallweit wrote: >> As mentioned by Eric it doesn't make sense to make the minimal hard irq >> handlers used with NAPI a thread. This more contributes to the problem >> than t

Re: Fwd: Problem with r8169 module

2020-11-02 Thread Heiner Kallweit
On 02.11.2020 14:20, Gilberto Nunes wrote: > Hi > > ethtool using 5.4 > ethtool doesn't know about the actual speed, because the downshift occurs PHY-internally. Please test actual the speed. Alternatively provide the output of ethtool -d , the RTL8169 chip family has an internal register refkect

Re: Fwd: Problem with r8169 module

2020-11-02 Thread Heiner Kallweit
On 02.11.2020 04:36, Gilberto Nunes wrote: > Hi there > > I am in trouble when using newer kernels than 5.4.x regarding Realtek NIC > r8169 > > Kernel 5.9.2-050902-lowlatency (from > https://kernel.ubuntu.com/~kernel-ppa/mainline/ and also compiled from > kernel.org) > > Generic FE-GE Realtek P

Re: [PATCH net-next] r8169: set IRQF_NO_THREAD if MSI(X) is enabled

2020-11-02 Thread Heiner Kallweit
On 02.11.2020 01:06, Vladimir Oltean wrote: > On Sun, Nov 01, 2020 at 11:30:44PM +0100, Heiner Kallweit wrote: >> We had to remove flag IRQF_NO_THREAD because it conflicts with shared >> interrupts in case legacy interrupts are used. Following up on the >> linked discussion

[PATCH net-next] r8169: set IRQF_NO_THREAD if MSI(X) is enabled

2020-11-01 Thread Heiner Kallweit
We had to remove flag IRQF_NO_THREAD because it conflicts with shared interrupts in case legacy interrupts are used. Following up on the linked discussion set IRQF_NO_THREAD if MSI or MSI-X is used, because both guarantee that interrupt won't be shared. Signed-off-by: Heiner Kallweit Link:

[PATCH net-next] r8169: align number of tx descriptors with vendor driver

2020-11-01 Thread Heiner Kallweit
Lowest number of tx descriptors used in the vendor drivers is 256 in r8169. r8101/r8168/r8125 use 1024 what seems to be the hw limit. Stay on the safe side and go with 256, same as number of rx descriptors. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 2 +- 1

EXPORT_SYMBOL or EXPORT_SYMBOL_GPL?

2020-11-01 Thread Heiner Kallweit
I was wondering whether we have any policy on using EXPORT_SYMBOL or EXPORT_SYMBOL_GPL for newly exported functions. I've seen both options being used.

[PATCH net-next 3/5] ip6_tunnel: use ip_tunnel_get_stats64 as ndo_get_stats64 callback

2020-11-01 Thread Heiner Kallweit
Switch ip6_tunnel to the standard statistics pattern: - use dev->stats for the less frequently accessed counters - use dev->tstats for the frequently accessed counters An additional benefit is that we now have 64bit statistics also on 32bit systems. Signed-off-by: Heiner Kallweit --- ne

[PATCH net-next 5/5] tun: switch to net core provided statistics counters

2020-11-01 Thread Heiner Kallweit
Switch tun to the standard statistics pattern: - use netdev->stats for the less frequently accessed counters - use netdev->tstats for the frequently accessed per-cpu counters Signed-off-by: Heiner Kallweit --- drivers/net/tun.c | 127 +++---

[PATCH net-next 1/5] net: core: add dev_get_tstats64 as a ndo_get_stats64 implementation

2020-11-01 Thread Heiner Kallweit
It's a frequent pattern to use netdev->stats for the less frequently accessed counters and per-cpu counters for the frequently accessed counters (rx/tx bytes/packets). Add a default ndo_get_stats64() implementation for this use case. Signed-off-by: Heiner Kallweit --- include/linux/net

[PATCH net-next 4/5] net: dsa: use net core stats64 handling

2020-11-01 Thread Heiner Kallweit
Use netdev->tstats instead of a member of dsa_slave_priv for storing a pointer to the per-cpu counters. This allows us to use core functionality for statistics handling. Signed-off-by: Heiner Kallweit --- net/dsa/dsa.c | 7 +-- net/dsa/dsa_priv.h | 2 -- net/dsa/slave.c|

[PATCH net-next 2/5] net: make ip_tunnel_get_stats64 an alias for dev_get_tstats64

2020-11-01 Thread Heiner Kallweit
ip_tunnel_get_stats64() now is a duplicate of dev_get_tstats64(). Make it an alias so that we don't have to change all users of ip_tunnel_get_stats64(). Signed-off-by: Heiner Kallweit --- include/net/ip_tunnels.h | 4 ++-- net/ipv4/ip_tunnel_core.c | 9 - 2 files changed, 2 inser

[PATCH net-next 0/5] net: add and use dev_get_tstats64

2020-11-01 Thread Heiner Kallweit
It's a frequent pattern to use netdev->stats for the less frequently accessed counters and per-cpu counters for the frequently accessed counters (rx/tx bytes/packets). Add a default ndo_get_stats64() implementation for this use case. Subsequently switch more drivers to use this pattern.

Re: [PATCH net-next 00/19] net: phy: add support for shared interrupts (part 1)

2020-10-31 Thread Heiner Kallweit
On 31.10.2020 00:36, Andrew Lunn wrote: >>> - Every PHY driver gains a .handle_interrupt() implementation that, for >>> the most part, would look like below: >>> >>> irq_status = phy_read(phydev, INTR_STATUS); >>> if (irq_status < 0) { >>> phy_error(phydev); >>> re

Re: [PATCH net-next 00/19] net: phy: add support for shared interrupts (part 1)

2020-10-30 Thread Heiner Kallweit
On 30.10.2020 23:06, Vladimir Oltean wrote: > On Fri, Oct 30, 2020 at 10:56:24PM +0100, Heiner Kallweit wrote: >> I'd just like to avoid the term "shared interrupt", because it has >> a well-defined meaning. Our major concern isn't shared interrupts >> b

Re: [PATCH net-next 00/19] net: phy: add support for shared interrupts (part 1)

2020-10-30 Thread Heiner Kallweit
- > drivers/net/phy/davicom.c| 59 ++ > drivers/net/phy/mscc/mscc_main.c | 70 + > drivers/net/phy/phy.c| 6 +- > drivers/net/phy/phy_device.c | 23 +- > drivers/net/phy/realtek.c| 128 +++ >

Re: [PATCH net-next 00/19] net: phy: add support for shared interrupts (part 1)

2020-10-30 Thread Heiner Kallweit
s/net/phy/mscc/mscc_main.c | 70 + > drivers/net/phy/phy.c| 6 +- > drivers/net/phy/phy_device.c | 23 +- > drivers/net/phy/realtek.c| 128 +++ > include/linux/phy.h | 3 + > 16 files changed, 4

[PATCH net-next] r8169: use pm_runtime_put_sync in rtl_open error path

2020-10-29 Thread Heiner Kallweit
We can safely runtime-suspend the chip if rtl_open() fails. Therefore switch the error path to use pm_runtime_put_sync() as well. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net

[PATCH net-next] r8169: remove unneeded memory barrier in rtl_tx

2020-10-29 Thread Heiner Kallweit
rtl_tx(). Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index b6c11aaa5..75df476c6 100644 --- a/drivers/net

[PATCH net-next 3/4] r8169: use struct pcpu_sw_netstats for rx/tx packet/byte counters

2020-10-29 Thread Heiner Kallweit
Switch to the net core rx/tx byte/packet counter infrastructure. This simplifies the code, only small drawback is some memory overhead because we use just one queue, but allocate the counters per cpu. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 11

[PATCH net-next 4/4] r8169: remove no longer needed private rx/tx packet/byte counters

2020-10-29 Thread Heiner Kallweit
After switching to the net core rx/tx byte/packet counters we can remove the now unused private version. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 34 --- 1 file changed, 34 deletions(-) diff --git a/drivers/net/ethernet/realtek

[PATCH net-next 1/4] net: core: add dev_sw_netstats_tx_add

2020-10-29 Thread Heiner Kallweit
Add dev_sw_netstats_tx_add(), complementing already existing dev_sw_netstats_rx_add(). Other than dev_sw_netstats_rx_add allow to pass the number of packets as function argument. Signed-off-by: Heiner Kallweit --- include/linux/netdevice.h | 12 1 file changed, 12 insertions

[PATCH net-next 2/4] net: core: add devm_netdev_alloc_pcpu_stats

2020-10-29 Thread Heiner Kallweit
We have netdev_alloc_pcpu_stats(), and we have devm_alloc_percpu(). Add a managed version of netdev_alloc_pcpu_stats, e.g. for allocating the per-cpu stats in the probe() callback of a driver. It needs to be a macro for dealing properly with the type argument. Signed-off-by: Heiner Kallweit

[PATCH net-next 0/4] net: add functionality to net core byte/packet counters and use it in r8169

2020-10-29 Thread Heiner Kallweit
This series adds missing functionality to the net core handling of byte/packet counters and statistics. The extensions are then used to remove private rx/tx byte/packet counters in r8169 driver. Heiner Kallweit (4): net: core: add dev_sw_netstats_tx_add net: core: add

Re: [PATCH net-next 1/2] net: phy: realtek: Add phy ids for RTL8226-CG/RTL8226B-CG

2020-10-29 Thread Heiner Kallweit
On 29.10.2020 14:37, Andrew Lunn wrote: > On Thu, Oct 29, 2020 at 08:07:57PM +0800, Willy Liu wrote: >> Realtek single-port 2.5Gbps Ethernet PHY ids as below: >> RTL8226-CG: 0x001cc800(ES)/0x001cc838(MP) >> RTL8226B-CG/RTL8221B-CG: 0x001cc840(ES)/0x001cc848(MP) >> ES: engineer sample >> MP: mass pr

Re: [PATCH net] r8169: fix operation under forced interrupt threading

2020-10-29 Thread Heiner Kallweit
On 29.10.2020 10:42, Thomas Gleixner wrote: > On Thu, Oct 29 2020 at 09:42, Heiner Kallweit wrote: >> On 29.10.2020 00:29, Jakub Kicinski wrote: >>> Other handles may take spin_locks, which will sleep on RT. >>> >>> I guess we may need to switch away from the _i

[PATCH net] r8169: fix issue with forced threading in combination with shared interrupts

2020-10-29 Thread Heiner Kallweit
yshev Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index 3b6ddc706..00f13805c 100644 --- a/drivers/

Re: [PATCH net] r8169: fix operation under forced interrupt threading

2020-10-29 Thread Heiner Kallweit
On 29.10.2020 00:29, Jakub Kicinski wrote: > On Wed, 28 Oct 2020 13:17:58 +0100 Heiner Kallweit wrote: >> On 28.10.2020 12:43, Serge Belyshev wrote: >>>> For several network drivers it was reported that using >>>> __napi_schedule_irqoff() is unsafe with forced th

Re: [PATCH net] r8169: fix operation under forced interrupt threading

2020-10-28 Thread Heiner Kallweit
napi_schedule_irqoff") >> Link: https://lkml.org/lkml/2020/10/18/19 >> Signed-off-by: Heiner Kallweit >> --- >> drivers/net/ethernet/realtek/r8169_main.c | 8 >> 1 file changed, 4 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/net/ethernet/

Re: [PATCH net] r8169: fix operation under forced interrupt threading

2020-10-28 Thread Heiner Kallweit
napi_schedule_irqoff") >> Link: https://lkml.org/lkml/2020/10/18/19 >> Signed-off-by: Heiner Kallweit >> --- >> drivers/net/ethernet/realtek/r8169_main.c | 8 >> 1 file changed, 4 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/net/ethernet/

Re: Remove __napi_schedule_irqoff?

2020-10-18 Thread Heiner Kallweit
On 18.10.2020 19:19, Jakub Kicinski wrote: > On Sun, 18 Oct 2020 10:20:41 +0200 Heiner Kallweit wrote: >>>> Otherwise a non-solution could be to make IRQ_FORCED_THREADING >>>> configurable. >>> >>> I have to say I do not understand why we want to defe

[PATCH net] r8169: fix operation under forced interrupt threading

2020-10-18 Thread Heiner Kallweit
hard irq handlers in drivers using NAPI a thread. Therefore ensure that the hard irq handler is never thread-ified. Fixes: 9a899a35b0d6 ("r8169: switch to napi_schedule_irqoff") Link: https://lkml.org/lkml/2020/10/18/19 Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r

Re: [RFC PATCH 01/13] net: dsa: add plumbing for custom netdev statistics

2020-10-18 Thread Heiner Kallweit
On 18.10.2020 15:48, Vladimir Oltean wrote: > On Sun, Oct 18, 2020 at 03:09:32PM +0200, Heiner Kallweit wrote: >> On 18.10.2020 14:16, Vladimir Oltean wrote: >>> On Sun, Oct 18, 2020 at 02:02:46PM +0200, Heiner Kallweit wrote: >>>> Wouldn't a simple unsigned lo

Re: [RFC PATCH 01/13] net: dsa: add plumbing for custom netdev statistics

2020-10-18 Thread Heiner Kallweit
On 18.10.2020 14:16, Vladimir Oltean wrote: > On Sun, Oct 18, 2020 at 02:02:46PM +0200, Heiner Kallweit wrote: >> Wouldn't a simple unsigned long (like in struct net_device_stats) be >> sufficient here? This would make handling the counter much simpler. >> And as far as

Re: [RFC PATCH 01/13] net: dsa: add plumbing for custom netdev statistics

2020-10-18 Thread Heiner Kallweit
On 17.10.2020 23:35, Vladimir Oltean wrote: > DSA needs to push a header onto every packet on TX, and this might cause > reallocation under certain scenarios, which might affect, for example, > performance. > > But reallocated packets are not standardized in struct pcpu_sw_netstats, > struct net_d

Re: Remove __napi_schedule_irqoff?

2020-10-18 Thread Heiner Kallweit
On 18.10.2020 11:55, Thomas Gleixner wrote: > Jakub, > > On Sat, Oct 17 2020 at 16:29, Jakub Kicinski wrote: >> On Sat, 17 Oct 2020 15:45:57 +0200 Heiner Kallweit wrote: >>> It turned out that this most of the time isn't safe in certain >>> configurati

Re: Remove __napi_schedule_irqoff?

2020-10-18 Thread Heiner Kallweit
On 18.10.2020 10:02, Eric Dumazet wrote: > On Sun, Oct 18, 2020 at 1:29 AM Jakub Kicinski wrote: >> >> On Sat, 17 Oct 2020 15:45:57 +0200 Heiner Kallweit wrote: >>> When __napi_schedule_irqoff was added with bc9ad166e38a >>> ("net: introduce napi_schedul

Remove __napi_schedule_irqoff?

2020-10-17 Thread Heiner Kallweit
When __napi_schedule_irqoff was added with bc9ad166e38a ("net: introduce napi_schedule_irqoff()") the commit message stated: "Many NIC drivers can use it from their hard IRQ handler instead of generic variant." It turned out that this most of the time isn't safe in certain configurations: - if CONF

Re: [patchlet] r8169: fix napi_schedule_irqoff() called with irqs enabled warning

2020-10-16 Thread Heiner Kallweit
On 16.10.2020 19:11, Mike Galbraith wrote: > On Fri, 2020-10-16 at 17:26 +0300, Vladimir Oltean wrote: >> On Fri, Oct 16, 2020 at 01:34:55PM +0200, Heiner Kallweit wrote: >>> I'm aware of the topic, but missing the benefits of the irqoff version >>> uncondition

Re: [patchlet] r8169: fix napi_schedule_irqoff() called with irqs enabled warning

2020-10-16 Thread Heiner Kallweit
On 16.10.2020 16:26, Vladimir Oltean wrote: > On Fri, Oct 16, 2020 at 01:34:55PM +0200, Heiner Kallweit wrote: >> I'm aware of the topic, but missing the benefits of the irqoff version >> unconditionally doesn't seem to be the best option. > > What are the benefit

Re: [patchlet] r8169: fix napi_schedule_irqoff() called with irqs enabled warning

2020-10-16 Thread Heiner Kallweit
On 16.10.2020 13:26, Mike Galbraith wrote: > > When the kernel is built with PREEMPT_RT or booted with threadirqs, > irqs are not disabled when rtl8169_interrupt() is called, inspiring > __raise_softirq_irqoff() to gripe. Use plain napi_schedule(). > I'm aware of the topic, but missing the bene

[PATCH net-next 1/4] net: core: add dev_sw_netstats_tx_add

2020-10-15 Thread Heiner Kallweit
Add dev_sw_netstats_tx_add(), complementing already existing dev_sw_netstats_rx_add(). Other than dev_sw_netstats_rx_add allow to pass the number of packets as function argument. Signed-off-by: Heiner Kallweit --- include/linux/netdevice.h | 12 1 file changed, 12 insertions

[PATCH net-next 2/4] net: core: add devm_netdev_alloc_pcpu_stats

2020-10-15 Thread Heiner Kallweit
Add a managed version of netdev_alloc_pcpu_stats, e.g. for allocating the per-cpu stats in the probe() callback of a driver. It needs to be a macro for dealing properly with the type argument. Signed-off-by: Heiner Kallweit --- include/linux/netdevice.h | 15 +++ net/devres.c

[PATCH net-next 3/4] r8169: use struct pcpu_sw_netstats for rx/tx packet/byte counters

2020-10-15 Thread Heiner Kallweit
Switch to the net core rx/tx byte/packet counter infrastructure. This simplifies the code, only small drawback is some memory overhead because we use just one queue, but allocate the counters per cpu. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 11

[PATCH net-next 4/4] r8169: remove no longer needed private rx/tx packet/byte counters

2020-10-15 Thread Heiner Kallweit
After switching to the net core rx/tx byte/packet counters we can remove the now unused private version. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 34 --- 1 file changed, 34 deletions(-) diff --git a/drivers/net/ethernet/realtek

[PATCH net-next 0/4] net: add functionality to net core byte/packet counters and use it in r8169

2020-10-15 Thread Heiner Kallweit
This series adds missing functionality to the net core handling of byte/packet counters and statistics. The extensions are used then to remove private rx/tx byte/packet counters in r8169 driver. Heiner Kallweit (4): net: core: add dev_sw_netstats_tx_add net: core: add

Re: [PATCH net-next v2 00/12] net: add and use function dev_fetch_sw_netstats for fetching pcpu_sw_netstats

2020-10-14 Thread Heiner Kallweit
On 14.10.2020 07:42, Leon Romanovsky wrote: > On Tue, Oct 13, 2020 at 05:39:51PM -0700, Jakub Kicinski wrote: >> On Mon, 12 Oct 2020 10:00:11 +0200 Heiner Kallweit wrote: >>> In several places the same code is used to populate rtnl_link_stats64 >>> fields with data from

Re: [PATCH net-next v2 00/12] net: add and use function dev_fetch_sw_netstats for fetching pcpu_sw_netstats

2020-10-14 Thread Heiner Kallweit
On 14.10.2020 09:53, Leon Romanovsky wrote: > On Wed, Oct 14, 2020 at 08:13:47AM +0200, Heiner Kallweit wrote: >> On 14.10.2020 07:42, Leon Romanovsky wrote: >>> On Tue, Oct 13, 2020 at 05:39:51PM -0700, Jakub Kicinski wrote: >>>> On Mon, 12 Oct 2020 10:00:11 +0200 H

[PATCH net-next v2 11/12] net: openvswitch: use new function dev_fetch_sw_netstats

2020-10-12 Thread Heiner Kallweit
Simplify the code by using new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit --- net/openvswitch/vport-internal_dev.c | 20 +--- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport

[PATCH net-next v2 08/12] net: dsa: use new function dev_fetch_sw_netstats

2020-10-12 Thread Heiner Kallweit
Simplify the code by using new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit Tested-by: Vladimir Oltean Reviewed-by: Florian Fainelli --- net/dsa/slave.c | 21 + 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/net/dsa/slave.c b/net/dsa

[PATCH net-next v2 04/12] net: usb: qmi_wwan: use new function dev_fetch_sw_netstats

2020-10-12 Thread Heiner Kallweit
Simplify the code by using new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit Acked-by: Bjørn Mork --- drivers/net/usb/qmi_wwan.c | 24 +--- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb

[PATCH net-next v2 10/12] mac80211: use new function dev_fetch_sw_netstats

2020-10-12 Thread Heiner Kallweit
Simplify the code by using new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit --- net/mac80211/iface.c | 23 +-- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 240862a74..1be775979 100644

[PATCH net-next v2 09/12] iptunnel: use new function dev_fetch_sw_netstats

2020-10-12 Thread Heiner Kallweit
Simplify the code by using new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit --- net/ipv4/ip_tunnel_core.c | 23 +-- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c index b2ea1a8c5

[PATCH net-next v2 02/12] IB/hfi1: use new function dev_fetch_sw_netstats

2020-10-12 Thread Heiner Kallweit
Simplify the code by using new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit --- drivers/infiniband/hw/hfi1/ipoib_main.c | 34 + 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/ipoib_main.c b/drivers/infiniband

[PATCH net-next v2 03/12] net: macsec: use new function dev_fetch_sw_netstats

2020-10-12 Thread Heiner Kallweit
Simplify the code by using new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit --- drivers/net/macsec.c | 22 +- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c index 2b0c8f01d..11ca5fa90 100644 --- a

[PATCH net-next v2 06/12] qtnfmac: use new function dev_fetch_sw_netstats

2020-10-12 Thread Heiner Kallweit
Simplify the code by using new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit Acked-by: Kalle Valo --- drivers/net/wireless/quantenna/qtnfmac/core.c | 23 +-- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac

[PATCH net-next v2 07/12] net: bridge: use new function dev_fetch_sw_netstats

2020-10-12 Thread Heiner Kallweit
Simplify the code by using new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit --- net/bridge/br_device.c | 21 + 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c index 9a2fb4aa1..6f742fee8 100644

[PATCH net-next v2 12/12] xfrm: use new function dev_fetch_sw_netstats

2020-10-12 Thread Heiner Kallweit
Simplify the code by using new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit --- net/xfrm/xfrm_interface.c | 22 +- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/net/xfrm/xfrm_interface.c b/net/xfrm/xfrm_interface.c index 5b120936d

[PATCH net-next v2 05/12] net: usbnet: use new function dev_fetch_sw_netstats

2020-10-12 Thread Heiner Kallweit
Simplify the code by using new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit --- drivers/net/usb/usbnet.c | 24 +--- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 963d260d1

[PATCH net-next v2 01/12] net: add function dev_fetch_sw_netstats for fetching pcpu_sw_netstats

2020-10-12 Thread Heiner Kallweit
L_GPL Signed-off-by: Heiner Kallweit --- include/linux/netdevice.h | 2 ++ net/core/dev.c| 34 ++ 2 files changed, 36 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index a0df43b13..fa1d8d624 100644 --- a/include/

[PATCH net-next v2 00/12] net: add and use function dev_fetch_sw_netstats for fetching pcpu_sw_netstats

2020-10-12 Thread Heiner Kallweit
L_GPL Heiner Kallweit (12): net: core: add function dev_fetch_sw_netstats for fetching pcpu_sw_netstats IB/hfi1: use new function dev_fetch_sw_netstats net: macsec: use new function dev_fetch_sw_netstats net: usb: qmi_wwan: use new function dev_fetch_sw_netstats net: usbnet: use new fun

Re: [PATCH net-next 00/12] net: add and use function dev_fetch_sw_netstats for fetching pcpu_sw_netstats

2020-10-11 Thread Heiner Kallweit
On 12.10.2020 00:10, Jakub Kicinski wrote: > On Sun, 11 Oct 2020 21:34:58 +0200 Heiner Kallweit wrote: >> In several places the same code is used to populate rtnl_link_stats64 >> fields with data from pcpu_sw_netstats. Therefore factor out this code >> to a new function

Re: [PATCH RFC] net: add helper eth_set_protocol

2020-10-11 Thread Heiner Kallweit
On 12.10.2020 00:13, Jakub Kicinski wrote: > On Tue, 6 Oct 2020 22:10:00 +0200 Heiner Kallweit wrote: >> In all cases I've seen eth_type_trans() is used as in the new helper. >> Biggest benefit is improved readability when replacing statements like >> the followi

Re: [PATCH net-next 01/12] net: core: add function dev_fetch_sw_netstats for fetching pcpu_sw_netstats

2020-10-11 Thread Heiner Kallweit
On 11.10.2020 21:54, Stephen Hemminger wrote: > On Sun, 11 Oct 2020 21:36:43 +0200 > Heiner Kallweit wrote: > >> +void dev_fetch_sw_netstats(struct rtnl_link_stats64 *s, >> + struct pcpu_sw_netstats __percpu *netstats) > > netstats is unm

[PATCH net-next 03/12] net: macsec: use new function dev_fetch_sw_netstats

2020-10-11 Thread Heiner Kallweit
Simplify the code by using new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit --- drivers/net/macsec.c | 25 + 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c index 2b0c8f01d..e74483279 100644

[PATCH net-next 10/12] mac80211: use new function dev_fetch_sw_netstats

2020-10-11 Thread Heiner Kallweit
Simplify the code by using new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit --- net/mac80211/iface.c | 23 +-- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 240862a74..1be775979 100644

[PATCH net-next 06/12] qtnfmac: use new function dev_fetch_sw_netstats

2020-10-11 Thread Heiner Kallweit
Simplify the code by using new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit --- drivers/net/wireless/quantenna/qtnfmac/core.c | 27 +-- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net

[PATCH net-next 05/12] net: usbnet: use new function dev_fetch_sw_netstats

2020-10-11 Thread Heiner Kallweit
Simplify the code by using new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit --- drivers/net/usb/usbnet.c | 24 +--- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 963d260d1

[PATCH net-next 02/12] IB/hfi1: use new function dev_fetch_sw_netstats

2020-10-11 Thread Heiner Kallweit
Simplify the code by using new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit --- drivers/infiniband/hw/hfi1/ipoib_main.c | 34 + 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/ipoib_main.c b/drivers/infiniband

[PATCH net-next 09/12] iptunnel: use new function dev_fetch_sw_netstats

2020-10-11 Thread Heiner Kallweit
Simplify the code by using new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit --- net/ipv4/ip_tunnel_core.c | 23 +-- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c index b2ea1a8c5

[PATCH net-next 11/12] net: openvswitch: use new function dev_fetch_sw_netstats

2020-10-11 Thread Heiner Kallweit
Simplify the code by using new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit --- net/openvswitch/vport-internal_dev.c | 20 +--- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport

[PATCH net-next 08/12] net: dsa: use new function dev_fetch_sw_netstats

2020-10-11 Thread Heiner Kallweit
Simplify the code by using new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit --- net/dsa/slave.c | 21 + 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/net/dsa/slave.c b/net/dsa/slave.c index e7c1d62fd..3bc5ca40c 100644 --- a/net/dsa/slave.c

[PATCH net-next 07/12] net: bridge: use new function dev_fetch_sw_netstats

2020-10-11 Thread Heiner Kallweit
Simplify the code by using new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit --- net/bridge/br_device.c | 21 + 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c index 9a2fb4aa1..6f742fee8 100644

[PATCH net-next 04/12] net: usb: qmi_wwan: use new function dev_fetch_sw_netstats

2020-10-11 Thread Heiner Kallweit
Simplify the code by using new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit --- drivers/net/usb/qmi_wwan.c | 24 +--- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 5ca1356b8

[PATCH net-next 12/12] xfrm: use new function dev_fetch_sw_netstats

2020-10-11 Thread Heiner Kallweit
Simplify the code by using new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit --- net/xfrm/xfrm_interface.c | 22 +- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/net/xfrm/xfrm_interface.c b/net/xfrm/xfrm_interface.c index 5b120936d

[PATCH net-next 01/12] net: core: add function dev_fetch_sw_netstats for fetching pcpu_sw_netstats

2020-10-11 Thread Heiner Kallweit
In several places the same code is used to populate rtnl_link_stats64 fields with data from pcpu_sw_netstats. Therefore factor out this code to a new function dev_fetch_sw_netstats(). Signed-off-by: Heiner Kallweit --- include/linux/netdevice.h | 2 ++ net/core/dev.c| 36

[PATCH net-next 00/12] net: add and use function dev_fetch_sw_netstats for fetching pcpu_sw_netstats

2020-10-11 Thread Heiner Kallweit
In several places the same code is used to populate rtnl_link_stats64 fields with data from pcpu_sw_netstats. Therefore factor out this code to a new function dev_fetch_sw_netstats(). Heiner Kallweit (12): net: core: add function dev_fetch_sw_netstats for fetching pcpu_sw_netstats IB/hfi1

<    1   2   3   4   5   6   7   8   9   10   >