aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/xen-netfront.c
diff options
context:
space:
mode:
authorIan Campbell <Ian.Campbell@citrix.com>2011-03-14 20:06:18 -0400
committerDavid S. Miller <davem@davemloft.net>2011-03-15 22:38:03 -0400
commitf942dc2552b8bfdee607be867b12a8971bb9cd85 (patch)
treeba7d264f94d9e6938ef4e36f93e179162e12cf20 /drivers/net/xen-netfront.c
parente0da2481fc00e031c04480b9dc88fae9eff39a19 (diff)
xen network backend driver
netback is the host side counterpart to the frontend driver in drivers/net/xen-netfront.c. The PV protocol is also implemented by frontend drivers in other OSes too, such as the BSDs and even Windows. The patch is based on the driver from the xen.git pvops kernel tree but has been put through the checkpatch.pl wringer plus several manual cleanup passes and review iterations. The driver has been moved from drivers/xen/netback to drivers/net/xen-netback. One major change from xen.git is that the guest transmit path (i.e. what looks like receive to netback) has been significantly reworked to remove the dependency on the out of tree PageForeign page flag (a core kernel patch which enables a per page destructor callback on the final put_page). This page flag was used in order to implement a grant map based transmit path (where guest pages are mapped directly into SKB frags). Instead this version of netback uses grant copy operations into regular memory belonging to the backend domain. Reinstating the grant map functionality is something which I would like to revisit in the future. Note that this driver depends on 2e820f58f7ad "xen/irq: implement bind_interdomain_evtchn_to_irqhandler for backend drivers" which is in linux next via the "xen-two" tree and is intended for the 2.6.39 merge window: git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git stable/backends this branch has only that single commit since 2.6.38-rc2 and is safe for cross merging into the net branch. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Reviewed-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/xen-netfront.c')
-rw-r--r--drivers/net/xen-netfront.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 5b399b54fef7..5c8d9c385be0 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -359,7 +359,7 @@ static void xennet_tx_buf_gc(struct net_device *dev)
359 struct xen_netif_tx_response *txrsp; 359 struct xen_netif_tx_response *txrsp;
360 360
361 txrsp = RING_GET_RESPONSE(&np->tx, cons); 361 txrsp = RING_GET_RESPONSE(&np->tx, cons);
362 if (txrsp->status == NETIF_RSP_NULL) 362 if (txrsp->status == XEN_NETIF_RSP_NULL)
363 continue; 363 continue;
364 364
365 id = txrsp->id; 365 id = txrsp->id;
@@ -416,7 +416,7 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
416 larger than a page), split it it into page-sized chunks. */ 416 larger than a page), split it it into page-sized chunks. */
417 while (len > PAGE_SIZE - offset) { 417 while (len > PAGE_SIZE - offset) {
418 tx->size = PAGE_SIZE - offset; 418 tx->size = PAGE_SIZE - offset;
419 tx->flags |= NETTXF_more_data; 419 tx->flags |= XEN_NETTXF_more_data;
420 len -= tx->size; 420 len -= tx->size;
421 data += tx->size; 421 data += tx->size;
422 offset = 0; 422 offset = 0;
@@ -442,7 +442,7 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
442 for (i = 0; i < frags; i++) { 442 for (i = 0; i < frags; i++) {
443 skb_frag_t *frag = skb_shinfo(skb)->frags + i; 443 skb_frag_t *frag = skb_shinfo(skb)->frags + i;
444 444
445 tx->flags |= NETTXF_more_data; 445 tx->flags |= XEN_NETTXF_more_data;
446 446
447 id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs); 447 id = get_id_from_freelist(&np->tx_skb_freelist, np->tx_skbs);
448 np->tx_skbs[id].skb = skb_get(skb); 448 np->tx_skbs[id].skb = skb_get(skb);
@@ -517,10 +517,10 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
517 tx->flags = 0; 517 tx->flags = 0;
518 if (skb->ip_summed == CHECKSUM_PARTIAL) 518 if (skb->ip_summed == CHECKSUM_PARTIAL)
519 /* local packet? */ 519 /* local packet? */
520 tx->flags |= NETTXF_csum_blank | NETTXF_data_validated; 520 tx->flags |= XEN_NETTXF_csum_blank | XEN_NETTXF_data_validated;
521 else if (skb->ip_summed == CHECKSUM_UNNECESSARY) 521 else if (skb->ip_summed == CHECKSUM_UNNECESSARY)
522 /* remote but checksummed. */ 522 /* remote but checksummed. */
523 tx->flags |= NETTXF_data_validated; 523 tx->flags |= XEN_NETTXF_data_validated;
524 524
525 if (skb_shinfo(skb)->gso_size) { 525 if (skb_shinfo(skb)->gso_size) {
526 struct xen_netif_extra_info *gso; 526 struct xen_netif_extra_info *gso;
@@ -531,7 +531,7 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
531 if (extra) 531 if (extra)
532 extra->flags |= XEN_NETIF_EXTRA_FLAG_MORE; 532 extra->flags |= XEN_NETIF_EXTRA_FLAG_MORE;
533 else 533 else
534 tx->flags |= NETTXF_extra_info; 534 tx->flags |= XEN_NETTXF_extra_info;
535 535
536 gso->u.gso.size = skb_shinfo(skb)->gso_size; 536 gso->u.gso.size = skb_shinfo(skb)->gso_size;
537 gso->u.gso.type = XEN_NETIF_GSO_TYPE_TCPV4; 537 gso->u.gso.type = XEN_NETIF_GSO_TYPE_TCPV4;
@@ -651,7 +651,7 @@ static int xennet_get_responses(struct netfront_info *np,
651 int err = 0; 651 int err = 0;
652 unsigned long ret; 652 unsigned long ret;
653 653
654 if (rx->flags & NETRXF_extra_info) { 654 if (rx->flags & XEN_NETRXF_extra_info) {
655 err = xennet_get_extras(np, extras, rp); 655 err = xennet_get_extras(np, extras, rp);
656 cons = np->rx.rsp_cons; 656 cons = np->rx.rsp_cons;
657 } 657 }
@@ -688,7 +688,7 @@ static int xennet_get_responses(struct netfront_info *np,
688 __skb_queue_tail(list, skb); 688 __skb_queue_tail(list, skb);
689 689
690next: 690next:
691 if (!(rx->flags & NETRXF_more_data)) 691 if (!(rx->flags & XEN_NETRXF_more_data))
692 break; 692 break;
693 693
694 if (cons + frags == rp) { 694 if (cons + frags == rp) {
@@ -983,9 +983,9 @@ err:
983 skb->truesize += skb->data_len - (RX_COPY_THRESHOLD - len); 983 skb->truesize += skb->data_len - (RX_COPY_THRESHOLD - len);
984 skb->len += skb->data_len; 984 skb->len += skb->data_len;
985 985
986 if (rx->flags & NETRXF_csum_blank) 986 if (rx->flags & XEN_NETRXF_csum_blank)
987 skb->ip_summed = CHECKSUM_PARTIAL; 987 skb->ip_summed = CHECKSUM_PARTIAL;
988 else if (rx->flags & NETRXF_data_validated) 988 else if (rx->flags & XEN_NETRXF_data_validated)
989 skb->ip_summed = CHECKSUM_UNNECESSARY; 989 skb->ip_summed = CHECKSUM_UNNECESSARY;
990 990
991 __skb_queue_tail(&rxq, skb); 991 __skb_queue_tail(&rxq, skb);