aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/xen-netback
diff options
context:
space:
mode:
authorZoltan Kiss <zoltan.kiss@citrix.com>2014-04-02 13:04:57 -0400
committerDavid S. Miller <davem@davemloft.net>2014-04-03 14:22:38 -0400
commit9074ce249321861e535cdf8de9af0930a174dda9 (patch)
treeb065fffe9f55c431842f8b31bc9b555489122f24 /drivers/net/xen-netback
parentacdd32be6d3ec5f872d9fd930cac54d18d6c74ac (diff)
xen-netback: Rename map ops
Rename identifiers to state explicitly that they refer to map ops. Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com> Reviewed-by: Paul Durrant <paul.durrant@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/xen-netback')
-rw-r--r--drivers/net/xen-netback/netback.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index 3f021e054ba1..4bb78862afc8 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -820,13 +820,13 @@ struct xenvif_tx_cb {
820 820
821#define XENVIF_TX_CB(skb) ((struct xenvif_tx_cb *)(skb)->cb) 821#define XENVIF_TX_CB(skb) ((struct xenvif_tx_cb *)(skb)->cb)
822 822
823static inline void xenvif_tx_create_gop(struct xenvif *vif, 823static inline void xenvif_tx_create_map_op(struct xenvif *vif,
824 u16 pending_idx, 824 u16 pending_idx,
825 struct xen_netif_tx_request *txp, 825 struct xen_netif_tx_request *txp,
826 struct gnttab_map_grant_ref *gop) 826 struct gnttab_map_grant_ref *mop)
827{ 827{
828 vif->pages_to_map[gop-vif->tx_map_ops] = vif->mmap_pages[pending_idx]; 828 vif->pages_to_map[mop-vif->tx_map_ops] = vif->mmap_pages[pending_idx];
829 gnttab_set_map_op(gop, idx_to_kaddr(vif, pending_idx), 829 gnttab_set_map_op(mop, idx_to_kaddr(vif, pending_idx),
830 GNTMAP_host_map | GNTMAP_readonly, 830 GNTMAP_host_map | GNTMAP_readonly,
831 txp->gref, vif->domid); 831 txp->gref, vif->domid);
832 832
@@ -880,7 +880,7 @@ static struct gnttab_map_grant_ref *xenvif_get_requests(struct xenvif *vif,
880 shinfo->nr_frags++, txp++, gop++) { 880 shinfo->nr_frags++, txp++, gop++) {
881 index = pending_index(vif->pending_cons++); 881 index = pending_index(vif->pending_cons++);
882 pending_idx = vif->pending_ring[index]; 882 pending_idx = vif->pending_ring[index];
883 xenvif_tx_create_gop(vif, pending_idx, txp, gop); 883 xenvif_tx_create_map_op(vif, pending_idx, txp, gop);
884 frag_set_pending_idx(&frags[shinfo->nr_frags], pending_idx); 884 frag_set_pending_idx(&frags[shinfo->nr_frags], pending_idx);
885 } 885 }
886 886
@@ -900,7 +900,7 @@ static struct gnttab_map_grant_ref *xenvif_get_requests(struct xenvif *vif,
900 shinfo->nr_frags++, txp++, gop++) { 900 shinfo->nr_frags++, txp++, gop++) {
901 index = pending_index(vif->pending_cons++); 901 index = pending_index(vif->pending_cons++);
902 pending_idx = vif->pending_ring[index]; 902 pending_idx = vif->pending_ring[index];
903 xenvif_tx_create_gop(vif, pending_idx, txp, gop); 903 xenvif_tx_create_map_op(vif, pending_idx, txp, gop);
904 frag_set_pending_idx(&frags[shinfo->nr_frags], 904 frag_set_pending_idx(&frags[shinfo->nr_frags],
905 pending_idx); 905 pending_idx);
906 } 906 }
@@ -940,9 +940,9 @@ static inline void xenvif_grant_handle_reset(struct xenvif *vif,
940 940
941static int xenvif_tx_check_gop(struct xenvif *vif, 941static int xenvif_tx_check_gop(struct xenvif *vif,
942 struct sk_buff *skb, 942 struct sk_buff *skb,
943 struct gnttab_map_grant_ref **gopp) 943 struct gnttab_map_grant_ref **gopp_map)
944{ 944{
945 struct gnttab_map_grant_ref *gop = *gopp; 945 struct gnttab_map_grant_ref *gop_map = *gopp_map;
946 u16 pending_idx = XENVIF_TX_CB(skb)->pending_idx; 946 u16 pending_idx = XENVIF_TX_CB(skb)->pending_idx;
947 struct skb_shared_info *shinfo = skb_shinfo(skb); 947 struct skb_shared_info *shinfo = skb_shinfo(skb);
948 struct pending_tx_info *tx_info; 948 struct pending_tx_info *tx_info;
@@ -951,11 +951,11 @@ static int xenvif_tx_check_gop(struct xenvif *vif,
951 struct sk_buff *first_skb = NULL; 951 struct sk_buff *first_skb = NULL;
952 952
953 /* Check status of header. */ 953 /* Check status of header. */
954 err = gop->status; 954 err = gop_map->status;
955 if (unlikely(err)) 955 if (unlikely(err))
956 xenvif_idx_release(vif, pending_idx, XEN_NETIF_RSP_ERROR); 956 xenvif_idx_release(vif, pending_idx, XEN_NETIF_RSP_ERROR);
957 else 957 else
958 xenvif_grant_handle_set(vif, pending_idx , gop->handle); 958 xenvif_grant_handle_set(vif, pending_idx , gop_map->handle);
959 959
960 /* Skip first skb fragment if it is on same page as header fragment. */ 960 /* Skip first skb fragment if it is on same page as header fragment. */
961 start = (frag_get_pending_idx(&shinfo->frags[0]) == pending_idx); 961 start = (frag_get_pending_idx(&shinfo->frags[0]) == pending_idx);
@@ -968,10 +968,12 @@ check_frags:
968 tx_info = &vif->pending_tx_info[pending_idx]; 968 tx_info = &vif->pending_tx_info[pending_idx];
969 969
970 /* Check error status: if okay then remember grant handle. */ 970 /* Check error status: if okay then remember grant handle. */
971 newerr = (++gop)->status; 971 newerr = (++gop_map)->status;
972 972
973 if (likely(!newerr)) { 973 if (likely(!newerr)) {
974 xenvif_grant_handle_set(vif, pending_idx , gop->handle); 974 xenvif_grant_handle_set(vif,
975 pending_idx,
976 gop_map->handle);
975 /* Had a previous error? Invalidate this fragment. */ 977 /* Had a previous error? Invalidate this fragment. */
976 if (unlikely(err)) 978 if (unlikely(err))
977 xenvif_idx_unmap(vif, pending_idx); 979 xenvif_idx_unmap(vif, pending_idx);
@@ -1023,7 +1025,7 @@ check_frags:
1023 } 1025 }
1024 } 1026 }
1025 1027
1026 *gopp = gop + 1; 1028 *gopp_map = gop_map + 1;
1027 return err; 1029 return err;
1028} 1030}
1029 1031
@@ -1292,7 +1294,7 @@ static unsigned xenvif_tx_build_gops(struct xenvif *vif, int budget)
1292 } 1294 }
1293 } 1295 }
1294 1296
1295 xenvif_tx_create_gop(vif, pending_idx, &txreq, gop); 1297 xenvif_tx_create_map_op(vif, pending_idx, &txreq, gop);
1296 1298
1297 gop++; 1299 gop++;
1298 1300
@@ -1399,7 +1401,7 @@ static int xenvif_handle_frag_list(struct xenvif *vif, struct sk_buff *skb)
1399 1401
1400static int xenvif_tx_submit(struct xenvif *vif) 1402static int xenvif_tx_submit(struct xenvif *vif)
1401{ 1403{
1402 struct gnttab_map_grant_ref *gop = vif->tx_map_ops; 1404 struct gnttab_map_grant_ref *gop_map = vif->tx_map_ops;
1403 struct sk_buff *skb; 1405 struct sk_buff *skb;
1404 int work_done = 0; 1406 int work_done = 0;
1405 1407
@@ -1412,7 +1414,7 @@ static int xenvif_tx_submit(struct xenvif *vif)
1412 txp = &vif->pending_tx_info[pending_idx].req; 1414 txp = &vif->pending_tx_info[pending_idx].req;
1413 1415
1414 /* Check the remap error code. */ 1416 /* Check the remap error code. */
1415 if (unlikely(xenvif_tx_check_gop(vif, skb, &gop))) { 1417 if (unlikely(xenvif_tx_check_gop(vif, skb, &gop_map))) {
1416 netdev_dbg(vif->dev, "netback grant failed.\n"); 1418 netdev_dbg(vif->dev, "netback grant failed.\n");
1417 skb_shinfo(skb)->nr_frags = 0; 1419 skb_shinfo(skb)->nr_frags = 0;
1418 kfree_skb(skb); 1420 kfree_skb(skb);
@@ -1611,21 +1613,21 @@ static inline void xenvif_tx_dealloc_action(struct xenvif *vif)
1611/* Called after netfront has transmitted */ 1613/* Called after netfront has transmitted */
1612int xenvif_tx_action(struct xenvif *vif, int budget) 1614int xenvif_tx_action(struct xenvif *vif, int budget)
1613{ 1615{
1614 unsigned nr_gops; 1616 unsigned nr_mops;
1615 int work_done, ret; 1617 int work_done, ret;
1616 1618
1617 if (unlikely(!tx_work_todo(vif))) 1619 if (unlikely(!tx_work_todo(vif)))
1618 return 0; 1620 return 0;
1619 1621
1620 nr_gops = xenvif_tx_build_gops(vif, budget); 1622 nr_mops = xenvif_tx_build_gops(vif, budget);
1621 1623
1622 if (nr_gops == 0) 1624 if (nr_mops == 0)
1623 return 0; 1625 return 0;
1624 1626
1625 ret = gnttab_map_refs(vif->tx_map_ops, 1627 ret = gnttab_map_refs(vif->tx_map_ops,
1626 NULL, 1628 NULL,
1627 vif->pages_to_map, 1629 vif->pages_to_map,
1628 nr_gops); 1630 nr_mops);
1629 BUG_ON(ret); 1631 BUG_ON(ret);
1630 1632
1631 work_done = xenvif_tx_submit(vif); 1633 work_done = xenvif_tx_submit(vif);