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

Commit b530256d authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller
Browse files

gro: Use gso_size to store MSS



In order to allow GRO packets without frag_list at all, we need to
store the MSS in the packet itself.  The obvious place is gso_size.
The only thing to watch out for is if the packet ends up not being
GRO then we need to clear gso_size before pushing the packet into
the stack.

Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cfc3a44c
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -2365,6 +2365,7 @@ static int napi_gro_complete(struct sk_buff *skb)
	}
	}


out:
out:
	skb_shinfo(skb)->gso_size = 0;
	__skb_push(skb, -skb_network_offset(skb));
	__skb_push(skb, -skb_network_offset(skb));
	return netif_receive_skb(skb);
	return netif_receive_skb(skb);
}
}
@@ -2446,6 +2447,7 @@ int napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
	}
	}


	NAPI_GRO_CB(skb)->count = 1;
	NAPI_GRO_CB(skb)->count = 1;
	skb_shinfo(skb)->gso_size = skb->len;
	skb->next = napi->gro_list;
	skb->next = napi->gro_list;
	napi->gro_list = skb;
	napi->gro_list = skb;


+1 −0
Original line number Original line Diff line number Diff line
@@ -2613,6 +2613,7 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb)


	*NAPI_GRO_CB(nskb) = *NAPI_GRO_CB(p);
	*NAPI_GRO_CB(nskb) = *NAPI_GRO_CB(p);
	skb_shinfo(nskb)->frag_list = p;
	skb_shinfo(nskb)->frag_list = p;
	skb_shinfo(nskb)->gso_size = skb_shinfo(p)->gso_size;
	skb_header_release(p);
	skb_header_release(p);
	nskb->prev = p;
	nskb->prev = p;


+1 −4
Original line number Original line Diff line number Diff line
@@ -2519,9 +2519,7 @@ struct sk_buff **tcp_gro_receive(struct sk_buff **head, struct sk_buff *skb)
	flush |= memcmp(th + 1, th2 + 1, thlen - sizeof(*th));
	flush |= memcmp(th + 1, th2 + 1, thlen - sizeof(*th));


	total = p->len;
	total = p->len;
	mss = total;
	mss = skb_shinfo(p)->gso_size;
	if (skb_shinfo(p)->frag_list)
		mss = skb_shinfo(p)->frag_list->len;


	flush |= skb->len > mss || skb->len <= 0;
	flush |= skb->len > mss || skb->len <= 0;
	flush |= ntohl(th2->seq) + total != ntohl(th->seq);
	flush |= ntohl(th2->seq) + total != ntohl(th->seq);
@@ -2557,7 +2555,6 @@ int tcp_gro_complete(struct sk_buff *skb)
	skb->csum_offset = offsetof(struct tcphdr, check);
	skb->csum_offset = offsetof(struct tcphdr, check);
	skb->ip_summed = CHECKSUM_PARTIAL;
	skb->ip_summed = CHECKSUM_PARTIAL;


	skb_shinfo(skb)->gso_size = skb_shinfo(skb)->frag_list->len;
	skb_shinfo(skb)->gso_segs = NAPI_GRO_CB(skb)->count;
	skb_shinfo(skb)->gso_segs = NAPI_GRO_CB(skb)->count;


	if (th->cwr)
	if (th->cwr)