Skip to content

Commit

Permalink
Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/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
  • Loading branch information
torvalds committed Dec 4, 2023
2 parents 33cc938 + cefc9ba commit 1e53574
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
7 changes: 6 additions & 1 deletion drivers/vdpa/mlx5/net/mlx5_vnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -2815,13 +2815,18 @@ static int setup_cvq_vring(struct mlx5_vdpa_dev *mvdev)
struct mlx5_control_vq *cvq = &mvdev->cvq;
int err = 0;

if (mvdev->actual_features & BIT_ULL(VIRTIO_NET_F_CTRL_VQ))
if (mvdev->actual_features & BIT_ULL(VIRTIO_NET_F_CTRL_VQ)) {
u16 idx = cvq->vring.last_avail_idx;

err = vringh_init_iotlb(&cvq->vring, mvdev->actual_features,
MLX5_CVQ_MAX_ENT, false,
(struct vring_desc *)(uintptr_t)cvq->desc_addr,
(struct vring_avail *)(uintptr_t)cvq->driver_addr,
(struct vring_used *)(uintptr_t)cvq->device_addr);

if (!err)
cvq->vring.last_avail_idx = cvq->vring.last_used_idx = idx;
}
return err;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/vdpa/pds/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ void pds_vdpa_debugfs_add_vdpadev(struct pds_vdpa_aux *vdpa_aux)
debugfs_create_file("config", 0400, vdpa_aux->dentry, vdpa_aux->pdsv, &config_fops);

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

snprintf(name, sizeof(name), "vq%02d", i);
debugfs_create_file(name, 0400, vdpa_aux->dentry,
Expand Down
7 changes: 4 additions & 3 deletions drivers/vdpa/pds/vdpa_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,8 @@ static int pds_vdpa_set_driver_features(struct vdpa_device *vdpa_dev, u64 featur
return -EOPNOTSUPP;
}

pdsv->negotiated_features = nego_features;

driver_features = pds_vdpa_get_driver_features(vdpa_dev);
pdsv->negotiated_features = nego_features;
dev_dbg(dev, "%s: %#llx => %#llx\n",
__func__, driver_features, nego_features);

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

pds_vdpa_cmd_set_status(pdsv, status);

/* Note: still working with FW on the need for this reset cmd */
if (status == 0) {
struct vdpa_callback null_cb = { };

pds_vdpa_set_config_cb(vdpa_dev, &null_cb);
pds_vdpa_cmd_reset(pdsv);

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

0 comments on commit 1e53574

Please sign in to comment.