From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B798B41E58; Tue, 9 May 2023 04:15:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C2A69410D0; Tue, 9 May 2023 04:15:41 +0200 (CEST) Received: from EX-PRD-EDGE02.vmware.com (EX-PRD-EDGE02.vmware.com [208.91.3.34]) by mails.dpdk.org (Postfix) with ESMTP id 8FB3B40EF0 for ; Tue, 9 May 2023 04:15:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=s1024; d=vmware.com; h=from:to:cc:subject:date:message-id:mime-version:content-type; bh=Gb+P09XYgCIyX9XXvcxl3F2by/+tMYNjosEQqIP8MRw=; b=NjcOq8LR61+Ws9Yx0PKzwwX1Uz93lV7rrwTop/ooAQTgdF09hw7DrEK15/UNNB ooqDTL3GdkDk4Wu6BZXpTGawwJiNIhn5DGO4swdhYY37fo+UpNOut8qoYlokOJ CjDdoncPWQHzAR9DXSUVIRmk589P/mM9YTdquWMqu97jOVk= Received: from sc9-mailhost1.vmware.com (10.113.161.71) by EX-PRD-EDGE02.vmware.com (10.188.245.7) with Microsoft SMTP Server id 15.1.2375.34; Mon, 8 May 2023 19:15:29 -0700 Received: from htb-1n-eng-dhcp122.eng.vmware.com (unknown [10.20.114.216]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 1BD81203A0; Mon, 8 May 2023 19:15:34 -0700 (PDT) Received: by htb-1n-eng-dhcp122.eng.vmware.com (Postfix, from userid 0) id 11FF5AE87A; Mon, 8 May 2023 19:15:34 -0700 (PDT) From: Ronak Doshi To: Jochen Behrens CC: , Ronak Doshi Subject: [PATCH next] net/vmxnet3: add interrupt handling for reset Date: Mon, 8 May 2023 19:15:30 -0700 Message-ID: <20230509021530.24723-1-doshir@vmware.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain Received-SPF: None (EX-PRD-EDGE02.vmware.com: doshir@vmware.com does not designate permitted sender hosts) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 Acked-by: Jochen Behrens --- 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