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 DCD3BA0A02; Thu, 14 Jan 2021 14:34:15 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A7A6E141278; Thu, 14 Jan 2021 14:34:02 +0100 (CET) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by mails.dpdk.org (Postfix) with ESMTP id 9639214126E for ; Thu, 14 Jan 2021 14:33:58 +0100 (CET) Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DGlcR1l9Vz15t1r for ; Thu, 14 Jan 2021 21:32:55 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Thu, 14 Jan 2021 21:33:55 +0800 From: Lijun Ou To: CC: Date: Thu, 14 Jan 2021 21:33:36 +0800 Message-ID: <1610631217-14216-8-git-send-email-oulijun@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1610631217-14216-1-git-send-email-oulijun@huawei.com> References: <1610631217-14216-1-git-send-email-oulijun@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH 7/8] net/hns3: fix dump register out of range 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 Sender: "dev" From: Chengchang Tang Currently, when dump the queue interrupt registers, the number of registers that should be dumped is calculated from num_msi. But the value of num_msi includes the number of misc interrupts. So, for some hardware version, like kupeng930, it will lead to an illegal access. This patch replace num_msi with intr_tqps_num which indicate the number of interrupts used by the tqps. Fixes: 936eda25e8da ("net/hns3: support dump register") Cc: stable@dpdk.org Signed-off-by: Chengchang Tang Signed-off-by: Lijun Ou --- drivers/net/hns3/hns3_regs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/hns3/hns3_regs.c b/drivers/net/hns3/hns3_regs.c index 775e096..f2cb465 100644 --- a/drivers/net/hns3/hns3_regs.c +++ b/drivers/net/hns3/hns3_regs.c @@ -300,7 +300,7 @@ hns3_direct_access_regs(struct hns3_hw *hw, uint32_t *data) } reg_num = sizeof(tqp_intr_reg_addrs) / sizeof(uint32_t); - for (j = 0; j < hw->num_msi; j++) { + for (j = 0; j < hw->intr_tqps_num; j++) { reg_offset = HNS3_TQP_INTR_REG_SIZE * j; for (i = 0; i < reg_num; i++) *data++ = hns3_read_dev(hw, tqp_intr_reg_addrs[i] + -- 2.7.4