linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] ifb: fix packets checksum
@ 2018-05-24 21:38 Jon Maxwell
  2018-05-25 20:43 ` David Miller
  2018-05-29  3:02 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Jon Maxwell @ 2018-05-24 21:38 UTC (permalink / raw)
  To: davem
  Cc: dsahern, mschiffer, zhangshengju, ktkhai, netdev, linux-kernel, jmaxwell

Fixup the checksum for CHECKSUM_COMPLETE when pulling skbs on RX path. 
Otherwise we get splats when tc mirred is used to redirect packets to ifb.

Before fix:

nic: hw csum failure

Signed-off-by: Jon Maxwell <jmaxwell37@gmail.com>
---
 drivers/net/ifb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
index 5f2897ec0edc..d345c61d476c 100644
--- a/drivers/net/ifb.c
+++ b/drivers/net/ifb.c
@@ -102,7 +102,7 @@ static void ifb_ri_tasklet(unsigned long _txp)
 		if (!skb->tc_from_ingress) {
 			dev_queue_xmit(skb);
 		} else {
-			skb_pull(skb, skb->mac_len);
+			skb_pull_rcsum(skb, skb->mac_len);
 			netif_receive_skb(skb);
 		}
 	}
-- 
2.13.6

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

* Re: [PATCH net-next] ifb: fix packets checksum
  2018-05-24 21:38 [PATCH net-next] ifb: fix packets checksum Jon Maxwell
@ 2018-05-25 20:43 ` David Miller
  2018-05-28 23:13   ` Jonathan Maxwell
  2018-05-29  3:02 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2018-05-25 20:43 UTC (permalink / raw)
  To: jmaxwell37
  Cc: dsahern, mschiffer, zhangshengju, ktkhai, netdev, linux-kernel, jmaxwell

From: Jon Maxwell <jmaxwell37@gmail.com>
Date: Fri, 25 May 2018 07:38:29 +1000

> Fixup the checksum for CHECKSUM_COMPLETE when pulling skbs on RX path. 
> Otherwise we get splats when tc mirred is used to redirect packets to ifb.
> 
> Before fix:
> 
> nic: hw csum failure
> 
> Signed-off-by: Jon Maxwell <jmaxwell37@gmail.com>

This definitely seems correct, but I am really surprised a bug like this has
lasted as long as it has.

So I'll let this sit for another day or two for review.

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

* Re: [PATCH net-next] ifb: fix packets checksum
  2018-05-25 20:43 ` David Miller
@ 2018-05-28 23:13   ` Jonathan Maxwell
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Maxwell @ 2018-05-28 23:13 UTC (permalink / raw)
  To: David Miller
  Cc: David Ahern, mschiffer, zhangshengju, ktkhai, netdev,
	linux-kernel, Jon Maxwell

On Sat, May 26, 2018 at 6:43 AM, David Miller <davem@davemloft.net> wrote:
> From: Jon Maxwell <jmaxwell37@gmail.com>
> Date: Fri, 25 May 2018 07:38:29 +1000
>
>> Fixup the checksum for CHECKSUM_COMPLETE when pulling skbs on RX path.
>> Otherwise we get splats when tc mirred is used to redirect packets to ifb.
>>
>> Before fix:
>>
>> nic: hw csum failure
>>
>> Signed-off-by: Jon Maxwell <jmaxwell37@gmail.com>
>
> This definitely seems correct, but I am really surprised a bug like this has
> lasted as long as it has.
>

Sorry for the late reply I have been away for a few days. The customer never
saw this on bnx2x. Then they switched to the mlx5 driver and it started
happening continuously when doing iperf3 tests and also for other TCP traffic.

mlx5 uses CHECKSUM_COMPLETE. I think that bnx2x uses CHECKSUM UNNECESSARY
which avoided the code path that triggers the csum failure message in
__skb_checksum_complete(). It only logs the message for CHECKSUM_COMPLETE
skbs. Probably few Linux users are using a combination of NIC drivers that
use CHECKSUM_COMPLETE, tc mirred and ifb, which is why this has never been
reported before.

This is very similar to commit 7be709af2b65.

> So I'll let this sit for another day or two for review.

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

* Re: [PATCH net-next] ifb: fix packets checksum
  2018-05-24 21:38 [PATCH net-next] ifb: fix packets checksum Jon Maxwell
  2018-05-25 20:43 ` David Miller
@ 2018-05-29  3:02 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2018-05-29  3:02 UTC (permalink / raw)
  To: jmaxwell37
  Cc: dsahern, mschiffer, zhangshengju, ktkhai, netdev, linux-kernel, jmaxwell

From: Jon Maxwell <jmaxwell37@gmail.com>
Date: Fri, 25 May 2018 07:38:29 +1000

> Fixup the checksum for CHECKSUM_COMPLETE when pulling skbs on RX path. 
> Otherwise we get splats when tc mirred is used to redirect packets to ifb.
> 
> Before fix:
> 
> nic: hw csum failure
> 
> Signed-off-by: Jon Maxwell <jmaxwell37@gmail.com>

Applied.

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

end of thread, other threads:[~2018-05-29  3:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-24 21:38 [PATCH net-next] ifb: fix packets checksum Jon Maxwell
2018-05-25 20:43 ` David Miller
2018-05-28 23:13   ` Jonathan Maxwell
2018-05-29  3:02 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).