Skip to content

Commit 2aaf09a

Browse files
hkallweitkuba-moo
authored andcommitted
r8169: work around short packet hw bug on RTL8125
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 to RTL8168evl). Having said that activate the same workaround as for RTL8168evl. Realtek suggested to activate the workaround for 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: 0439297 ("r8169: add support for RTL8125B") Reported-by: Maxim Plotnikov <wgh@torlan.ru> Tested-by: Maxim Plotnikov <wgh@torlan.ru> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://lore.kernel.org/r/8002c31a-60b9-58f1-f0dd-8fd07239917f@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent ac6f929 commit 2aaf09a

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4080,9 +4080,17 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
40804080
return -EIO;
40814081
}
40824082

4083-
static bool rtl_test_hw_pad_bug(struct rtl8169_private *tp, struct sk_buff *skb)
4083+
static bool rtl_test_hw_pad_bug(struct rtl8169_private *tp)
40844084
{
4085-
return skb->len < ETH_ZLEN && tp->mac_version == RTL_GIGA_MAC_VER_34;
4085+
switch (tp->mac_version) {
4086+
case RTL_GIGA_MAC_VER_34:
4087+
case RTL_GIGA_MAC_VER_60:
4088+
case RTL_GIGA_MAC_VER_61:
4089+
case RTL_GIGA_MAC_VER_63:
4090+
return true;
4091+
default:
4092+
return false;
4093+
}
40864094
}
40874095

40884096
static void rtl8169_tso_csum_v1(struct sk_buff *skb, u32 *opts)
@@ -4154,7 +4162,7 @@ static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp,
41544162

41554163
opts[1] |= transport_offset << TCPHO_SHIFT;
41564164
} else {
4157-
if (unlikely(rtl_test_hw_pad_bug(tp, skb)))
4165+
if (unlikely(skb->len < ETH_ZLEN && rtl_test_hw_pad_bug(tp)))
41584166
return !eth_skb_pad(skb);
41594167
}
41604168

0 commit comments

Comments
 (0)