All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhu Lingshan <lingshan.zhu@intel.com>
To: mst@redhat.com, kvm@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	jasowang@redhat.com
Cc: lulu@redhat.com, dan.daly@intel.com, cunming.liang@intel.com,
	Zhu Lingshan <lingshan.zhu@intel.com>
Subject: [PATCH RESEND 2/5] ifcvf: ignore continuous setting same staus value
Date: Fri,  5 Jun 2020 18:27:12 +0800	[thread overview]
Message-ID: <1591352835-22441-3-git-send-email-lingshan.zhu@intel.com> (raw)
In-Reply-To: <1591352835-22441-1-git-send-email-lingshan.zhu@intel.com>

User space may try to set status of same value for multiple times,
this patch can handle this case more efficiently by ignoring the
same value of status settings.

Signed-off-by: Zhu Lingshan <lingshan.zhu@intel.com>
---
 drivers/vdpa/ifcvf/ifcvf_main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c
index d529ed6..63a6366 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);
-- 
1.8.3.1


  parent reply	other threads:[~2020-06-05 10:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-05 10:27 [PATCH RESEND 0/5] vDPA:config interrupt support and IRQ improvements Zhu Lingshan
2020-06-05 10:27 ` [PATCH RESEND 1/5] ifcvf: move IRQ request/free to status change handlers Zhu Lingshan
2020-06-05 10:27 ` Zhu Lingshan [this message]
2020-06-05 10:27 ` [PATCH RESEND 3/5] vhost_vdpa: Support config interrupt in vdpa Zhu Lingshan
2020-06-05 10:27 ` [PATCH RESEND 4/5] vhost: replace -1 with VHOST_FILE_UNBIND in iotcls Zhu Lingshan
2020-06-05 10:27 ` [PATCH RESEND 5/5] ifcvf: implement config interrupt in IFCVF Zhu Lingshan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1591352835-22441-3-git-send-email-lingshan.zhu@intel.com \
    --to=lingshan.zhu@intel.com \
    --cc=cunming.liang@intel.com \
    --cc=dan.daly@intel.com \
    --cc=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lulu@redhat.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.