Commit bb02e6e6 authored by Zhu Lingshan's avatar Zhu Lingshan Committed by Michael S. Tsirkin

ifcvf: ignore continuous setting same status value

User space may try to set status of same value multiple times,
this patch handles this case more efficiently by ignoring the
setting of the same status value.
Signed-off-by: default avatarZhu Lingshan <lingshan.zhu@intel.com>
Link: https://lore.kernel.org/r/1591352835-22441-3-git-send-email-lingshan.zhu@intel.comSigned-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent fce8afd7
......@@ -179,6 +179,9 @@ static void ifcvf_vdpa_set_status(struct vdpa_device *vdpa_dev, u8 status)
adapter = dev_get_drvdata(vdpa_dev->dev.parent);
status_old = ifcvf_get_status(vf);
if (status_old == status)
return;
if ((status_old & VIRTIO_CONFIG_S_DRIVER_OK) &&
!(status & VIRTIO_CONFIG_S_DRIVER_OK)) {
ifcvf_stop_datapath(adapter);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment