Commit 0d12391b authored by jiangdongxu's avatar jiangdongxu Committed by Jiang Dongxu
Browse files

vhost-vdpa: add reset state params to indicate reset level

virt inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8TP8X



----------------------------------------------------------------------

When vdpa hardware is used, some hardware initialization may be
required. Currently, qemu connects to vdpa devices through the vhost
framework. Since qemu opens the vhost device, the vdpa device cannot
sense the action of qemu opening, which may cause the hardware status to
be incorrect.

Add the interface parameter state to the vdpa reset interface, which
respectively identifies the reset when the device is turned on/off
and the virtio reset issued by the virtual machine.

Signed-off-by: default avatarjiangdongxu <jiangdongxu1@huawei.com>
parent 1ea5627c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -226,7 +226,7 @@ static void eni_vdpa_set_status(struct vdpa_device *vdpa, u8 status)
		eni_vdpa_free_irq(eni_vdpa);
}

static int eni_vdpa_reset(struct vdpa_device *vdpa)
static int eni_vdpa_reset(struct vdpa_device *vdpa, int state)
{
	struct eni_vdpa *eni_vdpa = vdpa_to_eni(vdpa);
	struct virtio_pci_legacy_device *ldev = &eni_vdpa->ldev;
+1 −1
Original line number Diff line number Diff line
@@ -434,7 +434,7 @@ static void ifcvf_vdpa_set_status(struct vdpa_device *vdpa_dev, u8 status)
	ifcvf_set_status(vf, status);
}

static int ifcvf_vdpa_reset(struct vdpa_device *vdpa_dev)
static int ifcvf_vdpa_reset(struct vdpa_device *vdpa_dev, int state)
{
	struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev);
	u8 status = ifcvf_get_status(vf);
+1 −1
Original line number Diff line number Diff line
@@ -2861,7 +2861,7 @@ static void init_group_to_asid_map(struct mlx5_vdpa_dev *mvdev)
		mvdev->group2asid[i] = 0;
}

static int mlx5_vdpa_reset(struct vdpa_device *vdev)
static int mlx5_vdpa_reset(struct vdpa_device *vdev, int state)
{
	struct mlx5_vdpa_dev *mvdev = to_mvdev(vdev);
	struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev);
+1 −1
Original line number Diff line number Diff line
@@ -496,7 +496,7 @@ static void pds_vdpa_init_vqs_entry(struct pds_vdpa_device *pdsv, int qid,
	pdsv->vqs[qid].notify = notify;
}

static int pds_vdpa_reset(struct vdpa_device *vdpa_dev)
static int pds_vdpa_reset(struct vdpa_device *vdpa_dev, int state)
{
	struct pds_vdpa_device *pdsv = vdpa_to_pdsv(vdpa_dev);
	struct device *dev;
+1 −1
Original line number Diff line number Diff line
@@ -245,7 +245,7 @@ static int snet_reset_dev(struct snet *snet)
	return 0;
}

static int snet_reset(struct vdpa_device *vdev)
static int snet_reset(struct vdpa_device *vdev, int state)
{
	struct snet *snet = vdpa_to_snet(vdev);

Loading