Commit 9aaa156c authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller

gro: Store shinfo in local variable in skb_gro_receive

This patch stores the two shinfo pointers in local variables
because they're used over and over again in skb_gro_receive.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 66e92fcf
...@@ -2664,6 +2664,8 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb) ...@@ -2664,6 +2664,8 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb)
{ {
struct sk_buff *p = *head; struct sk_buff *p = *head;
struct sk_buff *nskb; struct sk_buff *nskb;
struct skb_shared_info *skbinfo = skb_shinfo(skb);
struct skb_shared_info *pinfo = skb_shinfo(p);
unsigned int headroom; unsigned int headroom;
unsigned int len = skb_gro_len(skb); unsigned int len = skb_gro_len(skb);
unsigned int offset = skb_gro_offset(skb); unsigned int offset = skb_gro_offset(skb);
...@@ -2672,24 +2674,24 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb) ...@@ -2672,24 +2674,24 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb)
if (p->len + len >= 65536) if (p->len + len >= 65536)
return -E2BIG; return -E2BIG;
if (skb_shinfo(p)->frag_list) if (pinfo->frag_list)
goto merge; goto merge;
else if (headlen <= offset) { else if (headlen <= offset) {
skb_frag_t *frag; skb_frag_t *frag;
skb_frag_t *frag2; skb_frag_t *frag2;
int i = skb_shinfo(skb)->nr_frags; int i = skbinfo->nr_frags;
int nr_frags = skb_shinfo(p)->nr_frags + i; int nr_frags = pinfo->nr_frags + i;
offset -= headlen; offset -= headlen;
if (nr_frags > MAX_SKB_FRAGS) if (nr_frags > MAX_SKB_FRAGS)
return -E2BIG; return -E2BIG;
skb_shinfo(p)->nr_frags = nr_frags; pinfo->nr_frags = nr_frags;
skb_shinfo(skb)->nr_frags = 0; skbinfo->nr_frags = 0;
frag = skb_shinfo(p)->frags + nr_frags; frag = pinfo->frags + nr_frags;
frag2 = skb_shinfo(skb)->frags + i; frag2 = skbinfo->frags + i;
do { do {
*--frag = *--frag2; *--frag = *--frag2;
} while (--i); } while (--i);
...@@ -2726,7 +2728,7 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb) ...@@ -2726,7 +2728,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_shinfo(nskb)->gso_size = pinfo->gso_size;
skb_header_release(p); skb_header_release(p);
nskb->prev = p; nskb->prev = p;
...@@ -2742,8 +2744,8 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb) ...@@ -2742,8 +2744,8 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb)
merge: merge:
if (offset > headlen) { if (offset > headlen) {
skb_shinfo(skb)->frags[0].page_offset += offset - headlen; skbinfo->frags[0].page_offset += offset - headlen;
skb_shinfo(skb)->frags[0].size -= offset - headlen; skbinfo->frags[0].size -= offset - headlen;
offset = headlen; offset = headlen;
} }
......
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