static void xenvif_fill_frags(struct xenvif *vif, struct sk_buff *skb)
{
	struct skb_shared_info *shinfo = skb_shinfo(skb);
	int nr_frags = shinfo->nr_frags;
	int i;
	u16 prev_pending_idx = INVALID_PENDING_IDX;

	if (skb_shinfo(skb)->destructor_arg)
		prev_pending_idx = XENVIF_TX_CB(skb)->pending_idx;

	for (i = 0; i < nr_frags; i++) {
		skb_frag_t *frag = shinfo->frags + i;
		struct xen_netif_tx_request *txp;
		struct page *page;
		u16 pending_idx;

		pending_idx = frag_get_pending_idx(frag);

		/* If this is not the first frag, chain it to the previous*/
		if (unlikely(prev_pending_idx == INVALID_PENDING_IDX))
			skb_shinfo(skb)->destructor_arg =
				&callback_param(vif, pending_idx);
		else if (likely(pending_idx != prev_pending_idx))
			callback_param(vif, prev_pending_idx).ctx =
				&callback_param(vif, pending_idx);

		callback_param(vif, pending_idx).ctx = NULL;
		prev_pending_idx = pending_idx;

		txp = &vif->pending_tx_info[pending_idx].req;
		page = virt_to_page(idx_to_kaddr(vif, pending_idx));
		__skb_fill_page_desc(skb, i, page, txp->offset, txp->size);
		skb->len += txp->size;
		skb->data_len += txp->size;
		skb->truesize += txp->size;

		/* Take an extra reference to offset network stack's put_page */
		get_page(vif->mmap_pages[pending_idx]);
	}
	/* FIXME: __skb_fill_page_desc set this to true because page->pfmemalloc
	 * overlaps with "index", and "mapping" is not set. I think mapping
	 * should be set. If delivered to local stack, it would drop this
	 * skb in sk_filter unless the socket has the right to use it.
	 */
	skb->pfmemalloc	= false;
}
static void xenvif_fill_frags(struct xenvif *vif, struct sk_buff *skb)
{
	struct skb_shared_info *shinfo = skb_shinfo(skb);
	int nr_frags = shinfo->nr_frags;
	int i;
	u16 prev_pending_idx = INVALID_PENDING_IDX;

	if (skb_shinfo(skb)->destructor_arg)
		prev_pending_idx = XENVIF_TX_CB(skb)->pending_idx;

	for (i = 0; i < nr_frags; i++) {
		skb_frag_t *frag = shinfo->frags + i;
		struct xen_netif_tx_request *txp;
		struct page *page;
		u16 pending_idx;

		pending_idx = frag_get_pending_idx(frag);

		 
		if (unlikely(prev_pending_idx == INVALID_PENDING_IDX))
			skb_shinfo(skb)->destructor_arg =
				&callback_param(vif, pending_idx);
		else if (likely(pending_idx != prev_pending_idx))
			callback_param(vif, prev_pending_idx).ctx =
				&callback_param(vif, pending_idx);

		callback_param(vif, pending_idx).ctx = NULL;
		prev_pending_idx = pending_idx;

		txp = &vif->pending_tx_info[pending_idx].req;
		page = virt_to_page(idx_to_kaddr(vif, pending_idx));
		__skb_fill_page_desc(skb, i, page, txp->offset, txp->size);
		skb->len += txp->size;
		skb->data_len += txp->size;
		skb->truesize += txp->size;

		 
		get_page(vif->mmap_pages[pending_idx]);
	}
	 
	skb->pfmemalloc	= false;
}