DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ronak Doshi <doshir@vmware.com>
To: Jochen Behrens <jbehrens@vmware.com>
Cc: <dev@dpdk.org>, Ronak Doshi <doshir@vmware.com>
Subject: [PATCH next] net/vmxnet3: add interrupt handling for reset
Date: Mon, 8 May 2023 19:15:30 -0700	[thread overview]
Message-ID: <20230509021530.24723-1-doshir@vmware.com> (raw)

vmxnet3 should call the reset callback when a queue is stopped
by the host. This patch also fixes a logging issue. Currently,
status of only first queue is checked and logged. But status
of all queues should be checked.

Signed-off-by: Ronak Doshi <doshir@vmware.com>
Acked-by: Jochen Behrens <jbehrens@vmware.com>
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 41073e9798..76e80e3025 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -1833,6 +1833,7 @@ vmxnet3_process_events(struct rte_eth_dev *dev)
 {
 	struct vmxnet3_hw *hw = dev->data->dev_private;
 	uint32_t events = hw->shared->ecr;
+	int i;
 
 	if (!events)
 		return;
@@ -1857,16 +1858,28 @@ vmxnet3_process_events(struct rte_eth_dev *dev)
 		VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD,
 				       VMXNET3_CMD_GET_QUEUE_STATUS);
 
-		if (hw->tqd_start->status.stopped)
-			PMD_DRV_LOG(ERR, "tq error 0x%x",
-				    hw->tqd_start->status.error);
+		PMD_DRV_LOG(ERR, "queue error event 0x%x for "
+			    RTE_ETHER_ADDR_PRT_FMT, events,
+			    hw->perm_addr[0], hw->perm_addr[1],
+			    hw->perm_addr[2], hw->perm_addr[3],
+			    hw->perm_addr[4], hw->perm_addr[5]);
 
-		if (hw->rqd_start->status.stopped)
-			PMD_DRV_LOG(ERR, "rq error 0x%x",
-				     hw->rqd_start->status.error);
+		for (i = 0; i < hw->num_tx_queues; i++) {
+			if (hw->tqd_start[i].status.stopped)
+				PMD_DRV_LOG(ERR, "tq %d error 0x%x",
+					    i, hw->tqd_start[i].status.error);
+		}
+		for (i = 0; i < hw->num_rx_queues; i++) {
+			if (hw->rqd_start[i].status.stopped)
+				PMD_DRV_LOG(ERR, "rq %d error 0x%x",
+					    i, hw->rqd_start[i].status.error);
+		}
 
-		/* Reset the device */
 		/* Have to reset the device */
+		/* Notify the application so that it can reset the device */
+		rte_eth_dev_callback_process(dev,
+					     RTE_ETH_EVENT_INTR_RESET,
+					     NULL);
 	}
 
 	if (events & VMXNET3_ECR_DIC)
-- 
2.11.0


             reply	other threads:[~2023-05-09  2:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09  2:15 Ronak Doshi [this message]
2023-05-18 16:47 ` Ferruh Yigit

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=20230509021530.24723-1-doshir@vmware.com \
    --to=doshir@vmware.com \
    --cc=dev@dpdk.org \
    --cc=jbehrens@vmware.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).