Skip to content

Commit 35f0644

Browse files
committed
Revert "net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends"
This reverts commit 88078d9. Various people have been reporting seeing "eth0: hw csum failure" and callstacks dumped in the kernel log on 4.18, and since 4.14.71, on both SMSC9514 and LAN7800 adapters. This commit appears to be the reason, but potentially due to an issue further down the stack. Revert whilst investigating the trigger. raspberrypi#2713 raspberrypi#2659 raspberrypi#2712 Signed-off-by: Dave Stevenson <[email protected]>
1 parent f540527 commit 35f0644

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

include/linux/skbuff.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3134,7 +3134,6 @@ static inline void *skb_push_rcsum(struct sk_buff *skb, unsigned int len)
31343134
return skb->data;
31353135
}
31363136

3137-
int pskb_trim_rcsum_slow(struct sk_buff *skb, unsigned int len);
31383137
/**
31393138
* pskb_trim_rcsum - trim received skb and update checksum
31403139
* @skb: buffer to trim
@@ -3148,7 +3147,9 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len)
31483147
{
31493148
if (likely(len >= skb->len))
31503149
return 0;
3151-
return pskb_trim_rcsum_slow(skb, len);
3150+
if (skb->ip_summed == CHECKSUM_COMPLETE)
3151+
skb->ip_summed = CHECKSUM_NONE;
3152+
return __pskb_trim(skb, len);
31523153
}
31533154

31543155
static inline int __skb_trim_rcsum(struct sk_buff *skb, unsigned int len)

net/core/skbuff.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,20 +1838,6 @@ int ___pskb_trim(struct sk_buff *skb, unsigned int len)
18381838
}
18391839
EXPORT_SYMBOL(___pskb_trim);
18401840

1841-
/* Note : use pskb_trim_rcsum() instead of calling this directly
1842-
*/
1843-
int pskb_trim_rcsum_slow(struct sk_buff *skb, unsigned int len)
1844-
{
1845-
if (skb->ip_summed == CHECKSUM_COMPLETE) {
1846-
int delta = skb->len - len;
1847-
1848-
skb->csum = csum_sub(skb->csum,
1849-
skb_checksum(skb, len, delta, 0));
1850-
}
1851-
return __pskb_trim(skb, len);
1852-
}
1853-
EXPORT_SYMBOL(pskb_trim_rcsum_slow);
1854-
18551841
/**
18561842
* __pskb_pull_tail - advance tail of skb header
18571843
* @skb: buffer to reallocate

0 commit comments

Comments
 (0)