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 03/10] net/virtio: add missing barrier in interrupt enable
Date: Tue, 19 Mar 2019 14:43:05 +0800	[thread overview]
Message-ID: <20190319064312.13743-4-tiwei.bie@intel.com> (raw)
In-Reply-To: <20190319064312.13743-1-tiwei.bie@intel.com>

Typically, after enabling Rx interrupt, a check should be done
to make sure that there is no new incoming packets before going
to sleep. So a barrier is needed to make sure that any following
check won't happen before the interrupt is actually enabled.

Fixes: c056be239db5 ("net/virtio: add Rx interrupt enable/disable functions")
Cc: stable@dpdk.org

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
---
 drivers/net/virtio/virtio_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 78ba7bd29..ff16fb63e 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -850,10 +850,12 @@ virtio_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
 static int
 virtio_dev_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)
 {
+	struct virtio_hw *hw = dev->data->dev_private;
 	struct virtnet_rx *rxvq = dev->data->rx_queues[queue_id];
 	struct virtqueue *vq = rxvq->vq;
 
 	virtqueue_enable_intr(vq);
+	virtio_mb(hw->weak_barriers);
 	return 0;
 }
 
-- 
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 ` [dpdk-stable] [PATCH 02/10] net/virtio: fix interrupt helper for packed ring Tiwei Bie
2019-03-19 12:48   ` Maxime Coquelin
2019-03-19  6:43 ` Tiwei Bie [this message]
2019-03-19 12:49   ` [dpdk-stable] [PATCH 03/10] net/virtio: add missing barrier in interrupt enable 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-4-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).