Skip to content

Commit bb02e6e

Browse files
Zhu Lingshanmstsirkin
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent fce8afd commit bb02e6e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/vdpa/ifcvf/ifcvf_main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ static void ifcvf_vdpa_set_status(struct vdpa_device *vdpa_dev, u8 status)
179179
adapter = dev_get_drvdata(vdpa_dev->dev.parent);
180180
status_old = ifcvf_get_status(vf);
181181

182+
if (status_old == status)
183+
return;
184+
182185
if ((status_old & VIRTIO_CONFIG_S_DRIVER_OK) &&
183186
!(status & VIRTIO_CONFIG_S_DRIVER_OK)) {
184187
ifcvf_stop_datapath(adapter);

0 commit comments

Comments
 (0)