Displaying 20 results from an estimated 136 matches for "vq_op".
Did you mean:
vq_ops
2010 Apr 12
10
[PATCH 0/6] virtio: virtqueue ops cleanup
...;ll
have multiple implementations besides virtio_ring,
but none have surfaced so far, and given that
existing virtio ring is deployed in production
we are likely stuck with it now, so this layer just
adds complexity and overhead.
Further, the need to pass vq twice to each call
(as in dev->vq->vq_ops->kick(dev->vq) ) adds potential
for cut and paste errors.
This patchset does the following:
- add inline wrappers converting the above to virtqueue_kick(dev->vq)
- convert all users to this API
- remove vq_ops indirection, implementing virtqueue_xx directly
in virtio_ring
Note that if...
2010 Apr 12
10
[PATCH 0/6] virtio: virtqueue ops cleanup
...;ll
have multiple implementations besides virtio_ring,
but none have surfaced so far, and given that
existing virtio ring is deployed in production
we are likely stuck with it now, so this layer just
adds complexity and overhead.
Further, the need to pass vq twice to each call
(as in dev->vq->vq_ops->kick(dev->vq) ) adds potential
for cut and paste errors.
This patchset does the following:
- add inline wrappers converting the above to virtqueue_kick(dev->vq)
- convert all users to this API
- remove vq_ops indirection, implementing virtqueue_xx directly
in virtio_ring
Note that if...
2009 Sep 21
0
[PATCH 2/6] virtio: make add_buf return capacity remaining
...| 2 +-
8 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -139,7 +139,7 @@ static bool do_req(struct request_queue
}
}
- if (vblk->vq->vq_ops->add_buf(vblk->vq, vblk->sg, out, in, vbr)) {
+ if (vblk->vq->vq_ops->add_buf(vblk->vq, vblk->sg, out, in, vbr) < 0) {
mempool_free(vbr, vblk->pool);
return false;
}
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c
--- a/d...
2009 Sep 21
0
[PATCH 2/6] virtio: make add_buf return capacity remaining
...| 2 +-
8 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -139,7 +139,7 @@ static bool do_req(struct request_queue
}
}
- if (vblk->vq->vq_ops->add_buf(vblk->vq, vblk->sg, out, in, vbr)) {
+ if (vblk->vq->vq_ops->add_buf(vblk->vq, vblk->sg, out, in, vbr) < 0) {
mempool_free(vbr, vblk->pool);
return false;
}
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c
--- a/d...
2009 Aug 18
2
[PATCH 1/2] virtio: Add a can_add_buf helper
...ct virtqueue *_vq)
+{
+ struct vring_virtqueue *vq = to_vvq(_vq);
+
+ return vq->num_free ? 1 : 0;
+}
+
static int vring_add_buf(struct virtqueue *_vq,
struct scatterlist sg[],
unsigned int out,
@@ -350,6 +357,7 @@ EXPORT_SYMBOL_GPL(vring_interrupt);
static struct virtqueue_ops vring_vq_ops = {
.add_buf = vring_add_buf,
.get_buf = vring_get_buf,
+ .can_add_buf = vring_can_add_buf,
.kick = vring_kick,
.disable_cb = vring_disable_cb,
.enable_cb = vring_enable_cb,
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 4fca4f5..cc0e3aa 100644
--- a/include/linux/vir...
2009 Aug 18
2
[PATCH 1/2] virtio: Add a can_add_buf helper
...ct virtqueue *_vq)
+{
+ struct vring_virtqueue *vq = to_vvq(_vq);
+
+ return vq->num_free ? 1 : 0;
+}
+
static int vring_add_buf(struct virtqueue *_vq,
struct scatterlist sg[],
unsigned int out,
@@ -350,6 +357,7 @@ EXPORT_SYMBOL_GPL(vring_interrupt);
static struct virtqueue_ops vring_vq_ops = {
.add_buf = vring_add_buf,
.get_buf = vring_get_buf,
+ .can_add_buf = vring_can_add_buf,
.kick = vring_kick,
.disable_cb = vring_disable_cb,
.enable_cb = vring_enable_cb,
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 4fca4f5..cc0e3aa 100644
--- a/include/linux/vir...
2008 Apr 18
0
virtio: wean net driver off NETDEV_TX_BUSY
...ac(mac, dest));
/* Encode metadata header at front. */
hdr = skb_vnet_hdr(skb);
@@ -271,30 +273,47 @@ static int start_xmit(struct sk_buff *sk
vnet_hdr_to_sg(sg, skb);
num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1;
- __skb_queue_head(&vi->send, skb);
+
+ return vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb);
+}
+
+static int start_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+ struct virtnet_info *vi = netdev_priv(dev);
again:
/* Free up any pending old buffers before queueing new ones. */
free_old_xmit_skbs(vi);
- err = vi->svq->vq_ops-&g...
2008 Apr 18
0
virtio: wean net driver off NETDEV_TX_BUSY
...ac(mac, dest));
/* Encode metadata header at front. */
hdr = skb_vnet_hdr(skb);
@@ -271,30 +273,47 @@ static int start_xmit(struct sk_buff *sk
vnet_hdr_to_sg(sg, skb);
num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1;
- __skb_queue_head(&vi->send, skb);
+
+ return vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb);
+}
+
+static int start_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+ struct virtnet_info *vi = netdev_priv(dev);
again:
/* Free up any pending old buffers before queueing new ones. */
free_old_xmit_skbs(vi);
- err = vi->svq->vq_ops-&g...
2007 Dec 14
3
virtio_net and SMP guests
...gt;] ext_no_vtime+0x16/0x1a
[<000000000010a57e>] cpu_idle+0x216/0x238
I think there is a valid code path, triggering this bug:
CPU1 CPU2
----------------------- -----------------------
- virtnet_poll found no
more packets on queue
- netif_rx_complete allow
poll to be called
- vq_ops->restart is called
- vq Interrupts are enabled
. <new packets arrive>
<vcpu is scheduled away>
. - interrupt is delivered
. - poll is called
. - poll work is done
. - netif_rx_complete
. - vq_ops->restart is called
. - check if vq interrupts...
2007 Dec 14
3
virtio_net and SMP guests
...gt;] ext_no_vtime+0x16/0x1a
[<000000000010a57e>] cpu_idle+0x216/0x238
I think there is a valid code path, triggering this bug:
CPU1 CPU2
----------------------- -----------------------
- virtnet_poll found no
more packets on queue
- netif_rx_complete allow
poll to be called
- vq_ops->restart is called
- vq Interrupts are enabled
. <new packets arrive>
<vcpu is scheduled away>
. - interrupt is delivered
. - poll is called
. - poll work is done
. - netif_rx_complete
. - vq_ops->restart is called
. - check if vq interrupts...
2008 May 26
1
[PATCH] virtio_rng: dont use vmalloced addresses for virtio
...a_left;
static DECLARE_COMPLETION(have_data);
@@ -47,9 +47,9 @@ static void register_buffer(void)
{
struct scatterlist sg;
- sg_init_one(&sg, &random_data, sizeof(random_data));
+ sg_init_one(&sg, random_data, 64);
/* There should always be room for one buffer. */
- if (vq->vq_ops->add_buf(vq, &sg, 0, 1, &random_data) != 0)
+ if (vq->vq_ops->add_buf(vq, &sg, 0, 1, random_data) != 0)
BUG();
vq->vq_ops->kick(vq);
}
@@ -128,11 +128,15 @@ static struct virtio_driver virtio_rng =
static int __init init(void)
{
+ random_data = kmalloc(64, GFP_...
2008 May 26
1
[PATCH] virtio_rng: dont use vmalloced addresses for virtio
...a_left;
static DECLARE_COMPLETION(have_data);
@@ -47,9 +47,9 @@ static void register_buffer(void)
{
struct scatterlist sg;
- sg_init_one(&sg, &random_data, sizeof(random_data));
+ sg_init_one(&sg, random_data, 64);
/* There should always be room for one buffer. */
- if (vq->vq_ops->add_buf(vq, &sg, 0, 1, &random_data) != 0)
+ if (vq->vq_ops->add_buf(vq, &sg, 0, 1, random_data) != 0)
BUG();
vq->vq_ops->kick(vq);
}
@@ -128,11 +128,15 @@ static struct virtio_driver virtio_rng =
static int __init init(void)
{
+ random_data = kmalloc(64, GFP_...
2008 Mar 03
0
[PATCH 1/3] Backward compat to replace napi in *rx_schedule*
...nsertions(+), 1 deletions(-)
diff --git a/hack-module.awk b/hack-module.awk
index 580090b..bd63fb9 100644
--- a/hack-module.awk
+++ b/hack-module.awk
@@ -45,8 +45,8 @@
print " return 1;";
print " }";
print "";
- print " no_work = vi->rvq->vq_ops->enable_cb(vi->rvq);";
print " netif_rx_complete(vi->dev);";
+ print " no_work = vi->rvq->vq_ops->enable_cb(vi->rvq);";
print "";
print " if (!no_work && netif_rx_reschedule(vi->dev, received)) {";...
2010 Jan 29
3
virtio: console: Return -EFAULT on copy_xx_user errors, allow larger writes
...tell us about it, we have to
- * copy the data here in case the caller frees the
- * in_buf.
- */
- memcpy(buf->buf, in_buf, in_count);
- ret = 0; /* Emulate copy_from_user behaviour */
- }
- buf->len = in_count - ret;
-
- sg_init_one(sg, buf->buf, buf->len);
- ret = out_vq->vq_ops->add_buf(out_vq, sg, 1, 0, buf);
+ sg_init_one(sg, in_buf, in_count);
+ ret = out_vq->vq_ops->add_buf(out_vq, sg, 1, 0, in_buf);
/* Tell Host to go! */
out_vq->vq_ops->kick(out_vq);
if (ret < 0) {
- buf->len = 0;
+ len = 0;
goto fail;
}
@@ -444,13 +421,11 @@...
2010 Jan 29
3
virtio: console: Return -EFAULT on copy_xx_user errors, allow larger writes
...tell us about it, we have to
- * copy the data here in case the caller frees the
- * in_buf.
- */
- memcpy(buf->buf, in_buf, in_count);
- ret = 0; /* Emulate copy_from_user behaviour */
- }
- buf->len = in_count - ret;
-
- sg_init_one(sg, buf->buf, buf->len);
- ret = out_vq->vq_ops->add_buf(out_vq, sg, 1, 0, buf);
+ sg_init_one(sg, in_buf, in_count);
+ ret = out_vq->vq_ops->add_buf(out_vq, sg, 1, 0, in_buf);
/* Tell Host to go! */
out_vq->vq_ops->kick(out_vq);
if (ret < 0) {
- buf->len = 0;
+ len = 0;
goto fail;
}
@@ -444,13 +421,11 @@...
2007 Nov 18
3
[PATCH 1/2] virtio: fix net driver loop case where we fail to restart
...vers/net/virtio_net.c Thu Nov 15 23:10:44 2007 +1100
@@ -198,8 +198,8 @@ again:
if (vi->num < vi->max / 2)
try_fill_recv(vi);
- /* All done? */
- if (!skb) {
+ /* Out of packets? */
+ if (received < budget) {
netif_rx_complete(vi->dev, napi);
if (unlikely(!vi->rvq->vq_ops->restart(vi->rvq))
&& netif_rx_reschedule(vi->dev, napi))
2007 Nov 18
3
[PATCH 1/2] virtio: fix net driver loop case where we fail to restart
...vers/net/virtio_net.c Thu Nov 15 23:10:44 2007 +1100
@@ -198,8 +198,8 @@ again:
if (vi->num < vi->max / 2)
try_fill_recv(vi);
- /* All done? */
- if (!skb) {
+ /* Out of packets? */
+ if (received < budget) {
netif_rx_complete(vi->dev, napi);
if (unlikely(!vi->rvq->vq_ops->restart(vi->rvq))
&& netif_rx_reschedule(vi->dev, napi))
2008 Apr 28
3
[PATCH 1/4] virtio: wean net driver off NETDEV_TX_BUSY
...t;dev->name, skb,
dest[0], dest[1], dest[2],
dest[3], dest[4], dest[5]);
@@ -272,30 +274,50 @@ static int start_xmit(struct sk_buff *sk
vnet_hdr_to_sg(sg, skb);
num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1;
- __skb_queue_head(&vi->send, skb);
+
+ return vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb);
+}
+
+static int start_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+ struct virtnet_info *vi = netdev_priv(dev);
again:
/* Free up any pending old buffers before queueing new ones. */
free_old_xmit_skbs(vi);
- err = vi->svq->vq_ops-&g...
2008 Apr 28
3
[PATCH 1/4] virtio: wean net driver off NETDEV_TX_BUSY
...t;dev->name, skb,
dest[0], dest[1], dest[2],
dest[3], dest[4], dest[5]);
@@ -272,30 +274,50 @@ static int start_xmit(struct sk_buff *sk
vnet_hdr_to_sg(sg, skb);
num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1;
- __skb_queue_head(&vi->send, skb);
+
+ return vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb);
+}
+
+static int start_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+ struct virtnet_info *vi = netdev_priv(dev);
again:
/* Free up any pending old buffers before queueing new ones. */
free_old_xmit_skbs(vi);
- err = vi->svq->vq_ops-&g...
2009 Nov 19
3
virtio: Add memory statistics reporting to the balloon driver (V3)
...ard, all conversations consist of
+ * a hypervisor request (a call to this function) which directs us to refill
+ * the virtqueue with a fresh stats buffer.
+ */
+static void stats_ack(struct virtqueue *vq)
+{
+ struct virtio_balloon *vb;
+ unsigned int len;
+ struct scatterlist sg;
+
+ vb = vq->vq_ops->get_buf(vq, &len);
+ if (!vb)
+ return;
+
+ update_balloon_stats(vb);
+
+ sg_init_one(&sg, vb->stats, sizeof(vb->stats));
+ if (vq->vq_ops->add_buf(vq, &sg, 1, 0, vb) < 0)
+ BUG();
+ vq->vq_ops->kick(vq);
+}
+
static void virtballoon_changed(struct virtio_de...