Thecus N2100.
v2:
- reduce scope of N2100 change to using the new PCI core quirk
v3:
- improve commit message of patch 2
Heiner Kallweit (3):
PCI: Disable parity checking if broken_parity_status is set
ARM: iop32x: improve N2100 PCI broken parity quirk
r8169: simplify broken parity handling
On 06.01.2021 18:37, Bjorn Helgaas wrote:
> On Wed, Jan 06, 2021 at 12:05:41PM +0100, Heiner Kallweit wrote:
>> Use new PCI core function pci_quirk_broken_parity(), in addition to
>> setting broken_parity_status is disables parity checking.
>
> That sentence has a typo or so
Use WARN_ONCE here to get a call trace in case of a problem.
This facilitates finding the offending code part.
Signed-off-by: Heiner Kallweit
---
drivers/net/ethernet/realtek/r8169_main.c | 17 ++---
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet
If WOL isn't enabled, then there's no need to enable wakeup from D3.
Signed-off-by: Heiner Kallweit
---
drivers/net/ethernet/realtek/r8169_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/realtek/r8169_main.c
b/drivers/net/ethern
Use WARN here to avoid stopping the system. In addition print the addr
and mask values that triggered the warning.
Signed-off-by: Heiner Kallweit
---
drivers/net/ethernet/realtek/r8169_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/realtek
This series includes a number of smaller improvements.
Heiner Kallweit (3):
r8169: replace BUG_ON with WARN in _rtl_eri_write
r8169: improve rtl_ocp_reg_failure
r8169: don't wakeup-enable device on shutdown if WOL is disabled
drivers/net/ethernet/realtek/r8169_main.c
Switch to lockdep_assert_held(_once), similar to what is being done
in other subsystems. One advantage is that there's zero runtime
overhead if lockdep support isn't enabled.
Signed-off-by: Heiner Kallweit
---
drivers/net/phy/mdio_bus.c | 4 ++--
drivers/net/phy/phy.c| 2 +
Meanwhile the PCI core disables parity checking for a device that has
broken_parity_status set. Therefore we don't need the quirk any longer
to disable parity checking on the first parity error interrupt.
Signed-off-by: Heiner Kallweit
---
drivers/net/ethernet/realtek/r8169_main.c
Use new PCI core function pci_quirk_broken_parity(), in addition to
setting broken_parity_status is disables parity checking.
This allows us to remove a quirk in r8169 driver.
Signed-off-by: Heiner Kallweit
---
v2:
- remove additional changes from this patch
---
arch/arm/mach-iop32x/n2100.c | 2
Thecus N2100.
v2:
- reduce scope of N2100 change to using the new PCI core quirk
Heiner Kallweit (3):
PCI: Disable parity checking if broken_parity_status is set
ARM: iop32x: improve N2100 PCI broken parity quirk
r8169: simplify broken parity handling now that PCI core takes care
arch/arm
Thecus N2100.
Signed-off-by: Heiner Kallweit
Reviewed-by: Leon Romanovsky
---
drivers/pci/quirks.c | 17 +++--
include/linux/pci.h | 2 ++
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 653660e3b..ab54e26b8 100644
the change as an improvement.
The PHY driver has no means to access the chip ERI registers,
therefore we have to intercept MDIO writes to BMCR register.
If the BMCR_PDOWN bit is going to be set, then let's apply the
quirk before actually powering down the PHY.
Signed-off-by: Heiner Kallweit
-
No functional change here. We just move a code block to avoid a
function forward declaration in a subsequent change.
Signed-off-by: Heiner Kallweit
---
drivers/net/ethernet/realtek/r8169_main.c | 128 +++---
1 file changed, 64 insertions(+), 64 deletions(-)
diff --git a/drivers
the change as an improvement.
The PHY driver has no means to access the chip ERI registers,
therefore we have to intercept MDIO writes to the BMCR register.
If the BMCR_PDOWN bit is going to be set, then let's apply the
quirk before actually powering down the PHY.
Heiner Kallweit (2):
On 06.01.2021 01:52, Russell King - ARM Linux admin wrote:
> On Wed, Jan 06, 2021 at 01:44:03AM +0100, Heiner Kallweit wrote:
>> The machine type check is there to protect from (theoretical) cases
>> where the n2100 code (incl. the RTL8169 quirk) may be compiled in,
>> but
On 06.01.2021 01:28, Bjorn Helgaas wrote:
> On Tue, Jan 05, 2021 at 10:42:31AM +0100, Heiner Kallweit wrote:
>> Simplify the quirk by using new PCI core function
>> pci_quirk_broken_parity(). In addition make the quirk
>> more specific, use device id 0x8169 instead of PCI_ANY
alled afterward. For phy_state_machine(),
> no state transition happens, because old_state = PHY_HALTED and
> phy_dev->state = PHY_HALTED.
>
> Signed-off-by: Marek Vasut
> Cc: Andrew Lunn
> Cc: David S. Miller
> Cc: Heiner Kallweit
> ---
> drivers/net/phy/phy.c | 10 ++
On 05.01.2021 18:05, Russell King - ARM Linux admin wrote:
> On Tue, Jan 05, 2021 at 05:58:21PM +0100, Heiner Kallweit wrote:
>> On 05.01.2021 17:11, Marek Vasut wrote:
>>> @@ -1021,8 +1022,17 @@ void phy_stop(struct phy_device *phydev)
>>&
kub are missing as maintainers.
> Signed-off-by: Marek Vasut
> Cc: Andrew Lunn
> Cc: David S. Miller
> Cc: Heiner Kallweit
> ---
> drivers/net/phy/phy.c | 10 ++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/ph
Simplify the quirk by using new PCI core function
pci_quirk_broken_parity(). In addition make the quirk
more specific, use device id 0x8169 instead of PCI_ANY_ID.
Signed-off-by: Heiner Kallweit
---
arch/arm/mach-iop32x/n2100.c | 8 +++-
1 file changed, 3 insertions(+), 5 deletions(-)
diff
Meanwhile the PCI core disables parity checking for a device that has
broken_parity_status set. Therefore we don't need the quirk any longer
to disable parity checking on the first parity error interrupt.
Signed-off-by: Heiner Kallweit
---
drivers/net/ethernet/realtek/r8169_main.c
Thecus N2100.
Signed-off-by: Heiner Kallweit
---
drivers/pci/quirks.c | 17 +++--
include/linux/pci.h | 2 ++
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 653660e3b..ab54e26b8 100644
--- a/drivers/pci/quirks.c
Thecus N2100.
Heiner Kallweit (3):
PCI: Disable parity checking if broken_parity_status is set
ARM: iop32x: improve N2100 PCI broken parity quirk
r8169: simplify broken parity handling now that PCI core takes care
arch/arm/mach-iop32x/n2100.c | 8 +++-
drivers/net/ethernet
On 04.01.2021 18:28, Hongwei Zhang wrote:
>
>> From: Jakub Kicinski
>> Sent: Monday, December 28, 2020 5:01 PM
>>
>> On Tue, 22 Dec 2020 22:00:34 +0100 Andrew Lunn wrote:
>>> On Tue, Dec 22, 2020 at 09:46:52PM +0100, Heiner Kallweit wrote:
>>&
A user reported failing network with RTL8168dp (a quite rare chip
version). Realtek confirmed that few chip versions suffer from a PLL
power-down hw bug.
Fixes: 07df5bd874f0 ("r8169: power down chip in probe")
Signed-off-by: Heiner Kallweit
---
Note that since the original change s
On 30.12.2020 17:15, Florian Fainelli wrote:
>
>
> On 12/30/2020 1:12 AM, Heiner Kallweit wrote:
>> On 30.12.2020 10:07, DENG Qingfang wrote:
>>> Hi Heiner,
>>> Thanks for your reply.
>>>
>>> On Wed, Dec 30, 2020 at 3:39 PM Heiner Kallweit
&
On 30.12.2020 10:07, DENG Qingfang wrote:
> Hi Heiner,
> Thanks for your reply.
>
> On Wed, Dec 30, 2020 at 3:39 PM Heiner Kallweit wrote:
>> I don't think that's the best option.
>
> I'm well aware of that.
>
>> You may want to add a PHY dr
On 30.12.2020 05:22, DENG Qingfang wrote:
> Hi,
>
> I added MT7530 IRQ support and registered its internal PHYs to IRQ.
> It works but my patch used two hacks.
>
> 1. Removed phy_drv_supports_irq check, because config_intr and
> handle_interrupt are not set for Generic PHY.
>
I don't think that'
On 25.12.2020 01:47, Yuusuke Ashizuka wrote:
> RTL9000AA/AN as 100BASE-T1 is following:
> - 100 Mbps
> - Full duplex
> - Link Status Change Interrupt
>
> Signed-off-by: Yuusuke Ashizuka
> Signed-off-by: Torii Kenichi
> ---
> drivers/net/phy/realtek.c | 51 +++
On 23.12.2020 15:11, Zheng Yongjun wrote:
> Signed-off-by: Zheng Yongjun
> ---
> drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
> b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
;
> Hi Heiner,
>
>> From:Heiner Kallweit
>> Sent:Monday, December 21, 2020 4:37 PM
>>> Change the order of reading MAC address, try to read it from MAC chip
>>> first, if it's not availabe, then try to read it from device tree.
>>&
Am 21.12.2020 um 21:51 schrieb Hongwei Zhang:
> Change the order of reading MAC address, try to read it from MAC chip
> first, if it's not availabe, then try to read it from device tree.
>
This commit message leaves a number of questions. It seems the change
isn't related at all to the change that
Add a constant RTL_GIGA_MAC_MAX and use it if all new chip versions
handle a feature in a specific way. As result we have to touch less
places when adding support for a new chip version.
Signed-off-by: Heiner Kallweit
---
drivers/net/ethernet/realtek/r8169.h | 3 ++-
drivers/net/ethernet
Am 11.12.2020 um 13:43 schrieb Sven Van Asbroeck:
> Hi Heiner,
>
> On Thu, Dec 10, 2020 at 2:32 AM Heiner Kallweit wrote:
>>
>>
>> In addition you could play with sysfs attributes
>> /sys/class/net//gro_flush_timeout
>> /sys/class/net//napi_defer_hard_irqs
nly if something is really very unlikely.
I think that's the case here.
Patch was created with some help from coccinelle.
@@
expression dev, dma_addr;
@@
- unlikely(dma_mapping_error(dev, dma_addr))
+ dma_mapping_error(dev, dma_addr)
Signed-off-by: Heiner Kallweit
---
If ok, then tbd throu
Am 10.12.2020 um 04:55 schrieb Sven Van Asbroeck:
> From: Sven Van Asbroeck
>
> Even if there is more rx data waiting on the chip, the rx napi poll fn
> will never run more than once - it will always read a few buffers, then
> bail out and re-arm interrupts. Which results in ping-pong between nap
herefore remove pci_try_set_mwi() and remove the
__must_check attribute from pci_set_mwi().
I don't expect either function to be used in new code anyway.
Signed-off-by: Heiner Kallweit
---
patch applies on top of pci/misc for v5.11
---
Documentation/PCI/pci.rst |
eft with a normal counter variable,
this allows to simplify the code. Last but not least there's no need
any longer to pass the budget as an u32.
Signed-off-by: Heiner Kallweit
---
drivers/net/ethernet/realtek/r8169_main.c | 15 +--
1 file changed, 5 insertions(+), 10 deletions(-
After recent changes there's no need any longer to define NUM_RX_DESC
as an unsigned value.
Signed-off-by: Heiner Kallweit
---
drivers/net/ethernet/realtek/r8169_main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169_main.c
b/dr
This series improves rtl_rx() and the handling of NUM_RX_DESC.
Heiner Kallweit (2):
r8169: improve rtl_rx
r8169: make NUM_RX_DESC a signed int
drivers/net/ethernet/realtek/r8169_main.c | 21 -
1 file changed, 8 insertions(+), 13 deletions(-)
--
2.29.2
Am 03.12.2020 um 15:38 schrieb Kiyanovski, Arthur:
>
>
>> -Original Message-----
>> From: Heiner Kallweit
>> Sent: Wednesday, December 2, 2020 11:55 PM
>> To: Kiyanovski, Arthur ; k...@kernel.org;
>> netdev@vger.kernel.org
>> Cc: Woodhouse,
Am 02.12.2020 um 21:03 schrieb akiy...@amazon.com:
> From: Arthur Kiyanovski
>
> The patch changes the maximum number of RX/TX queues it advertises to
> the kernel (via alloc_etherdev_mq()) from a value received from the
> device to a constant value which is the minimum between 128 and the
> numb
On chip versions supporting tally counter reset we currently update
the counters after a reset although we know all counters are zero.
Skip this unnecessary step.
Signed-off-by: Heiner Kallweit
---
drivers/net/ethernet/realtek/r8169_main.c | 25 ---
1 file changed, 9
Am 29.11.2020 um 22:17 schrieb Christophe JAILLET:
> he wrappers in include/linux/pci-dma-compat.h should go away.
>
> The patch has been generated with the coccinelle script below and has been
> hand modified to replace GFP_ with a correct flag.
> It has been compile tested.
>
> When memory is a
Am 25.11.2020 um 23:51 schrieb akiy...@amazon.com:
> From: Arthur Kiyanovski
>
> Introduce ena_increase_stat_atomic() function to increase statistics by
> certain number.
> The function includes the
> - lock aquire
> - stat increase
> - lock release
>
Having "atomic" in the name may
Am 24.11.2020 um 23:33 schrieb Antonio Borneo:
> On Tue, 2020-11-24 at 23:22 +0100, Heiner Kallweit wrote:
>> Am 24.11.2020 um 22:59 schrieb Antonio Borneo:
>>> The rtl8211f supports downshift and before commit 5502b218e001
>>> ("net: phy: use phy_resolve_ane
e existing
> function rtlgen_read_status().
>
> Signed-off-by: Antonio Borneo
> Link:
> https://lore.kernel.org/r/478f871a-583d-01f1-9cc5-2eea56d8c...@huawei.com
> ---
> To: Andrew Lunn
> To: Heiner Kallweit
> To: Russell King
> To: "David S. Miller"
>
Am 24.11.2020 um 16:17 schrieb Antonio Borneo:
> On Tue, 2020-11-24 at 14:56 +, Russell King - ARM Linux admin wrote:
>> On Tue, Nov 24, 2020 at 03:38:48PM +0100, Antonio Borneo wrote:
>>> If the auto-negotiation fails to establish a gigabit link, the phy
>>> can try to 'down-shift': it resets
7;.
>
> Fixes: 5502b218e001 ("net: phy: use phy_resolve_aneg_linkmode in
> genphy_read_status")
> Cc: sta...@vger.kernel.org # v5.1+
> Signed-off-by: Antonio Borneo
> Link:
> https://lore.kernel.org/r/478f871a-583d-01f1-9cc5-2eea56d8c...@huawei.com
> ---
> To:
/msg690794.html
Signed-off-by: Heiner Kallweit
---
net/core/dev.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/net/core/dev.c b/net/core/dev.c
index 4bfdcd6b2..3c3070d9d 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3495,6 +3495,11 @@ static netdev_features_t gso_features_ch
Use netdev->tstats instead of a member of net_bridge 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/bridge/br_device.c | 31 +--
net/bridge/br_input.c |
Am 19.11.2020 um 22:41 schrieb Andrew Lunn:
Doesn't checkpatch complain about line length > 80 here?
>>>
>>> :)
>>>
>>> commit bdc48fa11e46f867ea4d75fa59ee87a7f48be144
>>> Author: Joe Perches
>>> Date: Fri May 29 16:12:21 2020 -0700
>>>
>>> checkpatch/coding-style: deprecate 80-column w
Am 19.11.2020 um 22:17 schrieb Grygorii Strashko:
>
>
> On 19/11/2020 23:11, Heiner Kallweit wrote:
>> Am 19.11.2020 um 21:34 schrieb Grygorii Strashko:
>>> The mdio_bus may have dependencies from GPIO controller and so got
>>> deferred. Now it will print error
Am 19.11.2020 um 21:34 schrieb Grygorii Strashko:
> The mdio_bus may have dependencies from GPIO controller and so got
> deferred. Now it will print error message every time -EPROBE_DEFER is
> returned which from:
> __mdiobus_register()
> |-devm_gpiod_get_optional()
> without actually identifying
Tiny improvement, let dev_err_probe() deal with EPROBE_DEFER.
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
ed hw will trigger
a tx done interrupt and we come here again (with skb != NULL)
and ring the doorbell if needed
Therefore skip the workaround doorbell ring if skb is NULL.
Signed-off-by: Heiner Kallweit
---
drivers/net/ethernet/realtek/r8169_main.c | 7 +--
1 file changed, 5 insert
Am 19.11.2020 um 20:18 schrieb Shay Agroskin:
>
> Heiner Kallweit writes:
>
>> Am 18.11.2020 um 23:35 schrieb Heiner Kallweit:
>>> Am 18.11.2020 um 22:59 schrieb Shay Agroskin:
>>>> The ENA driver uses the readless mechanism, which uses DMA, to find
>>
Am 19.11.2020 um 14:38 schrieb Grygorii Strashko:
>
>
> On 19/11/2020 14:30, Heiner Kallweit wrote:
>> Am 18.11.2020 um 15:24 schrieb Grygorii Strashko:
>>> The mdio_bus may have dependencies from GPIO controller and so got
>>> deferred. Now it will print error
Am 18.11.2020 um 15:24 schrieb Grygorii Strashko:
> The mdio_bus may have dependencies from GPIO controller and so got
> deferred. Now it will print error message every time -EPROBE_DEFER is
> returned from:
> __mdiobus_register()
> |-devm_gpiod_get_optional()
> without actually identifying error
Am 18.11.2020 um 23:35 schrieb Heiner Kallweit:
> Am 18.11.2020 um 22:59 schrieb Shay Agroskin:
>> The ENA driver uses the readless mechanism, which uses DMA, to find
>> out what the DMA mask is supposed to be.
>>
>> If DMA is used without setting the dma_mask first, i
Am 18.11.2020 um 22:59 schrieb Shay Agroskin:
> The ENA driver uses the readless mechanism, which uses DMA, to find
> out what the DMA mask is supposed to be.
>
> If DMA is used without setting the dma_mask first, it causes the
> Intel IOMMU driver to think that ENA is a 32-bit device and therefor
In rtl_tx() the released descriptors are zero'ed by
rtl8169_unmap_tx_skb(). And in the beginning of rtl8169_start_xmit()
we check that enough descriptors are free, therefore there's no way
the DescOwn bit can be set here.
Signed-off-by: Heiner Kallweit
---
drivers/net/ethern
Struct br_vlan_stats duplicates pcpu_sw_netstats (apart from
br_vlan_stats not defining an alignment requirement), therefore
switch to using the latter one.
Signed-off-by: Heiner Kallweit
---
net/bridge/br_netlink.c | 2 +-
net/bridge/br_private.h | 14 +++---
net/bridge/br_vlan.c
> Without this, we get data corruption and crashes on machines with 4 GB
> of RAM or more.
>
> - Chris
>
> On Mon, Nov 16, 2020 at 11:14 PM Heiner Kallweit wrote:
>>
>> Am 17.11.2020 um 03:55 schrieb Zhang Changzhong:
>>> Fix to return a negative error cod
Am 17.11.2020 um 03:55 schrieb Zhang Changzhong:
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
>
> Fixes: 85eb5bc33717 ("net: atheros: switch from 'pci_' to 'dma_' API")
> Reported-by: Hulk Robot
> Signed-off-by: Zhang Chang
The only time when nr_frags isn't SKB_MAX_FRAGS is when entering
rtl8169_start_xmit(). However we can use SKB_MAX_FRAGS also here
because when queue isn't stopped there should always be room for
MAX_SKB_FRAGS + 1 descriptors.
Signed-off-by: Heiner Kallweit
---
drivers/net/ethern
The only time when nr_frags isn't SKB_MAX_FRAGS is when entering
rtl8169_start_xmit(). However we can use SKB_MAX_FRAGS also here
because when queue isn't stopped there should always be room for
MAX_SKB_FRAGS + 1 descriptors.
Signed-off-by: Heiner Kallweit
---
drivers/net/ethern
\
(mii_bus:phy_addr=r8169-300:00, irq=IGNORE)
Signed-off-by: Heiner Kallweit
---
drivers/net/phy/phy_device.c | 14 ++
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index e13a46c25..04652603a 100644
--- a/drivers/net
ull memory barrier on some platforms, therefore use
smp_mb__after_atomic to avoid overhead
Signed-off-by: Heiner Kallweit
---
drivers/net/ethernet/realtek/r8169_main.c | 15 ++-
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169_main.c
re API instead of ieee80211_tx/rx_stats().
>
> Signed-off-by: Lev Stipakov
> ---
> v2: also replace ieee80211_rx_stats() with dev_sw_netstats_rx_add()
>
Reviewed-by: Heiner Kallweit
ile on it, remove xfrmi_get_stats64() and replace it with
> dev_get_tstats64().
>
> Signed-off-by: Lev Stipakov
> ---
>
Reviewed-by: Heiner Kallweit
le on it, remove internal_get_stats() and replace it
> with dev_get_tstats64().
>
> Signed-off-by: Lev Stipakov
> ---
>
> v2:
> - do not delete len variable and add comment why
> - replace internal_get_stats() vs dev_get_tstats64()
>
Reviewed-by: Heiner Kallweit
In br_forward.c and br_input.c fields dev->stats.tx_dropped and
dev->stats.multicast are populated, but they are ignored in
ndo_get_stats64.
Fixes: 28172739f0a2 ("net: fix 64 bit counters on 32 bit arches")
Signed-off-by: Heiner Kallweit
---
Patch will not apply cleanly on kern
Am 12.11.2020 um 12:09 schrieb Lev Stipakov:
> Commit d3fd65484c781 ("net: core: add dev_sw_netstats_tx_add")
> has added function "dev_sw_netstats_tx_add()" to update
> net device per-cpu TX stats.
>
> Use this function instead of ieee80211_tx_stats().
>
I think you can do the same with ieee8021
Am 12.11.2020 um 12:11 schrieb Lev Stipakov:
> Commit d3fd65484c781 ("net: core: add dev_sw_netstats_tx_add") has added
> function "dev_sw_netstats_tx_add()" to update net device per-cpu TX
> stats.
>
> Use this function instead of own code. While on it, replace
> "len" variable with "skb->len".
>
Am 13.11.2020 um 00:30 schrieb Jakub Kicinski:
> On Thu, 12 Nov 2020 13:09:53 +0200 Lev Stipakov wrote:
>> Commit d3fd65484c781 ("net: core: add dev_sw_netstats_tx_add")
>> has added function "dev_sw_netstats_tx_add()" to update
>> net device per-cpu TX stats.
>>
>> Use this function instead of iee
Am 12.11.2020 um 12:13 schrieb Lev Stipakov:
> Commit d3fd65484c781 ("net: core: add dev_sw_netstats_tx_add") has added
> function "dev_sw_netstats_tx_add()" to update net device per-cpu TX
> stats.
>
> Use this function instead of own code.
>
LGTM. In addition you can replace xfrmi_get_stats64()
Am 12.11.2020 um 14:49 schrieb Jason Gunthorpe:
> On Wed, Nov 11, 2020 at 09:03:55AM -0800, Jakub Kicinski wrote:
>> On Tue, 10 Nov 2020 20:47:34 +0100 Heiner Kallweit wrote:
>>> Use netdev->tstats instead of a member of hfi1_ipoib_dev_priv for storing
>>> a pointer
Just got the following when running iperf3 on linux-next from yesterday.
Haven't seen this error before.
[ 91.508431] [ cut here ]
[ 91.508642] WARNING: CPU: 2 PID: 2320 at net/core/stream.c:207
sk_stream_kill_queues+0x10d/0x120
[ 91.508755] Modules linked in: snd_h
icitly
adds a WRITE_ONCE() to the write.
Signed-off-by: Heiner Kallweit
---
drivers/net/ethernet/realtek/r8169_main.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169_main.c
b/drivers/net/ethernet/realtek/r8169_main.c
index 641c94a46..891
tp->dirty_tx and tp->cur_tx may be changed by a racing rtl_tx() or
rtl8169_start_xmit(). Use READ_ONCE() to annotate the races and ensure
that the compiler doesn't use cached values.
Signed-off-by: Heiner Kallweit
---
drivers/net/ethernet/realtek/r8169_main.c | 3 ++-
1 file
struct net_device. All we need
is a dozen lines of code. Resources then can be allocated with e.g.
struct device *devm = &dev->devres_up;
devm_kzalloc(devm, size, gfp);
Signed-off-by: Heiner Kallweit
---
include/linux/netdevice.h | 2 ++
net/core/dev.c| 15 +--
Use netdev->tstats instead of a member of qmimux_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
---
drivers/net/usb/qmi_wwan.c | 39 --
1 file changed
Use netdev->tstats instead of a member of usbnet for storing a pointer
to the per-cpu counters. This allows us to use core functionality for
statistics handling.
Signed-off-by: Heiner Kallweit
---
drivers/net/usb/usbnet.c | 23 +++
include/linux/usb/usbnet.h | 6 ++
Replace usbnet_get_stats64() with new identical core function
dev_get_tstats64() in all users and remove usbnet_get_stats64().
Signed-off-by: Heiner Kallweit
---
drivers/net/usb/aqc111.c | 2 +-
drivers/net/usb/asix_devices.c| 6 +++---
drivers/net/usb/ax88172a.c| 2
Use netdev->tstats instead of a member of hfi1_ipoib_dev_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
---
drivers/infiniband/hw/hfi1/driver.c | 4 +---
drivers/infiniband/hw/hfi1/ipoi
tricky. Best option
seems to be to use the ndo_init/ndo_uninit callbacks.
Signed-off-by: Heiner Kallweit
---
drivers/net/wireless/quantenna/qtnfmac/core.c | 78 ---
drivers/net/wireless/quantenna/qtnfmac/core.h | 4 -
.../quantenna/qtnfmac/pcie/pearl_pcie.c | 4 +-
.../qua
Switch further drivers to core functionality for handling per-cpu
byte/packet counters.
All changes are compile-tested only.
Heiner Kallweit (5):
IB/hfi1: switch to core handling of rx/tx byte/packet counters
qmi_wwan: switch to core handling of rx/tx byte/packet counters
qtnfmac: switch to
dor driver")
Signed-off-by: Heiner Kallweit
---
drivers/net/phy/realtek.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
index 2ba0d73bf..5844cf2d3 100644
--- a/drivers/net/phy/realtek.c
+++ b/drivers/net/phy/realtek.c
@@ -551,6 +551,8 @
Replace ip_tunnel_get_stats64() with the new identical core function
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
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
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
v3:
- add atomic_long_t member rx_frame_errors for making counter updates
atomic
Signed-off-by: Heiner Ka
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
Replace ip_tunnel_get_stats64() with the new identical core function
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
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
Replace ip_tunnel_get_stats64() with the new identical core function
dev_get_tstats64().
Acked-by: Harald Welte
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
Replace ip_tunnel_get_stats64() with the new identical core function
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
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 |
Replace ip_tunnel_get_stats64() with the new identical core function
dev_get_tstats64().
Reviewed-by: Jason A. Donenfeld
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
2:
- add patches for replacing ip_tunnel_get_stats64
Requested additional migrations will come in a separate series.
v3:
- add atomic_long_t member rx_frame_errors in patch 3 for making
counter updates atomic
Heiner Kallweit (10):
net: core: add dev_get_tstats64 as a ndo_get_stats64 implem
201 - 300 of 1978 matches
Mail list logo