aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Zhu Lingshan <lingshan.zhu@intel.com> 2020-06-05 18:27:12 +0800
committerGravatar Michael S. Tsirkin <mst@redhat.com> 2020-06-06 16:25:22 -0400
commitbb02e6e63d0e71188bc5fe5f4732e66bc8b5dceb (patch)
tree2756d7ad22cb91e2b47ade6dd8d9603eea5d05cc
parentvirtio-mem: Don't rely on implicit compiler padding for requests (diff)
downloadlinux-bb02e6e63d0e71188bc5fe5f4732e66bc8b5dceb.tar.gz
linux-bb02e6e63d0e71188bc5fe5f4732e66bc8b5dceb.tar.bz2
linux-bb02e6e63d0e71188bc5fe5f4732e66bc8b5dceb.zip
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: Zhu Lingshan <lingshan.zhu@intel.com> Link: https://lore.kernel.org/r/1591352835-22441-3-git-send-email-lingshan.zhu@intel.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--drivers/vdpa/ifcvf/ifcvf_main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c
index d529ed681fe6..63a6366b4355 100644
--- a/drivers/vdpa/ifcvf/ifcvf_main.c
+++ b/drivers/vdpa/ifcvf/ifcvf_main.c
@@ -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);