Skip to content

Commit 7ed8ce1

Browse files
Bhavesh Davdakonradwilk
authored andcommitted
xen-blkfront: move negotiate_mq to cover all cases of new VBDs
negotiate_mq should happen in all cases of a new VBD being discovered by xen-blkfront, whether called through _probe() or a hot-attached new VBD from dom-0 via xenstore. Otherwise, hot-attached new VBDs are left configured without multi-queue. Signed-off-by: Bhavesh Davda <[email protected]> Reviewed-by: Konrad Rzeszutek Wilk <[email protected]> Signed-off-by: Konrad Rzeszutek Wilk <[email protected]>
1 parent bebc608 commit 7ed8ce1

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

drivers/block/xen-blkfront.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ static DEFINE_SPINLOCK(minor_lock);
262262

263263
static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo);
264264
static void blkfront_gather_backend_features(struct blkfront_info *info);
265+
static int negotiate_mq(struct blkfront_info *info);
265266

266267
static int get_id_from_freelist(struct blkfront_ring_info *rinfo)
267268
{
@@ -1774,11 +1775,18 @@ static int talk_to_blkback(struct xenbus_device *dev,
17741775
unsigned int i, max_page_order;
17751776
unsigned int ring_page_order;
17761777

1778+
if (!info)
1779+
return -ENODEV;
1780+
17771781
max_page_order = xenbus_read_unsigned(info->xbdev->otherend,
17781782
"max-ring-page-order", 0);
17791783
ring_page_order = min(xen_blkif_max_ring_order, max_page_order);
17801784
info->nr_ring_pages = 1 << ring_page_order;
17811785

1786+
err = negotiate_mq(info);
1787+
if (err)
1788+
goto destroy_blkring;
1789+
17821790
for (i = 0; i < info->nr_rings; i++) {
17831791
struct blkfront_ring_info *rinfo = &info->rinfo[i];
17841792

@@ -1978,11 +1986,6 @@ static int blkfront_probe(struct xenbus_device *dev,
19781986
}
19791987

19801988
info->xbdev = dev;
1981-
err = negotiate_mq(info);
1982-
if (err) {
1983-
kfree(info);
1984-
return err;
1985-
}
19861989

19871990
mutex_init(&info->mutex);
19881991
info->vdevice = vdevice;
@@ -2099,10 +2102,6 @@ static int blkfront_resume(struct xenbus_device *dev)
20992102

21002103
blkif_free(info, info->connected == BLKIF_STATE_CONNECTED);
21012104

2102-
err = negotiate_mq(info);
2103-
if (err)
2104-
return err;
2105-
21062105
err = talk_to_blkback(dev, info);
21072106
if (!err)
21082107
blk_mq_update_nr_hw_queues(&info->tag_set, info->nr_rings);

0 commit comments

Comments
 (0)