Skip to content

Commit 1e53574

Browse files
committed
Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Pull vdpa fixes from Michael Tsirkin: "Fixes in mlx5 and pds drivers" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: pds_vdpa: set features order pds_vdpa: clear config callback when status goes to 0 pds_vdpa: fix up format-truncation complaint vdpa/mlx5: preserve CVQ vringh index
2 parents 33cc938 + cefc9ba commit 1e53574

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

drivers/vdpa/mlx5/net/mlx5_vnet.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2815,13 +2815,18 @@ static int setup_cvq_vring(struct mlx5_vdpa_dev *mvdev)
28152815
struct mlx5_control_vq *cvq = &mvdev->cvq;
28162816
int err = 0;
28172817

2818-
if (mvdev->actual_features & BIT_ULL(VIRTIO_NET_F_CTRL_VQ))
2818+
if (mvdev->actual_features & BIT_ULL(VIRTIO_NET_F_CTRL_VQ)) {
2819+
u16 idx = cvq->vring.last_avail_idx;
2820+
28192821
err = vringh_init_iotlb(&cvq->vring, mvdev->actual_features,
28202822
MLX5_CVQ_MAX_ENT, false,
28212823
(struct vring_desc *)(uintptr_t)cvq->desc_addr,
28222824
(struct vring_avail *)(uintptr_t)cvq->driver_addr,
28232825
(struct vring_used *)(uintptr_t)cvq->device_addr);
28242826

2827+
if (!err)
2828+
cvq->vring.last_avail_idx = cvq->vring.last_used_idx = idx;
2829+
}
28252830
return err;
28262831
}
28272832

drivers/vdpa/pds/debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ void pds_vdpa_debugfs_add_vdpadev(struct pds_vdpa_aux *vdpa_aux)
261261
debugfs_create_file("config", 0400, vdpa_aux->dentry, vdpa_aux->pdsv, &config_fops);
262262

263263
for (i = 0; i < vdpa_aux->pdsv->num_vqs; i++) {
264-
char name[8];
264+
char name[16];
265265

266266
snprintf(name, sizeof(name), "vq%02d", i);
267267
debugfs_create_file(name, 0400, vdpa_aux->dentry,

drivers/vdpa/pds/vdpa_dev.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,8 @@ static int pds_vdpa_set_driver_features(struct vdpa_device *vdpa_dev, u64 featur
318318
return -EOPNOTSUPP;
319319
}
320320

321-
pdsv->negotiated_features = nego_features;
322-
323321
driver_features = pds_vdpa_get_driver_features(vdpa_dev);
322+
pdsv->negotiated_features = nego_features;
324323
dev_dbg(dev, "%s: %#llx => %#llx\n",
325324
__func__, driver_features, nego_features);
326325

@@ -461,8 +460,10 @@ static void pds_vdpa_set_status(struct vdpa_device *vdpa_dev, u8 status)
461460

462461
pds_vdpa_cmd_set_status(pdsv, status);
463462

464-
/* Note: still working with FW on the need for this reset cmd */
465463
if (status == 0) {
464+
struct vdpa_callback null_cb = { };
465+
466+
pds_vdpa_set_config_cb(vdpa_dev, &null_cb);
466467
pds_vdpa_cmd_reset(pdsv);
467468

468469
for (i = 0; i < pdsv->num_vqs; i++) {

0 commit comments

Comments
 (0)