All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] r8169: disable hw csum for short packets and chip versions with hw padding bug
@ 2020-11-05 13:58 Heiner Kallweit
  2020-11-05 14:20 ` David Laight
  0 siblings, 1 reply; 3+ messages in thread
From: Heiner Kallweit @ 2020-11-05 13:58 UTC (permalink / raw)
  To: Jakub Kicinski, David Miller, Realtek linux nic maintainers; +Cc: netdev

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 hw checksumming for short packets on affected new chip
versions. Change the code in a way that in case of further affected
chip versions we have to add them in one place only.

Fixes: 0439297be951 ("r8169: add support for RTL8125B")
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 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/drivers/net/ethernet/realtek/r8169_main.c
index c5d5c1cfc..56f84b597 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -4315,11 +4315,13 @@ static netdev_features_t rtl8169_features_check(struct sk_buff *skb,
 			features &= ~NETIF_F_ALL_TSO;
 	} else if (skb->ip_summed == CHECKSUM_PARTIAL) {
 		if (skb->len < ETH_ZLEN) {
+			if (rtl_test_hw_pad_bug(tp))
+				features &= ~NETIF_F_CSUM_MASK;
+
 			switch (tp->mac_version) {
 			case RTL_GIGA_MAC_VER_11:
 			case RTL_GIGA_MAC_VER_12:
 			case RTL_GIGA_MAC_VER_17:
-			case RTL_GIGA_MAC_VER_34:
 				features &= ~NETIF_F_CSUM_MASK;
 				break;
 			default:
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH net] r8169: disable hw csum for short packets and chip versions with hw padding bug
  2020-11-05 13:58 [PATCH net] r8169: disable hw csum for short packets and chip versions with hw padding bug Heiner Kallweit
@ 2020-11-05 14:20 ` David Laight
  2020-11-05 14:35   ` Heiner Kallweit
  0 siblings, 1 reply; 3+ messages in thread
From: David Laight @ 2020-11-05 14:20 UTC (permalink / raw)
  To: 'Heiner Kallweit',
	Jakub Kicinski, David Miller, Realtek linux nic maintainers
  Cc: netdev

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 hw checksumming for short packets on affected new chip
> versions. Change the code in a way that in case of further affected
> chip versions we have to add them in one place only.

Why not just disable hw checksumming for short packets on
all devices (that use this driver).

It can't make much difference to the performance.
The lack of conditionals may even make it faster.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] r8169: disable hw csum for short packets and chip versions with hw padding bug
  2020-11-05 14:20 ` David Laight
@ 2020-11-05 14:35   ` Heiner Kallweit
  0 siblings, 0 replies; 3+ messages in thread
From: Heiner Kallweit @ 2020-11-05 14:35 UTC (permalink / raw)
  To: David Laight, Jakub Kicinski, David Miller,
	Realtek linux nic maintainers
  Cc: netdev

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 hw checksumming for short packets on affected new chip
>> versions. Change the code in a way that in case of further affected
>> chip versions we have to add them in one place only.
> 
> Why not just disable hw checksumming for short packets on
> all devices (that use this driver).
> 
Thanks for the hint. Briefly thought about that too but then decided
against it as I don't have performance figures. But if everybody is
fine with it, then I'd be happy to simplify short packet handling
in the described way (in a v2).

> It can't make much difference to the performance.
> The lack of conditionals may even make it faster.
> 
> 	David
> 
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
> 

Heiner

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-05 14:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-05 13:58 [PATCH net] r8169: disable hw csum for short packets and chip versions with hw padding bug Heiner Kallweit
2020-11-05 14:20 ` David Laight
2020-11-05 14:35   ` Heiner Kallweit

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.