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 DFD2A45D78; Fri, 22 Nov 2024 01:39:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A5CCE4026E; Fri, 22 Nov 2024 01:39:48 +0100 (CET) Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by mails.dpdk.org (Postfix) with ESMTP id 25D8B4026E; Fri, 22 Nov 2024 01:39:46 +0100 (CET) Received: from mail.maildlp.com (unknown [172.19.163.44]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4Xvbm65gWdz1T5ZP; Fri, 22 Nov 2024 08:37:42 +0800 (CST) Received: from kwepemk500009.china.huawei.com (unknown [7.202.194.94]) by mail.maildlp.com (Postfix) with ESMTPS id 5FB2B140156; Fri, 22 Nov 2024 08:39:44 +0800 (CST) Received: from [10.67.121.161] (10.67.121.161) by kwepemk500009.china.huawei.com (7.202.194.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 22 Nov 2024 08:39:43 +0800 Message-ID: <1927f0ea-9da8-45b0-a032-0a98d092817a@huawei.com> Date: Fri, 22 Nov 2024 08:39:43 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 1/9] app/test: do not duplicate loop variable To: Stephen Hemminger , CC: , , Bruce Richardson , Chas Williams , "Min Hu (Connor)" , Pablo de Lara References: <20241114001403.147609-1-stephen@networkplumber.org> <20241121182443.68025-1-stephen@networkplumber.org> <20241121182443.68025-2-stephen@networkplumber.org> Content-Language: en-US From: fengchengwen In-Reply-To: <20241121182443.68025-2-stephen@networkplumber.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.121.161] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemk500009.china.huawei.com (7.202.194.94) 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 Acked-by: Chengwen Feng On 2024/11/22 2:23, Stephen Hemminger wrote: > Do not use same variable for outer and inner loop in bonding test. > Since the loop is just freeing the resulting burst use bulk free. > > Link: https://pvs-studio.com/en/blog/posts/cpp/1179/ > > Fixes: 92073ef961ee ("bond: unit tests") > Cc: declan.doherty@intel.com > Cc: stable@dpdk.org > > Signed-off-by: Stephen Hemminger > Acked-by: Bruce Richardson > --- > app/test/test_link_bonding.c | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-) > > diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c > index 4d54706c21..805613d7dd 100644 > --- a/app/test/test_link_bonding.c > +++ b/app/test/test_link_bonding.c > @@ -2288,12 +2288,7 @@ test_activebackup_rx_burst(void) > } > > /* free mbufs */ > - for (i = 0; i < MAX_PKT_BURST; i++) { > - if (rx_pkt_burst[i] != NULL) { > - rte_pktmbuf_free(rx_pkt_burst[i]); > - rx_pkt_burst[i] = NULL; > - } > - } > + rte_pktmbuf_free_bulk(rx_pkt_burst, burst_size); > > /* reset bonding device stats */ > rte_eth_stats_reset(test_params->bonding_port_id);