Displaying 20 results from an estimated 290 matches for "virtblk_probe".
2020 Jul 15
3
[PATCH] virtio-blk: check host supplied logical block size
...q_ops = {
static unsigned int virtblk_queue_depth;
module_param_named(queue_depth, virtblk_queue_depth, uint, 0444);
+
+static bool virtblk_valid_block_size(unsigned int blksize)
+{
+ return blksize >= 512 && blksize <= PAGE_SIZE && is_power_of_2(blksize);
+}
+
static int virtblk_probe(struct virtio_device *vdev)
{
struct virtio_blk *vblk;
@@ -809,9 +815,16 @@ static int virtblk_probe(struct virtio_device *vdev)
err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
struct virtio_blk_config, blk_size,
&blk_size);
- if (!err)
+ if (!err) {
+ if (!virtblk...
2020 Jul 15
3
[PATCH] virtio-blk: check host supplied logical block size
...q_ops = {
static unsigned int virtblk_queue_depth;
module_param_named(queue_depth, virtblk_queue_depth, uint, 0444);
+
+static bool virtblk_valid_block_size(unsigned int blksize)
+{
+ return blksize >= 512 && blksize <= PAGE_SIZE && is_power_of_2(blksize);
+}
+
static int virtblk_probe(struct virtio_device *vdev)
{
struct virtio_blk *vblk;
@@ -809,9 +815,16 @@ static int virtblk_probe(struct virtio_device *vdev)
err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
struct virtio_blk_config, blk_size,
&blk_size);
- if (!err)
+ if (!err) {
+ if (!virtblk...
2020 Jun 15
0
[PATCH] virtio-blk: free vblk-vqs in error path of virtblk_probe()
.../block/virtio_blk.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> index 9d21bf0f155e..980df853ee49 100644
> --- a/drivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -878,6 +878,7 @@ static int virtblk_probe(struct virtio_device *vdev)
> put_disk(vblk->disk);
> out_free_vq:
> vdev->config->del_vqs(vdev);
> + kfree(vblk->vqs);
> out_free_vblk:
> kfree(vblk);
> out_free_index:
> --
> 2.25.0.4.g0ad7144999
>
The patch LGTM:
Reviewed-by: Stefano Garzare...
2020 Jun 30
0
[PATCH] virtio-blk: free vblk-vqs in error path of virtblk_probe()
.../block/virtio_blk.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> index 9d21bf0f155e..980df853ee49 100644
> --- a/drivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -878,6 +878,7 @@ static int virtblk_probe(struct virtio_device *vdev)
> put_disk(vblk->disk);
> out_free_vq:
> vdev->config->del_vqs(vdev);
> + kfree(vblk->vqs);
> out_free_vblk:
> kfree(vblk);
> out_free_index:
> --
> 2.25.0.4.g0ad7144999
>
Reviewed-by: Ming Lei <ming.lei at redhat....
2020 Jul 15
2
[PATCH] virtio-blk: check host supplied logical block size
...in that case, does not this belong
> in blk core?
It is a blk core assumption.
I had checked other drivers and these that have variable block size all
check this manually like that.
I don't mind fixing all of them but I am a bit afraid to create
too much mess.
>
> > static int virtblk_probe(struct virtio_device *vdev)
> > {
> > struct virtio_blk *vblk;
> > @@ -809,9 +815,16 @@ static int virtblk_probe(struct virtio_device
> > *vdev)
> > err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
> > struct virtio_blk_config, blk_size,
>...
2020 Jul 15
2
[PATCH] virtio-blk: check host supplied logical block size
...in that case, does not this belong
> in blk core?
It is a blk core assumption.
I had checked other drivers and these that have variable block size all
check this manually like that.
I don't mind fixing all of them but I am a bit afraid to create
too much mess.
>
> > static int virtblk_probe(struct virtio_device *vdev)
> > {
> > struct virtio_blk *vblk;
> > @@ -809,9 +815,16 @@ static int virtblk_probe(struct virtio_device
> > *vdev)
> > err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
> > struct virtio_blk_config, blk_size,
>...
2018 Jan 03
1
[PATCH] virtio_blk: print capacity at probe time
...Many
users expect this since SCSI disks (sd) do it. Moreover, kernel dmesg
output is the primary source of troubleshooting information so it's
helpful to include the disk size there.
The capacity is already printed by virtio_blk when a resize event
occurs. Extract the code and reuse it from virtblk_probe().
This patch also adds the block device name to the message so it can be
correlated with a specific device:
virtio_blk virtio0: [vda] 20971520 512-byte logical blocks (10.7 GB/10.0 GiB)
Cc: Rodrigo A B Freire <rfreire at redhat.com>
Cc: Michael S. Tsirkin <mst at redhat.com>
Signe...
2020 Jul 01
0
[PATCH] virtio-blk: free vblk-vqs in error path of virtblk_probe()
On 6/14/20 10:14 PM, Hou Tao wrote:
> Else there will be memory leak if alloc_disk() fails.
Applied, thanks.
--
Jens Axboe
2009 May 19
1
[PATCH] virtio_blk: add missing __dev{init,exit} markings
On Mon, 18 May 2009 05:09:09 pm Mike Frysinger wrote:
> -static int virtblk_probe(struct virtio_device *vdev)
> +static int __devinit virtblk_probe(struct virtio_device *vdev)
This makes sense, I think, but then it implies that virtio_dev_probe() should
also be __devinit, right?
And I look at pci_bus_probe(), and it's not __devinit.
Is the PCI code just slack?
Rusty.
2009 May 19
1
[PATCH] virtio_blk: add missing __dev{init,exit} markings
On Mon, 18 May 2009 05:09:09 pm Mike Frysinger wrote:
> -static int virtblk_probe(struct virtio_device *vdev)
> +static int __devinit virtblk_probe(struct virtio_device *vdev)
This makes sense, I think, but then it implies that virtio_dev_probe() should
also be __devinit, right?
And I look at pci_bus_probe(), and it's not __devinit.
Is the PCI code just slack?
Rusty.
2011 Jun 01
6
[PATCH 1/1] [virt] virtio-blk: Use ida to allocate disk index
...EFINE_IDA(vd_index_ida);
+
struct workqueue_struct *virtblk_wq;
struct virtio_blk
@@ -23,6 +27,7 @@ struct virtio_blk
/* The disk structure for the kernel. */
struct gendisk *disk;
+ u32 index;
/* Request tracking. */
struct list_head reqs;
@@ -343,12 +348,26 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
struct request_queue *q;
int err;
u64 cap;
- u32 v, blk_size, sg_elems, opt_io_size;
+ u32 v, blk_size, sg_elems, opt_io_size, index;
u16 min_io_size;
u8 physical_block_exp, alignment_offset;
- if (index_to_minor(index) >= 1 << MINORBITS)
- return -...
2011 Jun 01
6
[PATCH 1/1] [virt] virtio-blk: Use ida to allocate disk index
...EFINE_IDA(vd_index_ida);
+
struct workqueue_struct *virtblk_wq;
struct virtio_blk
@@ -23,6 +27,7 @@ struct virtio_blk
/* The disk structure for the kernel. */
struct gendisk *disk;
+ u32 index;
/* Request tracking. */
struct list_head reqs;
@@ -343,12 +348,26 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
struct request_queue *q;
int err;
u64 cap;
- u32 v, blk_size, sg_elems, opt_io_size;
+ u32 v, blk_size, sg_elems, opt_io_size, index;
u16 min_io_size;
u8 physical_block_exp, alignment_offset;
- if (index_to_minor(index) >= 1 << MINORBITS)
- return -...
2012 Apr 10
3
[PATCH] virtio_blk: Add help function to format mass of disks
...nd - 1;
+ *p = '\0';
+ unit = base;
+ do {
+ if (p == begin)
+ return -EINVAL;
+ *--p = 'a' + (index % unit);
+ index = (index / unit) - 1;
+ } while (index >= 0);
+
+ memmove(begin, p, end - p);
+ memcpy(buf, prefix, strlen(prefix));
+
+ return 0;
+}
+
static int __devinit virtblk_probe(struct virtio_device *vdev)
{
struct virtio_blk *vblk;
@@ -442,18 +467,7 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
q->queuedata = vblk;
- if (index < 26) {
- sprintf(vblk->disk->disk_name, "vd%c", 'a' + index % 26);
- } else if (index...
2012 Apr 10
3
[PATCH] virtio_blk: Add help function to format mass of disks
...nd - 1;
+ *p = '\0';
+ unit = base;
+ do {
+ if (p == begin)
+ return -EINVAL;
+ *--p = 'a' + (index % unit);
+ index = (index / unit) - 1;
+ } while (index >= 0);
+
+ memmove(begin, p, end - p);
+ memcpy(buf, prefix, strlen(prefix));
+
+ return 0;
+}
+
static int __devinit virtblk_probe(struct virtio_device *vdev)
{
struct virtio_blk *vblk;
@@ -442,18 +467,7 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
q->queuedata = vblk;
- if (index < 26) {
- sprintf(vblk->disk->disk_name, "vd%c", 'a' + index % 26);
- } else if (index...
2014 Jun 20
3
[PATCH v1 0/2] block: virtio-blk: support multi vq per virtio-blk
Hi,
These patches try to support multi virtual queues(multi-vq) in one
virtio-blk device, and maps each virtual queue(vq) to blk-mq's
hardware queue.
With this approach, both scalability and performance on virtio-blk
device can get improved.
For verifying the improvement, I implements virtio-blk multi-vq over
qemu's dataplane feature, and both handling host notification
from each vq and
2014 Jun 20
3
[PATCH v1 0/2] block: virtio-blk: support multi vq per virtio-blk
Hi,
These patches try to support multi virtual queues(multi-vq) in one
virtio-blk device, and maps each virtual queue(vq) to blk-mq's
hardware queue.
With this approach, both scalability and performance on virtio-blk
device can get improved.
For verifying the improvement, I implements virtio-blk multi-vq over
qemu's dataplane feature, and both handling host notification
from each vq and
2014 Jun 26
1
[PATCH v2 2/2] block: virtio-blk: support multi virt queues per virtio-blk device
...if vq names are later used, since
vring_new_virtqueue simply does
vq->vq.name = name;
You need to keep the memory around until unplug.
> + err_name_array:
> + if (err)
> + kfree(vblk->vqs);
> + out:
> return err;
> }
>
> @@ -551,7 +619,6 @@ static int virtblk_probe(struct virtio_device *vdev)
> err = init_vq(vblk);
> if (err)
> goto out_free_vblk;
> - spin_lock_init(&vblk->vq_lock);
>
> /* FIXME: How many partitions? How long is a piece of string? */
> vblk->disk = alloc_disk(1 << PART_BITS);
> @@ -562,7 +...
2014 Jun 26
1
[PATCH v2 2/2] block: virtio-blk: support multi virt queues per virtio-blk device
...if vq names are later used, since
vring_new_virtqueue simply does
vq->vq.name = name;
You need to keep the memory around until unplug.
> + err_name_array:
> + if (err)
> + kfree(vblk->vqs);
> + out:
> return err;
> }
>
> @@ -551,7 +619,6 @@ static int virtblk_probe(struct virtio_device *vdev)
> err = init_vq(vblk);
> if (err)
> goto out_free_vblk;
> - spin_lock_init(&vblk->vq_lock);
>
> /* FIXME: How many partitions? How long is a piece of string? */
> vblk->disk = alloc_disk(1 << PART_BITS);
> @@ -562,7 +...
2014 Mar 14
4
[PATCH] virtio-blk: Initialize blkqueue depth from virtqueue size
...rs/block/virtio_blk.c
@@ -485,7 +485,6 @@ static struct blk_mq_ops virtio_mq_ops = {
static struct blk_mq_reg virtio_mq_reg = {
.ops = &virtio_mq_ops,
.nr_hw_queues = 1,
- .queue_depth = 64,
.numa_node = NUMA_NO_NODE,
.flags = BLK_MQ_F_SHOULD_MERGE,
};
@@ -555,6 +554,7 @@ static int virtblk_probe(struct virtio_device *vdev)
virtio_mq_reg.cmd_size =
sizeof(struct virtblk_req) +
sizeof(struct scatterlist) * sg_elems;
+ virtio_mq_reg.queue_depth = vblk->vq->num_free / 2;
q = vblk->disk->queue = blk_mq_init_queue(&virtio_mq_reg, vblk);
if (!q) {
--
1.9.0.279.gdc9e...
2014 Mar 14
4
[PATCH] virtio-blk: Initialize blkqueue depth from virtqueue size
...rs/block/virtio_blk.c
@@ -485,7 +485,6 @@ static struct blk_mq_ops virtio_mq_ops = {
static struct blk_mq_reg virtio_mq_reg = {
.ops = &virtio_mq_ops,
.nr_hw_queues = 1,
- .queue_depth = 64,
.numa_node = NUMA_NO_NODE,
.flags = BLK_MQ_F_SHOULD_MERGE,
};
@@ -555,6 +554,7 @@ static int virtblk_probe(struct virtio_device *vdev)
virtio_mq_reg.cmd_size =
sizeof(struct virtblk_req) +
sizeof(struct scatterlist) * sg_elems;
+ virtio_mq_reg.queue_depth = vblk->vq->num_free / 2;
q = vblk->disk->queue = blk_mq_init_queue(&virtio_mq_reg, vblk);
if (!q) {
--
1.9.0.279.gdc9e...