Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 66524
b: refs/heads/master
c: 5dcddfa
h: refs/heads/master
v: v3
  • Loading branch information
Jeremy Fitzhardinge authored and David S. Miller committed Oct 10, 2007
1 parent 061a05c commit d6f7a8d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 36 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: df570f93337ddb46f1e30dd167c27b5fdcec637b
refs/heads/master: 5dcddfae63bd26da0f11a8e40f0ae555b5ac624e
37 changes: 2 additions & 35 deletions trunk/drivers/net/xen-netfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,9 @@ static void xennet_alloc_rx_buffers(struct net_device *dev)
struct page *page;
int i, batch_target, notify;
RING_IDX req_prod = np->rx.req_prod_pvt;
struct xen_memory_reservation reservation;
grant_ref_t ref;
unsigned long pfn;
void *vaddr;
int nr_flips;
struct xen_netif_rx_request *req;

if (unlikely(!netif_carrier_ok(dev)))
Expand Down Expand Up @@ -268,7 +266,7 @@ static void xennet_alloc_rx_buffers(struct net_device *dev)
np->rx_target = np->rx_max_target;

refill:
for (nr_flips = i = 0; ; i++) {
for (i = 0; ; i++) {
skb = __skb_dequeue(&np->rx_batch);
if (skb == NULL)
break;
Expand Down Expand Up @@ -297,38 +295,7 @@ static void xennet_alloc_rx_buffers(struct net_device *dev)
req->gref = ref;
}

if (nr_flips != 0) {
reservation.extent_start = np->rx_pfn_array;
reservation.nr_extents = nr_flips;
reservation.extent_order = 0;
reservation.address_bits = 0;
reservation.domid = DOMID_SELF;

if (!xen_feature(XENFEAT_auto_translated_physmap)) {
/* After all PTEs have been zapped, flush the TLB. */
np->rx_mcl[i-1].args[MULTI_UVMFLAGS_INDEX] =
UVMF_TLB_FLUSH|UVMF_ALL;

/* Give away a batch of pages. */
np->rx_mcl[i].op = __HYPERVISOR_memory_op;
np->rx_mcl[i].args[0] = XENMEM_decrease_reservation;
np->rx_mcl[i].args[1] = (unsigned long)&reservation;

/* Zap PTEs and give away pages in one big
* multicall. */
(void)HYPERVISOR_multicall(np->rx_mcl, i+1);

/* Check return status of HYPERVISOR_memory_op(). */
if (unlikely(np->rx_mcl[i].result != i))
panic("Unable to reduce memory reservation\n");
} else {
if (HYPERVISOR_memory_op(XENMEM_decrease_reservation,
&reservation) != i)
panic("Unable to reduce memory reservation\n");
}
} else {
wmb(); /* barrier so backend seens requests */
}
wmb(); /* barrier so backend seens requests */

/* Above is a suitable barrier to ensure backend will see requests. */
np->rx.req_prod_pvt = req_prod + i;
Expand Down

0 comments on commit d6f7a8d

Please sign in to comment.