Commit 51e7a666 authored by David Wilder's avatar David Wilder Committed by David S. Miller
Browse files

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: 7525de25 ("ibmveth: Set CHECKSUM_PARTIAL if NULL TCP CSUM.")
Signed-off-by: default avatarDavid Wilder <dwilder@us.ibm.com>
Reviewed-by: default avatarNick Child <nnac123@linux.ibm.com>
Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f9a1d321
Loading
Loading
Loading
Loading
+12 −13
Original line number Diff line number Diff line
@@ -1303,14 +1303,14 @@ static void ibmveth_rx_csum_helper(struct sk_buff *skb,
	 * the user space for finding a flow. During this process, OVS computes
	 * checksum on the first packet when CHECKSUM_PARTIAL flag is set.
	 *
	 * So, re-compute TCP pseudo header checksum when configured for
	 * trunk mode.
	 * So, re-compute TCP pseudo header checksum.
	 */

	if (iph_proto == IPPROTO_TCP) {
		struct tcphdr *tcph = (struct tcphdr *)(skb->data + iphlen);

		if (tcph->check == 0x0000) {
			/* Recompute TCP pseudo header checksum  */
			if (adapter->is_active_trunk) {
			tcphdrlen = skb->len - iphlen;
			if (skb_proto == ETH_P_IP)
				tcph->check =
@@ -1320,7 +1320,6 @@ static void ibmveth_rx_csum_helper(struct sk_buff *skb,
				tcph->check =
				 ~csum_ipv6_magic(&iph6->saddr,
				&iph6->daddr, tcphdrlen, iph_proto, 0);
			}
			/* Setup SKB fields for checksum offload */
			skb_partial_csum_set(skb, iphlen,
					     offsetof(struct tcphdr, check));