Skip to content

Commit 51e7a66

Browse files
DaveWilderdavem330
authored andcommitted
ibmveth: Remove condition to recompute TCP header checksum.
In some OVS environments the TCP pseudo header checksum may need to be recomputed. Currently this is only done when the interface instance is configured for "Trunk Mode". We found the issue also occurs in some Kubernetes environments, these environments do not use "Trunk Mode", therefor the condition is removed. Performance tests with this change show only a fractional decrease in throughput (< 0.2%). Fixes: 7525de2 ("ibmveth: Set CHECKSUM_PARTIAL if NULL TCP CSUM.") Signed-off-by: David Wilder <[email protected]> Reviewed-by: Nick Child <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f9a1d32 commit 51e7a66

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

drivers/net/ethernet/ibm/ibmveth.c

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,24 +1303,23 @@ static void ibmveth_rx_csum_helper(struct sk_buff *skb,
13031303
* the user space for finding a flow. During this process, OVS computes
13041304
* checksum on the first packet when CHECKSUM_PARTIAL flag is set.
13051305
*
1306-
* So, re-compute TCP pseudo header checksum when configured for
1307-
* trunk mode.
1306+
* So, re-compute TCP pseudo header checksum.
13081307
*/
1308+
13091309
if (iph_proto == IPPROTO_TCP) {
13101310
struct tcphdr *tcph = (struct tcphdr *)(skb->data + iphlen);
1311+
13111312
if (tcph->check == 0x0000) {
13121313
/* Recompute TCP pseudo header checksum */
1313-
if (adapter->is_active_trunk) {
1314-
tcphdrlen = skb->len - iphlen;
1315-
if (skb_proto == ETH_P_IP)
1316-
tcph->check =
1317-
~csum_tcpudp_magic(iph->saddr,
1318-
iph->daddr, tcphdrlen, iph_proto, 0);
1319-
else if (skb_proto == ETH_P_IPV6)
1320-
tcph->check =
1321-
~csum_ipv6_magic(&iph6->saddr,
1322-
&iph6->daddr, tcphdrlen, iph_proto, 0);
1323-
}
1314+
tcphdrlen = skb->len - iphlen;
1315+
if (skb_proto == ETH_P_IP)
1316+
tcph->check =
1317+
~csum_tcpudp_magic(iph->saddr,
1318+
iph->daddr, tcphdrlen, iph_proto, 0);
1319+
else if (skb_proto == ETH_P_IPV6)
1320+
tcph->check =
1321+
~csum_ipv6_magic(&iph6->saddr,
1322+
&iph6->daddr, tcphdrlen, iph_proto, 0);
13241323
/* Setup SKB fields for checksum offload */
13251324
skb_partial_csum_set(skb, iphlen,
13261325
offsetof(struct tcphdr, check));

0 commit comments

Comments
 (0)