net: do not take an additional reference in skb_frag_set_page
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:6a930b9f16cxgb3: convert to SKB paged frag API.5dc3e196eamyri10ge: convert to SKB paged frag API.0e0634d20dvmxnet3: convert to SKB paged frag API.86ee8130a4virtionet: convert to SKB paged frag API.4a22c4c919sfc: convert to SKB paged frag API.18324d690dcassini: convert to SKB paged frag API.b061b39e3abenet: convert to SKB paged frag API.b7b6a688d2bnx2: convert to SKB paged frag API.804cf14ea5net: xfrm: convert to SKB frag APIsea2ab69379net: 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>
This commit is contained in:
committed by
David S. Miller
parent
e049f28883
commit
a0bec1cd8f
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -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*/
|
||||
|
||||
Reference in New Issue
Block a user