Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 7525de2516fb ("ibmveth: Set CHECKSUM_PARTIAL if NULL TCP CSUM.")
Signed-off-by: David Wilder <dwilder@us.ibm.com>
Reviewed-by: Nick Child <nnac123@linux.ibm.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

David Wilder and committed by
David S. Miller
51e7a666 f9a1d321

+12 -13
+12 -13
drivers/net/ethernet/ibm/ibmveth.c
··· 1303 1303 * the user space for finding a flow. During this process, OVS computes 1304 1304 * checksum on the first packet when CHECKSUM_PARTIAL flag is set. 1305 1305 * 1306 - * So, re-compute TCP pseudo header checksum when configured for 1307 - * trunk mode. 1306 + * So, re-compute TCP pseudo header checksum. 1308 1307 */ 1308 + 1309 1309 if (iph_proto == IPPROTO_TCP) { 1310 1310 struct tcphdr *tcph = (struct tcphdr *)(skb->data + iphlen); 1311 + 1311 1312 if (tcph->check == 0x0000) { 1312 1313 /* 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); 1324 1323 /* Setup SKB fields for checksum offload */ 1325 1324 skb_partial_csum_set(skb, iphlen, 1326 1325 offsetof(struct tcphdr, check));