From: Keir Fraser Date: Fri, 17 Dec 2010 10:08:41 +0000 (+0000) Subject: xen/netback: Re-factor net_tx_action_dealloc() slightly X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=456eb7a570b349e76f338041eba94463bd702a61;p=legacy%2Flinux-2.6.18-xen.git xen/netback: Re-factor net_tx_action_dealloc() slightly There is no need for processing of the pending_inuse list to be within the dealloc_prod/cons loop. Signed-off-by: Paul Durrant Signed-off-by: Jan Beulich --- diff --git a/drivers/xen/netback/netback.c b/drivers/xen/netback/netback.c index 34d8d1df..154c7fbe 100644 --- a/drivers/xen/netback/netback.c +++ b/drivers/xen/netback/netback.c @@ -915,7 +915,6 @@ inline static void net_tx_action_dealloc(void) u16 pending_idx; PEND_RING_IDX dc, dp; netif_t *netif; - int ret; LIST_HEAD(list); dc = dealloc_cons; @@ -950,11 +949,17 @@ inline static void net_tx_action_dealloc(void) 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; @@ -976,13 +981,7 @@ inline static void net_tx_action_dealloc(void) 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;