DPDK patches and discussions
 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-dev] [PATCH 6/6] net/virtio: fix guest announce support
Date: Mon, 29 Oct 2018 13:28:08 +0800	[thread overview]
Message-ID: <20181029052808.16520-7-tiwei.bie@intel.com> (raw)
In-Reply-To: <20181029052808.16520-1-tiwei.bie@intel.com>

We need to check the status field in virtio net config structure
instead of the bits read from ISR register to know whether we need
to do guest announce.

Fixes: 7365504f77e3 ("net/virtio: support guest announce")
Cc: stable@dpdk.org

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

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 10a7e3fcc..27088e3a6 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1288,6 +1288,7 @@ virtio_interrupt_handler(void *param)
 	struct rte_eth_dev *dev = param;
 	struct virtio_hw *hw = dev->data->dev_private;
 	uint8_t isr;
+	uint16_t status;
 
 	/* Read interrupt status which clears interrupt */
 	isr = vtpci_isr(hw);
@@ -1301,12 +1302,17 @@ virtio_interrupt_handler(void *param)
 			_rte_eth_dev_callback_process(dev,
 						      RTE_ETH_EVENT_INTR_LSC,
 						      NULL);
-	}
 
-	if (isr & VIRTIO_NET_S_ANNOUNCE) {
-		virtio_notify_peers(dev);
-		if (hw->cvq)
-			virtio_ack_link_announce(dev);
+		if (vtpci_with_feature(hw, VIRTIO_NET_F_STATUS)) {
+			vtpci_read_dev_config(hw,
+				offsetof(struct virtio_net_config, status),
+				&status, sizeof(status));
+			if (status & VIRTIO_NET_S_ANNOUNCE) {
+				virtio_notify_peers(dev);
+				if (hw->cvq)
+					virtio_ack_link_announce(dev);
+			}
+		}
 	}
 }
 
-- 
2.19.1

  parent reply	other threads:[~2018-10-29  5:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-29  5:28 [dpdk-dev] [PATCH 0/6] Fixes for virtio/virtio-user Tiwei Bie
2018-10-29  5:28 ` [dpdk-dev] [PATCH 1/6] net/virtio-user: do not stop stopped device again Tiwei Bie
2018-10-30 10:19   ` Maxime Coquelin
2018-10-29  5:28 ` [dpdk-dev] [PATCH 2/6] net/virtio-user: do not make vhost user channel nonblock Tiwei Bie
2018-10-30 10:20   ` Maxime Coquelin
2018-10-29  5:28 ` [dpdk-dev] [PATCH 3/6] net/virtio-user: do not reset owner when driver resets Tiwei Bie
2018-10-30 10:21   ` Maxime Coquelin
2018-10-29  5:28 ` [dpdk-dev] [PATCH 4/6] net/virtio-user: fix device features for server mode Tiwei Bie
2018-10-30 10:25   ` Maxime Coquelin
2018-10-29  5:28 ` [dpdk-dev] [PATCH 5/6] net/virtio-user: simplify device features preparation Tiwei Bie
2018-10-30 10:26   ` Maxime Coquelin
2018-10-29  5:28 ` Tiwei Bie [this message]
2018-10-30 10:30   ` [dpdk-dev] [PATCH 6/6] net/virtio: fix guest announce support Maxime Coquelin
2018-10-30 10:56 ` [dpdk-dev] [PATCH 0/6] Fixes for virtio/virtio-user 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=20181029052808.16520-7-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).