Commit 14fe22e3 authored by Florian Westphal's avatar Florian Westphal Committed by David S. Miller

Revert "ipv4: use skb coalescing in defragmentation"

This reverts commit 3cc49492.

There is nothing wrong with coalescing during defragmentation, it
reduces truesize overhead and simplifies things for the receiving
socket (no fraglist walk needed).

However, it also destroys geometry of the original fragments.
While that doesn't cause any breakage (we make sure to not exceed largest
original size) ip_do_fragment contains a 'fastpath' that takes advantage
of a present frag list and results in fragments that (in most cases)
match what was received.

In case its needed the coalescing could be done later, when we're sure
the skb is not forwarded.  But discussion during NFWS resulted in
'lets just remove this for now'.

Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Acked-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9d7b372f
...@@ -522,7 +522,6 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev, ...@@ -522,7 +522,6 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev,
int len; int len;
int ihlen; int ihlen;
int err; int err;
int sum_truesize;
u8 ecn; u8 ecn;
ipq_kill(qp); ipq_kill(qp);
...@@ -590,32 +589,19 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev, ...@@ -590,32 +589,19 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev,
add_frag_mem_limit(&qp->q, clone->truesize); add_frag_mem_limit(&qp->q, clone->truesize);
} }
skb_shinfo(head)->frag_list = head->next;
skb_push(head, head->data - skb_network_header(head)); skb_push(head, head->data - skb_network_header(head));
sum_truesize = head->truesize; for (fp=head->next; fp; fp = fp->next) {
for (fp = head->next; fp;) { head->data_len += fp->len;
bool headstolen; head->len += fp->len;
int delta;
struct sk_buff *next = fp->next;
sum_truesize += fp->truesize;
if (head->ip_summed != fp->ip_summed) if (head->ip_summed != fp->ip_summed)
head->ip_summed = CHECKSUM_NONE; head->ip_summed = CHECKSUM_NONE;
else if (head->ip_summed == CHECKSUM_COMPLETE) else if (head->ip_summed == CHECKSUM_COMPLETE)
head->csum = csum_add(head->csum, fp->csum); head->csum = csum_add(head->csum, fp->csum);
if (skb_try_coalesce(head, fp, &headstolen, &delta)) {
kfree_skb_partial(fp, headstolen);
} else {
if (!skb_shinfo(head)->frag_list)
skb_shinfo(head)->frag_list = fp;
head->data_len += fp->len;
head->len += fp->len;
head->truesize += fp->truesize; head->truesize += fp->truesize;
} }
fp = next; sub_frag_mem_limit(&qp->q, head->truesize);
}
sub_frag_mem_limit(&qp->q, sum_truesize);
head->next = NULL; head->next = NULL;
head->dev = dev; head->dev = dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment