r8169: fix accessing unset transport header
[ Upstream commitfaa4e04e5e]66e4c8d950("net: warn if transport header was not set") added a check that triggers a warning in r8169, see [0]. The commit referenced in the Fixes tag refers to the change from which the patch applies cleanly, there's nothing wrong with this commit. It seems the actual issue (not bug, because the warning is harmless here) was introduced withbdfa4ed681("r8169: use Giant Send"). [0] https://bugzilla.kernel.org/show_bug.cgi?id=216157 Fixes:8d520b4de3("r8169: work around RTL8125 UDP hw bug") Reported-by: Erhard F. <erhard_f@mailbox.org> Tested-by: Erhard F. <erhard_f@mailbox.org> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://lore.kernel.org/r/1b2c2b29-3dc0-f7b6-5694-97ec526d51a0@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
904f622ec7
commit
26938bd28c
1 changed files with 4 additions and 6 deletions
|
|
@ -4183,7 +4183,6 @@ static void rtl8169_tso_csum_v1(struct sk_buff *skb, u32 *opts)
|
|||
static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp,
|
||||
struct sk_buff *skb, u32 *opts)
|
||||
{
|
||||
u32 transport_offset = (u32)skb_transport_offset(skb);
|
||||
struct skb_shared_info *shinfo = skb_shinfo(skb);
|
||||
u32 mss = shinfo->gso_size;
|
||||
|
||||
|
|
@ -4200,7 +4199,7 @@ static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp,
|
|||
WARN_ON_ONCE(1);
|
||||
}
|
||||
|
||||
opts[0] |= transport_offset << GTTCPHO_SHIFT;
|
||||
opts[0] |= skb_transport_offset(skb) << GTTCPHO_SHIFT;
|
||||
opts[1] |= mss << TD1_MSS_SHIFT;
|
||||
} else if (skb->ip_summed == CHECKSUM_PARTIAL) {
|
||||
u8 ip_protocol;
|
||||
|
|
@ -4228,7 +4227,7 @@ static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp,
|
|||
else
|
||||
WARN_ON_ONCE(1);
|
||||
|
||||
opts[1] |= transport_offset << TCPHO_SHIFT;
|
||||
opts[1] |= skb_transport_offset(skb) << TCPHO_SHIFT;
|
||||
} else {
|
||||
unsigned int padto = rtl_quirk_packet_padto(tp, skb);
|
||||
|
||||
|
|
@ -4401,14 +4400,13 @@ static netdev_features_t rtl8169_features_check(struct sk_buff *skb,
|
|||
struct net_device *dev,
|
||||
netdev_features_t features)
|
||||
{
|
||||
int transport_offset = skb_transport_offset(skb);
|
||||
struct rtl8169_private *tp = netdev_priv(dev);
|
||||
|
||||
if (skb_is_gso(skb)) {
|
||||
if (tp->mac_version == RTL_GIGA_MAC_VER_34)
|
||||
features = rtl8168evl_fix_tso(skb, features);
|
||||
|
||||
if (transport_offset > GTTCPHO_MAX &&
|
||||
if (skb_transport_offset(skb) > GTTCPHO_MAX &&
|
||||
rtl_chip_supports_csum_v2(tp))
|
||||
features &= ~NETIF_F_ALL_TSO;
|
||||
} else if (skb->ip_summed == CHECKSUM_PARTIAL) {
|
||||
|
|
@ -4419,7 +4417,7 @@ static netdev_features_t rtl8169_features_check(struct sk_buff *skb,
|
|||
if (rtl_quirk_packet_padto(tp, skb))
|
||||
features &= ~NETIF_F_CSUM_MASK;
|
||||
|
||||
if (transport_offset > TCPHO_MAX &&
|
||||
if (skb_transport_offset(skb) > TCPHO_MAX &&
|
||||
rtl_chip_supports_csum_v2(tp))
|
||||
features &= ~NETIF_F_CSUM_MASK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue