Skip to content

Commit

Permalink
net: do not take an additional reference in skb_frag_set_page
Browse files Browse the repository at this point in the history
I audited all of the callers in the tree and only one of them (pktgen) expects
it to do so. Taking this reference is pretty obviously confusing and error
prone.

In particular I looked at the following commits which switched callers of
(__)skb_frag_set_page to the skb paged fragment api:

6a930b9 cxgb3: convert to SKB paged frag API.
5dc3e19 myri10ge: convert to SKB paged frag API.
0e0634d vmxnet3: convert to SKB paged frag API.
86ee813 virtionet: convert to SKB paged frag API.
4a22c4c sfc: convert to SKB paged frag API.
18324d6 cassini: convert to SKB paged frag API.
b061b39 benet: convert to SKB paged frag API.
b7b6a68 bnx2: convert to SKB paged frag API.
804cf14 net: xfrm: convert to SKB frag APIs
ea2ab69 net: convert core to skb paged frag APIs

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ian Campbell authored and David S. Miller committed Oct 19, 2011
1 parent e049f28 commit a0bec1c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -1786,7 +1786,6 @@ static inline void *skb_frag_address_safe(const skb_frag_t *frag)
static inline void __skb_frag_set_page(skb_frag_t *frag, struct page *page)
{
frag->page = page;
__skb_frag_ref(frag);
}

/**
Expand Down
1 change: 1 addition & 0 deletions net/core/pktgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -2602,6 +2602,7 @@ static void pktgen_finalize_skb(struct pktgen_dev *pkt_dev, struct sk_buff *skb,
if (!pkt_dev->page)
break;
}
get_page(pkt_dev->page);
skb_frag_set_page(skb, i, pkt_dev->page);
skb_shinfo(skb)->frags[i].page_offset = 0;
/*last fragment, fill rest of data*/
Expand Down

0 comments on commit a0bec1c

Please sign in to comment.