Skip to content

Commit

Permalink
xen-netback: rename functions
Browse files Browse the repository at this point in the history
As we move to 1:1 model and melt xen_netbk and xenvif together, it would
be better to use single prefix for all functions in xen-netback.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wei Liu authored and David S. Miller committed Aug 29, 2013
1 parent b3f980b commit 7376419
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 133 deletions.
24 changes: 12 additions & 12 deletions drivers/net/xen-netback/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,34 +190,34 @@ void xenvif_xenbus_fini(void);

int xenvif_schedulable(struct xenvif *vif);

int xen_netbk_rx_ring_full(struct xenvif *vif);
int xenvif_rx_ring_full(struct xenvif *vif);

int xen_netbk_must_stop_queue(struct xenvif *vif);
int xenvif_must_stop_queue(struct xenvif *vif);

/* (Un)Map communication rings. */
void xen_netbk_unmap_frontend_rings(struct xenvif *vif);
int xen_netbk_map_frontend_rings(struct xenvif *vif,
grant_ref_t tx_ring_ref,
grant_ref_t rx_ring_ref);
void xenvif_unmap_frontend_rings(struct xenvif *vif);
int xenvif_map_frontend_rings(struct xenvif *vif,
grant_ref_t tx_ring_ref,
grant_ref_t rx_ring_ref);

/* Check for SKBs from frontend and schedule backend processing */
void xen_netbk_check_rx_xenvif(struct xenvif *vif);
void xenvif_check_rx_xenvif(struct xenvif *vif);

/* Queue an SKB for transmission to the frontend */
void xen_netbk_queue_tx_skb(struct xenvif *vif, struct sk_buff *skb);
void xenvif_queue_tx_skb(struct xenvif *vif, struct sk_buff *skb);
/* Notify xenvif that ring now has space to send an skb to the frontend */
void xenvif_notify_tx_completion(struct xenvif *vif);

/* Prevent the device from generating any further traffic. */
void xenvif_carrier_off(struct xenvif *vif);

/* Returns number of ring slots required to send an skb to the frontend */
unsigned int xen_netbk_count_skb_slots(struct xenvif *vif, struct sk_buff *skb);
unsigned int xenvif_count_skb_slots(struct xenvif *vif, struct sk_buff *skb);

int xen_netbk_tx_action(struct xenvif *vif, int budget);
void xen_netbk_rx_action(struct xenvif *vif);
int xenvif_tx_action(struct xenvif *vif, int budget);
void xenvif_rx_action(struct xenvif *vif);

int xen_netbk_kthread(void *data);
int xenvif_kthread(void *data);

extern bool separate_tx_rx_irq;

Expand Down
20 changes: 10 additions & 10 deletions drivers/net/xen-netback/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ int xenvif_schedulable(struct xenvif *vif)

static int xenvif_rx_schedulable(struct xenvif *vif)
{
return xenvif_schedulable(vif) && !xen_netbk_rx_ring_full(vif);
return xenvif_schedulable(vif) && !xenvif_rx_ring_full(vif);
}

static irqreturn_t xenvif_tx_interrupt(int irq, void *dev_id)
Expand All @@ -66,7 +66,7 @@ static int xenvif_poll(struct napi_struct *napi, int budget)
struct xenvif *vif = container_of(napi, struct xenvif, napi);
int work_done;

work_done = xen_netbk_tx_action(vif, budget);
work_done = xenvif_tx_action(vif, budget);

if (work_done < budget) {
int more_to_do = 0;
Expand Down Expand Up @@ -133,12 +133,12 @@ static int xenvif_start_xmit(struct sk_buff *skb, struct net_device *dev)
goto drop;

/* Reserve ring slots for the worst-case number of fragments. */
vif->rx_req_cons_peek += xen_netbk_count_skb_slots(vif, skb);
vif->rx_req_cons_peek += xenvif_count_skb_slots(vif, skb);

if (vif->can_queue && xen_netbk_must_stop_queue(vif))
if (vif->can_queue && xenvif_must_stop_queue(vif))
netif_stop_queue(dev);

xen_netbk_queue_tx_skb(vif, skb);
xenvif_queue_tx_skb(vif, skb);

return NETDEV_TX_OK;

Expand Down Expand Up @@ -166,7 +166,7 @@ static void xenvif_up(struct xenvif *vif)
enable_irq(vif->tx_irq);
if (vif->tx_irq != vif->rx_irq)
enable_irq(vif->rx_irq);
xen_netbk_check_rx_xenvif(vif);
xenvif_check_rx_xenvif(vif);
}

static void xenvif_down(struct xenvif *vif)
Expand Down Expand Up @@ -368,7 +368,7 @@ int xenvif_connect(struct xenvif *vif, unsigned long tx_ring_ref,

__module_get(THIS_MODULE);

err = xen_netbk_map_frontend_rings(vif, tx_ring_ref, rx_ring_ref);
err = xenvif_map_frontend_rings(vif, tx_ring_ref, rx_ring_ref);
if (err < 0)
goto err;

Expand Down Expand Up @@ -405,7 +405,7 @@ int xenvif_connect(struct xenvif *vif, unsigned long tx_ring_ref,
}

init_waitqueue_head(&vif->wq);
vif->task = kthread_create(xen_netbk_kthread,
vif->task = kthread_create(xenvif_kthread,
(void *)vif, vif->dev->name);
if (IS_ERR(vif->task)) {
pr_warn("Could not allocate kthread for %s\n", vif->dev->name);
Expand Down Expand Up @@ -433,7 +433,7 @@ int xenvif_connect(struct xenvif *vif, unsigned long tx_ring_ref,
unbind_from_irqhandler(vif->tx_irq, vif);
vif->tx_irq = 0;
err_unmap:
xen_netbk_unmap_frontend_rings(vif);
xenvif_unmap_frontend_rings(vif);
err:
module_put(THIS_MODULE);
return err;
Expand Down Expand Up @@ -481,7 +481,7 @@ void xenvif_disconnect(struct xenvif *vif)

unregister_netdev(vif->dev);

xen_netbk_unmap_frontend_rings(vif);
xenvif_unmap_frontend_rings(vif);

free_netdev(vif->dev);

Expand Down
Loading

0 comments on commit 7376419

Please sign in to comment.