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 B6815A0524 for ; Fri, 5 Feb 2021 12:34:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A96CF40682; Fri, 5 Feb 2021 12:34:21 +0100 (CET) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mails.dpdk.org (Postfix) with ESMTP id D801840682 for ; Fri, 5 Feb 2021 12:34:19 +0100 (CET) Received: by mail-wm1-f44.google.com with SMTP id i9so5653663wmq.1 for ; Fri, 05 Feb 2021 03:34:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mHIWmXFR/PjHatMPYkTu291HLAi4L/whnpe3DsMA2S4=; b=cknu8bawwU+LxPMZHGy9sHdP5TUxu3YjZTEK4O3oOJ3AuosrEDIfsnuxfFRwZ5nY8+ ANRY2tDDCSmsymP//KeG5iMB6PVcTt/CDi22Cyak9htgQiPdowYNvyMOIKJCHPZ85KPd KwtQao4GvrLDuRG6q5hIMEFa2H2A80wDVlH676xlFMNVa7O4c4+c8rJHLofj/e5GmOLh 69LQohaIszhH7sdLeIcIyhEadCaCy955gk4qpM64+Hz4ocptdqnSryNCXNFymBUEH21u TmqRzeSdGCbR+/vAkU44gk9bmdQ51j13zGImKw7Eb7AEQ6qT2XYv9a7o6dGNhzdL6lYP omJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mHIWmXFR/PjHatMPYkTu291HLAi4L/whnpe3DsMA2S4=; b=qaIGk0EIJ8t1MX2JVBVGPZk47HeVNhQfxYigXEFq2tV8wNf13EZ/O1/JQgbuLFsoFL Lfld3B1qbcODuZD2s0J94Z4JNwz9uML1tUeJVN8GaB+5+RWs1/7YLPOpcobbkcDAkKva mOT6gVPzmoR2GTgMoo/NP95q1ox1UrkTpNYFatTAB0uvG/pMwqocrPFu3Mnw+6dpYjjQ +8vjNPhgScpzrGsbpset6U23NQfrw8t1do1VXNPNA/hjhHHF3KBAXV8kpdv9ZLkYuDDU +XrTiVYW5VGcNbQhmRfKA0oDT3pFGcrEFSrknfjLGvI8nbDVCOq4R+BCnvV8gjUY8MWA GUxA== X-Gm-Message-State: AOAM5326cfDlO/wpeWOLPbvoGcqMfHQByDSLqLD1m/ED85paD6NFoVbu MWxcj0Z53E88G/hxZcXGo5skgbAPWM6qx+an X-Google-Smtp-Source: ABdhPJztYObaRTUxjjJ/dmzdhFntvwR1sfHOf4Y7tsdUeJZlOZtc88/XyWivTh/W5sce5OBH+/pIBQ== X-Received: by 2002:a1c:3286:: with SMTP id y128mr3207366wmy.104.1612524859689; Fri, 05 Feb 2021 03:34:19 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id b13sm11516534wrt.31.2021.02.05.03.34.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:34:19 -0800 (PST) From: luca.boccassi@gmail.com To: Chengchang Tang Cc: Lijun Ou , dpdk stable Date: Fri, 5 Feb 2021 11:17:37 +0000 Message-Id: <20210205111920.1272063-171-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205111920.1272063-1-luca.boccassi@gmail.com> References: <20210205111920.1272063-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/hns3: fix register length when dumping registers' has been queued to stable release 20.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/07/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/3878bb2da912ef247cddbe4f72735961d4dec8b3 Thanks. Luca Boccassi --- >From 3878bb2da912ef247cddbe4f72735961d4dec8b3 Mon Sep 17 00:00:00 2001 From: Chengchang Tang Date: Thu, 14 Jan 2021 21:33:34 +0800 Subject: [PATCH] net/hns3: fix register length when dumping registers [ upstream commit 2d0467532b1a2c10739a89ead3bd03042486b1de ] Currently, the reg length return by HNS3 is the total length of all the registers. But for upper layer user, the total register length is the length multiplied by width. This can lead to a waste of memory and print some invalid information. This patch corrects the length and width of the register. Fixes: 936eda25e8da ("net/hns3: support dump register") Signed-off-by: Chengchang Tang Signed-off-by: Lijun Ou --- drivers/net/hns3/hns3_regs.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/hns3/hns3_regs.c b/drivers/net/hns3/hns3_regs.c index b2cc599f12..32597fe21c 100644 --- a/drivers/net/hns3/hns3_regs.c +++ b/drivers/net/hns3/hns3_regs.c @@ -104,6 +104,7 @@ hns3_get_regs_length(struct hns3_hw *hw, uint32_t *length) struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw); uint32_t cmdq_lines, common_lines, ring_lines, tqp_intr_lines; uint32_t regs_num_32_bit, regs_num_64_bit; + uint32_t dfx_reg_lines; uint32_t len; int ret; @@ -117,7 +118,7 @@ hns3_get_regs_length(struct hns3_hw *hw, uint32_t *length) tqp_intr_lines = sizeof(tqp_intr_reg_addrs) / REG_LEN_PER_LINE + 1; len = (cmdq_lines + common_lines + ring_lines * hw->tqps_num + - tqp_intr_lines * hw->num_msi) * REG_LEN_PER_LINE; + tqp_intr_lines * hw->num_msi) * REG_NUM_PER_LINE; if (!hns->is_vf) { ret = hns3_get_regs_num(hw, ®s_num_32_bit, ®s_num_64_bit); @@ -126,8 +127,11 @@ hns3_get_regs_length(struct hns3_hw *hw, uint32_t *length) ret); return -ENOTSUP; } - len += regs_num_32_bit * sizeof(uint32_t) + - regs_num_64_bit * sizeof(uint64_t); + dfx_reg_lines = regs_num_32_bit * sizeof(uint32_t) / + REG_LEN_PER_LINE + 1; + dfx_reg_lines += regs_num_64_bit * sizeof(uint64_t) / + REG_LEN_PER_LINE + 1; + len += dfx_reg_lines * REG_NUM_PER_LINE; } *length = len; -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:36.911128824 +0000 +++ 0171-net-hns3-fix-register-length-when-dumping-registers.patch 2021-02-05 11:18:29.126697205 +0000 @@ -1 +1 @@ -From 2d0467532b1a2c10739a89ead3bd03042486b1de Mon Sep 17 00:00:00 2001 +From 3878bb2da912ef247cddbe4f72735961d4dec8b3 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 2d0467532b1a2c10739a89ead3bd03042486b1de ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org