u16 pending_idx;
PEND_RING_IDX dc, dp;
netif_t *netif;
- int ret;
LIST_HEAD(list);
dc = dealloc_cons;
gop++;
}
- if (netbk_copy_skb_mode != NETBK_DELAYED_COPY_SKB ||
- list_empty(&pending_inuse_head))
- break;
+ } while (dp != dealloc_prod);
+
+ dealloc_cons = dc;
+
+ if (HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref,
+ tx_unmap_ops, gop - tx_unmap_ops))
+ BUG();
- /* Copy any entries that have been pending for too long. */
+ /* Copy any entries that have been pending for too long. */
+ if (netbk_copy_skb_mode == NETBK_DELAYED_COPY_SKB &&
+ !list_empty(&pending_inuse_head)) {
list_for_each_entry_safe(inuse, n, &pending_inuse_head, list) {
if (time_after(inuse->alloc_time + HZ / 2, jiffies))
break;
break;
}
- } while (dp != dealloc_prod);
-
- dealloc_cons = dc;
-
- ret = HYPERVISOR_grant_table_op(
- GNTTABOP_unmap_grant_ref, tx_unmap_ops, gop - tx_unmap_ops);
- BUG_ON(ret);
+ }
list_for_each_entry_safe(inuse, n, &list, list) {
pending_idx = inuse - pending_inuse;