ia64/xen-unstable

changeset 5845:6feba419cead

split deallocation from net_tx_action

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
author vh249@firebug.cl.cam.ac.uk
date Mon Jul 25 17:26:32 2005 +0000 (2005-07-25)
parents 7bc4ebdd5660
children 9a936ba5cde0
files linux-2.6-xen-sparse/drivers/xen/netback/netback.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Mon Jul 25 17:07:31 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Mon Jul 25 17:26:32 2005 +0000
     1.3 @@ -490,30 +490,20 @@ static void tx_credit_callback(unsigned 
     1.4      netif_schedule_work(netif);
     1.5  }
     1.6  
     1.7 -/* Called after netfront has transmitted */
     1.8 -static void net_tx_action(unsigned long unused)
     1.9 +inline static void net_tx_action_dealloc(void)
    1.10  {
    1.11 -    struct list_head *ent;
    1.12 -    struct sk_buff *skb;
    1.13 -    netif_t *netif;
    1.14 -    netif_tx_request_t txreq;
    1.15 -    u16 pending_idx;
    1.16 -    NETIF_RING_IDX i;
    1.17  #ifdef CONFIG_XEN_NETDEV_GRANT_TX
    1.18      gnttab_unmap_grant_ref_t unmap_ops[MAX_PENDING_REQS];
    1.19      gnttab_unmap_grant_ref_t *gop;
    1.20 -
    1.21 -    gnttab_map_grant_ref_t map_ops[MAX_PENDING_REQS];
    1.22 -    gnttab_map_grant_ref_t *mop;
    1.23  #else
    1.24      multicall_entry_t *mcl;
    1.25  #endif
    1.26 +    u16 pending_idx;
    1.27      PEND_RING_IDX dc, dp;
    1.28 -    unsigned int data_len;
    1.29 +    netif_t *netif;
    1.30  
    1.31 -
    1.32 -    if ( (dc = dealloc_cons) == (dp = dealloc_prod) )
    1.33 -        goto skip_dealloc;
    1.34 +    dc = dealloc_cons;
    1.35 +    dp = dealloc_prod;
    1.36  
    1.37  #ifdef CONFIG_XEN_NETDEV_GRANT_TX
    1.38      /*
    1.39 @@ -582,7 +572,28 @@ static void net_tx_action(unsigned long 
    1.40  #endif
    1.41      }
    1.42  
    1.43 - skip_dealloc:
    1.44 +}
    1.45 +
    1.46 +/* Called after netfront has transmitted */
    1.47 +static void net_tx_action(unsigned long unused)
    1.48 +{
    1.49 +    struct list_head *ent;
    1.50 +    struct sk_buff *skb;
    1.51 +    netif_t *netif;
    1.52 +    netif_tx_request_t txreq;
    1.53 +    u16 pending_idx;
    1.54 +    NETIF_RING_IDX i;
    1.55 +#ifdef CONFIG_XEN_NETDEV_GRANT_TX
    1.56 +    gnttab_map_grant_ref_t map_ops[MAX_PENDING_REQS];
    1.57 +    gnttab_map_grant_ref_t *mop;
    1.58 +#else
    1.59 +    multicall_entry_t *mcl;
    1.60 +#endif
    1.61 +    unsigned int data_len;
    1.62 +
    1.63 +    if ( dealloc_cons != dealloc_prod )
    1.64 +        net_tx_action_dealloc();
    1.65 +
    1.66  #ifdef CONFIG_XEN_NETDEV_GRANT_TX
    1.67      mop = map_ops;
    1.68  #else