* [PATCH net] bnx2x: fix tunneling CSUM calculation
@ 2013-07-11 12:48 Dmitry Kravkov
2013-07-11 13:54 ` Eric Dumazet
0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Kravkov @ 2013-07-11 12:48 UTC (permalink / raw)
To: davem, netdev
Cc: eric.dumazet, alexander.h.duyck, pshelar, xiyou.wangcong, eilong,
Dmitry Kravkov
Since commit c957d09ffda417f6c8e3d1f10e2b05228607d6d7
"bnx2x: Remove sparse and coccinelle warnings"
driver provided wrong partial csum for HW in tunneing
scenarios.
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Alexander Duyck <alexander.h.duyck@intel.com>
CC: Pravin Shelar <pshelar@nicira.com>
CC: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 3353efe..ee350bd 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -3543,9 +3543,9 @@ static void bnx2x_update_pbds_gso_enc(struct sk_buff *skb,
/* outer IP header info */
if (xmit_type & XMIT_CSUM_V4) {
struct iphdr *iph = ip_hdr(skb);
- u16 csum = (__force u16)(~iph->check) -
- (__force u16)iph->tot_len -
- (__force u16)iph->frag_off;
+ u32 csum = (__force u32)(~iph->check) -
+ (__force u32)iph->tot_len -
+ (__force u32)iph->frag_off;
pbd2->fw_ip_csum_wo_len_flags_frag =
bswab16(csum_fold((__force __wsum)csum));
--
1.8.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] bnx2x: fix tunneling CSUM calculation
2013-07-11 12:48 [PATCH net] bnx2x: fix tunneling CSUM calculation Dmitry Kravkov
@ 2013-07-11 13:54 ` Eric Dumazet
2013-07-11 18:48 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2013-07-11 13:54 UTC (permalink / raw)
To: Dmitry Kravkov
Cc: davem, netdev, alexander.h.duyck, pshelar, xiyou.wangcong, eilong
On Thu, 2013-07-11 at 15:48 +0300, Dmitry Kravkov wrote:
> Since commit c957d09ffda417f6c8e3d1f10e2b05228607d6d7
> "bnx2x: Remove sparse and coccinelle warnings"
> driver provided wrong partial csum for HW in tunneing
> scenarios.
>
> Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
> CC: Alexander Duyck <alexander.h.duyck@intel.com>
> CC: Pravin Shelar <pshelar@nicira.com>
> CC: Cong Wang <xiyou.wangcong@gmail.com>
> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
>
> ---
> drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> index 3353efe..ee350bd 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> @@ -3543,9 +3543,9 @@ static void bnx2x_update_pbds_gso_enc(struct sk_buff *skb,
> /* outer IP header info */
> if (xmit_type & XMIT_CSUM_V4) {
> struct iphdr *iph = ip_hdr(skb);
> - u16 csum = (__force u16)(~iph->check) -
> - (__force u16)iph->tot_len -
> - (__force u16)iph->frag_off;
> + u32 csum = (__force u32)(~iph->check) -
> + (__force u32)iph->tot_len -
> + (__force u32)iph->frag_off;
>
> pbd2->fw_ip_csum_wo_len_flags_frag =
> bswab16(csum_fold((__force __wsum)csum));
Tested-by: Eric Dumazet <edumazet@google.com>
Thanks guys !
lpq83:~# ethtool -K gre1 tso on
lpq83:~# ./netperf -H 7.7.8.84
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 7.7.8.84 () port 0 AF_INET
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec
87380 16384 16384 10.00 5723.17
lpq83:~# ethtool -K gre1 tso off
lpq83:~# ./netperf -H 7.7.8.84
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 7.7.8.84 () port 0 AF_INET
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec
87380 16384 16384 10.00 3813.60
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] bnx2x: fix tunneling CSUM calculation
2013-07-11 13:54 ` Eric Dumazet
@ 2013-07-11 18:48 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2013-07-11 18:48 UTC (permalink / raw)
To: eric.dumazet
Cc: dmitry, netdev, alexander.h.duyck, pshelar, xiyou.wangcong,
eilong
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 11 Jul 2013 06:54:12 -0700
> On Thu, 2013-07-11 at 15:48 +0300, Dmitry Kravkov wrote:
>> Since commit c957d09ffda417f6c8e3d1f10e2b05228607d6d7
>> "bnx2x: Remove sparse and coccinelle warnings"
>> driver provided wrong partial csum for HW in tunneing
>> scenarios.
>>
>> Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
>> CC: Alexander Duyck <alexander.h.duyck@intel.com>
>> CC: Pravin Shelar <pshelar@nicira.com>
>> CC: Cong Wang <xiyou.wangcong@gmail.com>
>> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
...
> Tested-by: Eric Dumazet <edumazet@google.com>
Applied, thanks everyone.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-07-11 18:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-11 12:48 [PATCH net] bnx2x: fix tunneling CSUM calculation Dmitry Kravkov
2013-07-11 13:54 ` Eric Dumazet
2013-07-11 18:48 ` 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).