patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Tiwei Bie <tiwei.bie@intel.com>
To: maxime.coquelin@redhat.com, zhihong.wang@intel.com, dev@dpdk.org
Cc: stable@dpdk.org
Subject: [dpdk-stable] [PATCH 02/10] net/virtio: fix interrupt helper for packed ring
Date: Tue, 19 Mar 2019 14:43:04 +0800	[thread overview]
Message-ID: <20190319064312.13743-3-tiwei.bie@intel.com> (raw)
In-Reply-To: <20190319064312.13743-1-tiwei.bie@intel.com>

When disabling interrupt, the shadow event flags should also be
updated accordingly. The unnecessary wmb is also dropped.

Fixes: e9f4feb7e622 ("net/virtio: add packed virtqueue helpers")
Cc: stable@dpdk.org

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
---
 drivers/net/virtio/virtqueue.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index ca9d8e6e3..24fa873c3 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -321,12 +321,13 @@ vring_desc_init_split(struct vring_desc *dp, uint16_t n)
 static inline void
 virtqueue_disable_intr_packed(struct virtqueue *vq)
 {
-	uint16_t *event_flags = &vq->ring_packed.driver_event->desc_event_flags;
-
-	*event_flags = RING_EVENT_FLAGS_DISABLE;
+	if (vq->event_flags_shadow != RING_EVENT_FLAGS_DISABLE) {
+		vq->event_flags_shadow = RING_EVENT_FLAGS_DISABLE;
+		vq->ring_packed.driver_event->desc_event_flags =
+			vq->event_flags_shadow;
+	}
 }
 
-
 /**
  * Tell the backend not to interrupt us.
  */
@@ -348,7 +349,6 @@ virtqueue_enable_intr_packed(struct virtqueue *vq)
 	uint16_t *event_flags = &vq->ring_packed.driver_event->desc_event_flags;
 
 	if (vq->event_flags_shadow == RING_EVENT_FLAGS_DISABLE) {
-		virtio_wmb(vq->hw->weak_barriers);
 		vq->event_flags_shadow = RING_EVENT_FLAGS_ENABLE;
 		*event_flags = vq->event_flags_shadow;
 	}
-- 
2.17.1


  parent reply	other threads:[~2019-03-19  6:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190319064312.13743-1-tiwei.bie@intel.com>
2019-03-19  6:43 ` [dpdk-stable] [PATCH 01/10] net/virtio: fix typo in packed ring init Tiwei Bie
2019-03-19  8:39   ` [dpdk-stable] [dpdk-dev] " Jens Freimann
2019-03-19 12:46   ` [dpdk-stable] " Maxime Coquelin
2019-03-19  6:43 ` Tiwei Bie [this message]
2019-03-19 12:48   ` [dpdk-stable] [PATCH 02/10] net/virtio: fix interrupt helper for packed ring Maxime Coquelin
2019-03-19  6:43 ` [dpdk-stable] [PATCH 03/10] net/virtio: add missing barrier in interrupt enable Tiwei Bie
2019-03-19 12:49   ` Maxime Coquelin

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=20190319064312.13743-3-tiwei.bie@intel.com \
    --to=tiwei.bie@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.org \
    --cc=zhihong.wang@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).