Skip to content

Commit

Permalink
Revert "net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends"
Browse files Browse the repository at this point in the history
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 <dave.stevenson@raspberrypi.org>
  • Loading branch information
6by9 committed Oct 15, 2018
1 parent f540527 commit 35f0644
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
5 changes: 3 additions & 2 deletions include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -3134,7 +3134,6 @@ static inline void *skb_push_rcsum(struct sk_buff *skb, unsigned int len)
return skb->data;
}

int pskb_trim_rcsum_slow(struct sk_buff *skb, unsigned int len);
/**
* pskb_trim_rcsum - trim received skb and update checksum
* @skb: buffer to trim
Expand All @@ -3148,7 +3147,9 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len)
{
if (likely(len >= skb->len))
return 0;
return pskb_trim_rcsum_slow(skb, len);
if (skb->ip_summed == CHECKSUM_COMPLETE)
skb->ip_summed = CHECKSUM_NONE;
return __pskb_trim(skb, len);
}

static inline int __skb_trim_rcsum(struct sk_buff *skb, unsigned int len)
Expand Down
14 changes: 0 additions & 14 deletions net/core/skbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -1838,20 +1838,6 @@ int ___pskb_trim(struct sk_buff *skb, unsigned int len)
}
EXPORT_SYMBOL(___pskb_trim);

/* Note : use pskb_trim_rcsum() instead of calling this directly
*/
int pskb_trim_rcsum_slow(struct sk_buff *skb, unsigned int len)
{
if (skb->ip_summed == CHECKSUM_COMPLETE) {
int delta = skb->len - len;

skb->csum = csum_sub(skb->csum,
skb_checksum(skb, len, delta, 0));
}
return __pskb_trim(skb, len);
}
EXPORT_SYMBOL(pskb_trim_rcsum_slow);

/**
* __pskb_pull_tail - advance tail of skb header
* @skb: buffer to reallocate
Expand Down

0 comments on commit 35f0644

Please sign in to comment.