Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dead7cdb authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

tcp: remove sk_check_csum_caps()



Since TCP relies on GSO, we do not need this helper anymore.

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 74d4a8f8
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -1863,15 +1863,6 @@ static inline void sk_nocaps_add(struct sock *sk, netdev_features_t flags)
	sk->sk_route_caps &= ~flags;
}

static inline bool sk_check_csum_caps(struct sock *sk)
{
	return (sk->sk_route_caps & NETIF_F_HW_CSUM) ||
	       (sk->sk_family == PF_INET &&
		(sk->sk_route_caps & NETIF_F_IP_CSUM)) ||
	       (sk->sk_family == PF_INET6 &&
		(sk->sk_route_caps & NETIF_F_IPV6_CSUM));
}

static inline int skb_do_copy_data_nocache(struct sock *sk, struct sk_buff *skb,
					   struct iov_iter *from, char *to,
					   int copy, int offset)
+3 −8
Original line number Diff line number Diff line
@@ -1063,8 +1063,7 @@ EXPORT_SYMBOL_GPL(do_tcp_sendpages);
int tcp_sendpage_locked(struct sock *sk, struct page *page, int offset,
			size_t size, int flags)
{
	if (!(sk->sk_route_caps & NETIF_F_SG) ||
	    !sk_check_csum_caps(sk))
	if (!(sk->sk_route_caps & NETIF_F_SG))
		return sock_no_sendpage_locked(sk, page, offset, size, flags);

	tcp_rate_check_app_limited(sk);  /* is sending application-limited? */
@@ -1190,7 +1189,7 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size)
			goto out_err;
		}

		zc = sk_check_csum_caps(sk) && sk->sk_route_caps & NETIF_F_SG;
		zc = sk->sk_route_caps & NETIF_F_SG;
		if (!zc)
			uarg->zerocopy = 0;
	}
@@ -1287,10 +1286,6 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size)
				goto wait_for_memory;

			process_backlog = true;
			/*
			 * Check whether we can use HW checksum.
			 */
			if (sk_check_csum_caps(sk))
			skb->ip_summed = CHECKSUM_PARTIAL;

			skb_entail(sk, skb);