mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
Revert "GRO: Add support for TCP with fixed IPv4 ID field, limit tunnel IP ID values"
This reverts commit 1530545ed64b42e87acb43c0c16401bd1ebae6bf. This in preparation of below followup change to ignore IP ID check for GRO coalesce. "ipv4/GRO: Make GRO conform to RFC 6864" This is required to support some streams with random ip ID values. Change-Id: I94ede69e2cd14365238eeeaed0f507519350d64b CRs-Fixed: 2221952 Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org> Signed-off-by: Manjunathappa Prakash <prakashpm@codeaurora.org>
This commit is contained in:
parent
c78e874c98
commit
d65f20457d
@ -2137,13 +2137,10 @@ struct napi_gro_cb {
|
||||
/* Used in GRE, set in fou/gue_gro_receive */
|
||||
u8 is_fou:1;
|
||||
|
||||
/* Used to determine if flush_id can be ignored */
|
||||
u8 is_atomic:1;
|
||||
|
||||
/* Number of gro_receive callbacks this packet already went through */
|
||||
u8 recursion_counter:4;
|
||||
|
||||
/* 1 bit hole */
|
||||
/* 2 bit hole */
|
||||
|
||||
/* used to support CHECKSUM_COMPLETE for tunneling protocols */
|
||||
__wsum csum;
|
||||
|
@ -4808,7 +4808,6 @@ static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff
|
||||
NAPI_GRO_CB(skb)->encap_mark = 0;
|
||||
NAPI_GRO_CB(skb)->recursion_counter = 0;
|
||||
NAPI_GRO_CB(skb)->is_fou = 0;
|
||||
NAPI_GRO_CB(skb)->is_atomic = 1;
|
||||
NAPI_GRO_CB(skb)->gro_remcsum_start = 0;
|
||||
|
||||
/* Setup for GRO checksum validation */
|
||||
|
@ -1378,7 +1378,6 @@ struct sk_buff **inet_gro_receive(struct sk_buff **head, struct sk_buff *skb)
|
||||
|
||||
for (p = *head; p; p = p->next) {
|
||||
struct iphdr *iph2;
|
||||
u16 flush_id;
|
||||
|
||||
if (!NAPI_GRO_CB(p)->same_flow)
|
||||
continue;
|
||||
@ -1402,36 +1401,16 @@ struct sk_buff **inet_gro_receive(struct sk_buff **head, struct sk_buff *skb)
|
||||
(iph->tos ^ iph2->tos) |
|
||||
((iph->frag_off ^ iph2->frag_off) & htons(IP_DF));
|
||||
|
||||
/* Save the IP ID check to be included later when we get to
|
||||
* the transport layer so only the inner most IP ID is checked.
|
||||
* This is because some GSO/TSO implementations do not
|
||||
* correctly increment the IP ID for the outer hdrs.
|
||||
*/
|
||||
NAPI_GRO_CB(p)->flush_id =
|
||||
((u16)(ntohs(iph2->id) + NAPI_GRO_CB(p)->count) ^ id);
|
||||
NAPI_GRO_CB(p)->flush |= flush;
|
||||
|
||||
/* We need to store of the IP ID check to be included later
|
||||
* when we can verify that this packet does in fact belong
|
||||
* to a given flow.
|
||||
*/
|
||||
flush_id = (u16)(id - ntohs(iph2->id));
|
||||
|
||||
/* This bit of code makes it much easier for us to identify
|
||||
* the cases where we are doing atomic vs non-atomic IP ID
|
||||
* checks. Specifically an atomic check can return IP ID
|
||||
* values 0 - 0xFFFF, while a non-atomic check can only
|
||||
* return 0 or 0xFFFF.
|
||||
*/
|
||||
if (!NAPI_GRO_CB(p)->is_atomic ||
|
||||
!(iph->frag_off & htons(IP_DF))) {
|
||||
flush_id ^= NAPI_GRO_CB(p)->count;
|
||||
flush_id = flush_id ? 0xFFFF : 0;
|
||||
}
|
||||
|
||||
/* If the previous IP ID value was based on an atomic
|
||||
* datagram we can overwrite the value and ignore it.
|
||||
*/
|
||||
if (NAPI_GRO_CB(skb)->is_atomic)
|
||||
NAPI_GRO_CB(p)->flush_id = flush_id;
|
||||
else
|
||||
NAPI_GRO_CB(p)->flush_id |= flush_id;
|
||||
}
|
||||
|
||||
NAPI_GRO_CB(skb)->is_atomic = !!(iph->frag_off & htons(IP_DF));
|
||||
NAPI_GRO_CB(skb)->flush |= flush;
|
||||
skb_set_network_header(skb, off);
|
||||
/* The above will be needed by the transport layer if there is one
|
||||
|
@ -238,7 +238,7 @@ struct sk_buff **tcp_gro_receive(struct sk_buff **head, struct sk_buff *skb)
|
||||
|
||||
found:
|
||||
/* Include the IP ID check below from the inner most IP hdr */
|
||||
flush = NAPI_GRO_CB(p)->flush;
|
||||
flush = NAPI_GRO_CB(p)->flush | NAPI_GRO_CB(p)->flush_id;
|
||||
flush |= (__force int)(flags & TCP_FLAG_CWR);
|
||||
flush |= (__force int)((flags ^ tcp_flag_word(th2)) &
|
||||
~(TCP_FLAG_CWR | TCP_FLAG_FIN | TCP_FLAG_PSH));
|
||||
@ -247,17 +247,6 @@ found:
|
||||
flush |= *(u32 *)((u8 *)th + i) ^
|
||||
*(u32 *)((u8 *)th2 + i);
|
||||
|
||||
/* When we receive our second frame we can made a decision on if we
|
||||
* continue this flow as an atomic flow with a fixed ID or if we use
|
||||
* an incrementing ID.
|
||||
*/
|
||||
if (NAPI_GRO_CB(p)->flush_id != 1 ||
|
||||
NAPI_GRO_CB(p)->count != 1 ||
|
||||
!NAPI_GRO_CB(p)->is_atomic)
|
||||
flush |= NAPI_GRO_CB(p)->flush_id;
|
||||
else
|
||||
NAPI_GRO_CB(p)->is_atomic = false;
|
||||
|
||||
mss = skb_shinfo(p)->gso_size;
|
||||
|
||||
flush |= (len - 1) >= mss;
|
||||
@ -326,9 +315,6 @@ static int tcp4_gro_complete(struct sk_buff *skb, int thoff)
|
||||
iph->daddr, 0);
|
||||
skb_shinfo(skb)->gso_type |= SKB_GSO_TCPV4;
|
||||
|
||||
if (NAPI_GRO_CB(skb)->is_atomic)
|
||||
skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_FIXEDID;
|
||||
|
||||
return tcp_gro_complete(skb);
|
||||
}
|
||||
|
||||
|
@ -240,14 +240,10 @@ static struct sk_buff **ipv6_gro_receive(struct sk_buff **head,
|
||||
NAPI_GRO_CB(p)->flush |= !!(first_word & htonl(0x0FF00000));
|
||||
NAPI_GRO_CB(p)->flush |= flush;
|
||||
|
||||
/* If the previous IP ID value was based on an atomic
|
||||
* datagram we can overwrite the value and ignore it.
|
||||
*/
|
||||
if (NAPI_GRO_CB(skb)->is_atomic)
|
||||
NAPI_GRO_CB(p)->flush_id = 0;
|
||||
/* Clear flush_id, there's really no concept of ID in IPv6. */
|
||||
NAPI_GRO_CB(p)->flush_id = 0;
|
||||
}
|
||||
|
||||
NAPI_GRO_CB(skb)->is_atomic = true;
|
||||
NAPI_GRO_CB(skb)->flush |= flush;
|
||||
|
||||
skb_gro_postpull_rcsum(skb, iph, nlen);
|
||||
|
Loading…
x
Reference in New Issue
Block a user