diff options
author | Wei Liu <wei.liu2@citrix.com> | 2015-04-03 02:44:59 -0400 |
---|---|---|
committer | David Vrabel <david.vrabel@citrix.com> | 2015-04-15 05:56:47 -0400 |
commit | ccc9d90a9a8b5c4ad7e9708ec41f75ff9e98d61d (patch) | |
tree | 2a147c10a289a3f4283d6008708297f07df052a6 /drivers/net/xen-netfront.c | |
parent | 278edfc07875779a69277f6c5773ec9318a994ee (diff) |
xenbus_client: Extend interface to support multi-page ring
Originally Xen PV drivers only use single-page ring to pass along
information. This might limit the throughput between frontend and
backend.
The patch extends Xenbus driver to support multi-page ring, which in
general should improve throughput if ring is the bottleneck. Changes to
various frontend / backend to adapt to the new interface are also
included.
Affected Xen drivers:
* blkfront/back
* netfront/back
* pcifront/back
* scsifront/back
* vtpmfront
The interface is documented, as before, in xenbus_client.c.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Bob Liu <bob.liu@oracle.com>
Cc: Konrad Wilk <konrad.wilk@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Diffstat (limited to 'drivers/net/xen-netfront.c')
-rw-r--r-- | drivers/net/xen-netfront.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index e9b960f0ff32..13f5e7ff4bb5 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -1486,6 +1486,7 @@ static int setup_netfront(struct xenbus_device *dev, | |||
1486 | { | 1486 | { |
1487 | struct xen_netif_tx_sring *txs; | 1487 | struct xen_netif_tx_sring *txs; |
1488 | struct xen_netif_rx_sring *rxs; | 1488 | struct xen_netif_rx_sring *rxs; |
1489 | grant_ref_t gref; | ||
1489 | int err; | 1490 | int err; |
1490 | 1491 | ||
1491 | queue->tx_ring_ref = GRANT_INVALID_REF; | 1492 | queue->tx_ring_ref = GRANT_INVALID_REF; |
@@ -1502,10 +1503,10 @@ static int setup_netfront(struct xenbus_device *dev, | |||
1502 | SHARED_RING_INIT(txs); | 1503 | SHARED_RING_INIT(txs); |
1503 | FRONT_RING_INIT(&queue->tx, txs, PAGE_SIZE); | 1504 | FRONT_RING_INIT(&queue->tx, txs, PAGE_SIZE); |
1504 | 1505 | ||
1505 | err = xenbus_grant_ring(dev, virt_to_mfn(txs)); | 1506 | err = xenbus_grant_ring(dev, txs, 1, &gref); |
1506 | if (err < 0) | 1507 | if (err < 0) |
1507 | goto grant_tx_ring_fail; | 1508 | goto grant_tx_ring_fail; |
1508 | queue->tx_ring_ref = err; | 1509 | queue->tx_ring_ref = gref; |
1509 | 1510 | ||
1510 | rxs = (struct xen_netif_rx_sring *)get_zeroed_page(GFP_NOIO | __GFP_HIGH); | 1511 | rxs = (struct xen_netif_rx_sring *)get_zeroed_page(GFP_NOIO | __GFP_HIGH); |
1511 | if (!rxs) { | 1512 | if (!rxs) { |
@@ -1516,10 +1517,10 @@ static int setup_netfront(struct xenbus_device *dev, | |||
1516 | SHARED_RING_INIT(rxs); | 1517 | SHARED_RING_INIT(rxs); |
1517 | FRONT_RING_INIT(&queue->rx, rxs, PAGE_SIZE); | 1518 | FRONT_RING_INIT(&queue->rx, rxs, PAGE_SIZE); |
1518 | 1519 | ||
1519 | err = xenbus_grant_ring(dev, virt_to_mfn(rxs)); | 1520 | err = xenbus_grant_ring(dev, rxs, 1, &gref); |
1520 | if (err < 0) | 1521 | if (err < 0) |
1521 | goto grant_rx_ring_fail; | 1522 | goto grant_rx_ring_fail; |
1522 | queue->rx_ring_ref = err; | 1523 | queue->rx_ring_ref = gref; |
1523 | 1524 | ||
1524 | if (feature_split_evtchn) | 1525 | if (feature_split_evtchn) |
1525 | err = setup_netfront_split(queue); | 1526 | err = setup_netfront_split(queue); |