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

Commit 7962a99d authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "udp: Avoid post-GRO UDP checksum recalculation"

parents 613321ec 41590f25
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -458,12 +458,19 @@ void udpv6_encap_enable(void);
static inline struct sk_buff *udp_rcv_segment(struct sock *sk,
					      struct sk_buff *skb, bool ipv4)
{
	netdev_features_t features = NETIF_F_SG;
	struct sk_buff *segs;

	/* Avoid csum recalculation by skb_segment unless userspace explicitly
	 * asks for the final checksum values
	 */
	if (!inet_get_convert_csum(sk))
		features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;

	/* the GSO CB lays after the UDP one, no need to save and restore any
	 * CB fragment
	 */
	segs = __skb_gso_segment(skb, NETIF_F_SG, false);
	segs = __skb_gso_segment(skb, features, false);
	if (unlikely(IS_ERR_OR_NULL(segs))) {
		int segs_nr = skb_shinfo(skb)->gso_segs;