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 795F642CBC for ; Thu, 15 Jun 2023 03:34:26 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 740BD42D30; Thu, 15 Jun 2023 03:34:26 +0200 (CEST) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mails.dpdk.org (Postfix) with ESMTP id 82C7B42D42 for ; Thu, 15 Jun 2023 03:34:24 +0200 (CEST) Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-3f81b449357so13299615e9.0 for ; Wed, 14 Jun 2023 18:34:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686792864; x=1689384864; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EcMaFJlosk+W09ufydz1TJMDJYe8lFTOKldN8nUtHB0=; b=nZ69urm29Sdh9XFlVSuQ7PdPLf3+I8vmmvkk5++zXfnHo21oQ3k9ST6S6LcCUL3Wj7 nzuBU+KKWJC5o+gfjcXIPPbZuVThlSWVB3WTSgz+Fx2ZSrICPGAikhBtxQ1S3izSa6EG 9qdho8sU98fMI2mwBc5ERlrOQTk6vUHLwrRz4xeUcZ8fNQwy84eJDvGxd3pwOhDRJGJ2 Ak3htd46SG+Q9NqMXJ39fCVzZ99sC9yWn0yMUSsu1vUyIu8t9NPqtYh0kur22Ot8l0Wm 9HqG629t1qX25EVtHmW2upWDdU/FPaorbO8Yd2u4OeErLfCNQ78WAJJpCMRJvGJn0Dhx e6FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686792864; x=1689384864; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EcMaFJlosk+W09ufydz1TJMDJYe8lFTOKldN8nUtHB0=; b=GOqEoV2JKm5DbtUMJ5IV31j3G/++AcTTvyEXeuGi3yr71o53j9u1yXLvnkC5ihMOIM So9tfX+ThE+C/SLLlg93rphMn7JQRBqKjc5J+e1fR8uhzOddZ/Pnq0rWBjkCnuqbtknU Kiuuou9J4JMMRGb2i+ooDdiSx7ar1OBkNvlRd9qPpxBGkDQdFzAl83XBvvpdtHtAOkDX oyzTbE0gTBkw1vvpI0LUQcOZZWspGgCj7J2/gW7FY5M4d8A/O2zb4oS+Q8j56exToqcr Zc7hDzdgOFb1wOGbfRkxUbUL4zH/5PInn0CuqTrknS1354Y7BsIv1a5wp6CnmMfQt/5U ma7w== X-Gm-Message-State: AC+VfDy7lXQvtsKADpeJl3iY3EKtJ4tCqqvQv3gn8tiszJh/RSuMXBgv lfGdc2yT61wmDEthzCq3M68= X-Google-Smtp-Source: ACHHUZ70LGOOXcI1Ih22WXu5ZdNfZCr68137ppOM/qzb8IrxDIQLVv5TvORkyvp0RyQYhrxQQ7g0rg== X-Received: by 2002:a5d:6307:0:b0:311:10db:dad2 with SMTP id i7-20020a5d6307000000b0031110dbdad2mr1220392wru.53.1686792864148; Wed, 14 Jun 2023 18:34:24 -0700 (PDT) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id r17-20020adfda51000000b00307c8d6b4a0sm19652069wrl.26.2023.06.14.18.34.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 18:34:23 -0700 (PDT) From: luca.boccassi@gmail.com To: Dengdui Huang Cc: Dongdong Liu , dpdk stable Subject: patch 'net/hns3: fix variable type mismatch' has been queued to stable release 20.11.9 Date: Thu, 15 Jun 2023 02:32:22 +0100 Message-Id: <20230615013258.1439718-27-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230615013258.1439718-1-luca.boccassi@gmail.com> References: <20230615013258.1439718-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Hi, FYI, your patch has been queued to stable release 20.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/17/23. 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/cb532b2040d32a84c7356766f37d73d0f2c2666a Thanks. Luca Boccassi --- >From cb532b2040d32a84c7356766f37d73d0f2c2666a Mon Sep 17 00:00:00 2001 From: Dengdui Huang Date: Mon, 22 May 2023 21:17:38 +0800 Subject: [PATCH] net/hns3: fix variable type mismatch [ upstream commit 1bbac8785cdf51bc6c5005c6754eab4d517cc4b0 ] Loop conditions are compared with different variable types, which may cause overflow risks. Fixes: 67d010346933 ("net/hns3: adjust data type of some variables") Fixes: 6ee07e3cb589 ("net/hns3: fix insecure way to query MAC statistics") Signed-off-by: Dengdui Huang Signed-off-by: Dongdong Liu --- drivers/net/hns3/hns3_regs.c | 5 +++-- drivers/net/hns3/hns3_stats.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/hns3/hns3_regs.c b/drivers/net/hns3/hns3_regs.c index cbc377adee..91261b1b1f 100644 --- a/drivers/net/hns3/hns3_regs.c +++ b/drivers/net/hns3/hns3_regs.c @@ -270,8 +270,9 @@ hns3_direct_access_regs(struct hns3_hw *hw, uint32_t *data) struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw); uint32_t *origin_data_ptr = data; uint32_t reg_offset; - int reg_num; - int i, j; + size_t reg_num; + uint16_t j; + size_t i; /* fetching per-PF registers values from PF PCIe register space */ reg_num = sizeof(cmdq_reg_addrs) / sizeof(uint32_t); diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c index 16cca25862..7e645361cf 100644 --- a/drivers/net/hns3/hns3_stats.c +++ b/drivers/net/hns3/hns3_stats.c @@ -338,7 +338,7 @@ hns3_update_mac_stats(struct hns3_hw *hw) uint32_t stats_iterms; uint64_t *desc_data; uint32_t desc_num; - uint16_t i; + uint32_t i; int ret; /* The first desc has a 64-bit header, so need to consider it. */ -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-06-15 01:56:36.176557594 +0100 +++ 0027-net-hns3-fix-variable-type-mismatch.patch 2023-06-15 01:56:34.575541478 +0100 @@ -1 +1 @@ -From 1bbac8785cdf51bc6c5005c6754eab4d517cc4b0 Mon Sep 17 00:00:00 2001 +From cb532b2040d32a84c7356766f37d73d0f2c2666a Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 1bbac8785cdf51bc6c5005c6754eab4d517cc4b0 ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -16,2 +17 @@ - .mailmap | 1 + - drivers/net/hns3/hns3_regs.c | 3 ++- + drivers/net/hns3/hns3_regs.c | 5 +++-- @@ -19 +19 @@ - 3 files changed, 4 insertions(+), 2 deletions(-) + 2 files changed, 4 insertions(+), 3 deletions(-) @@ -21,12 +20,0 @@ -diff --git a/.mailmap b/.mailmap -index 863dbecdb0..f00c1e5457 100644 ---- a/.mailmap -+++ b/.mailmap -@@ -301,6 +301,7 @@ Deepak Khandelwal - Deepak Kumar Jain - Deirdre O'Connor - Dekel Peled -+Dengdui Huang - Denis Pryazhennikov - Dennis Marinus - Derek Chickles @@ -34 +22 @@ -index 33392fd1f0..5d6f92e4bb 100644 +index cbc377adee..91261b1b1f 100644 @@ -37 +25 @@ -@@ -294,8 +294,9 @@ hns3_direct_access_regs(struct hns3_hw *hw, uint32_t *data) +@@ -270,8 +270,9 @@ hns3_direct_access_regs(struct hns3_hw *hw, uint32_t *data) @@ -41,2 +29,3 @@ -- uint16_t i, j; - size_t reg_num; +- int reg_num; +- int i, j; ++ size_t reg_num; @@ -49 +38 @@ -index bad65fcbed..c2e692a2c5 100644 +index 16cca25862..7e645361cf 100644 @@ -52 +41 @@ -@@ -317,7 +317,7 @@ hns3_update_mac_stats(struct hns3_hw *hw) +@@ -338,7 +338,7 @@ hns3_update_mac_stats(struct hns3_hw *hw)