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 8CF67A0548; Sun, 25 Apr 2021 05:21:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4F2DE40685; Sun, 25 Apr 2021 05:21:34 +0200 (CEST) Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by mails.dpdk.org (Postfix) with ESMTP id 267DA4013F for ; Sun, 25 Apr 2021 05:21:32 +0200 (CEST) Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FSYD26w4bzlZCL for ; Sun, 25 Apr 2021 11:19:30 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Sun, 25 Apr 2021 11:21:25 +0800 To: "Li, Xiaoyun" , "dev@dpdk.org" CC: "Yigit, Ferruh" References: <1619075011-11810-1-git-send-email-humin29@huawei.com> <1619075011-11810-2-git-send-email-humin29@huawei.com> From: "Min Hu (Connor)" Message-ID: <5d72e3de-8d60-678f-f397-2e1e66682e79@huawei.com> Date: Sun, 25 Apr 2021 11:21:25 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH 1/2] app/testpmd: fix integer overflow during get DCB conf 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" ÔÚ 2021/4/25 10:05, Li, Xiaoyun дµÀ: > Hi > >> -----Original Message----- >> From: Min Hu (Connor) >> Sent: Thursday, April 22, 2021 15:04 >> To: dev@dpdk.org >> Cc: Yigit, Ferruh ; Li, Xiaoyun >> Subject: [PATCH 1/2] app/testpmd: fix integer overflow during get DCB conf >> >> From: Chengchang Tang >> >> In C, constant is treated as integer. Therefore, if nb_queque_pools is >> ETH_32_POOLS, the shift here may cause integer overflow. >> >> Fixes: 1a572499beb6 ("app/testpmd: setup DCB forwarding based on traffic >> class") >> Cc: stable@dpdk.org >> >> Signed-off-by: Chengchang Tang >> Signed-off-by: Min Hu (Connor) >> --- >> app/test-pmd/testpmd.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index >> afa2a6b..6784160 100644 >> --- a/app/test-pmd/testpmd.c >> +++ b/app/test-pmd/testpmd.c >> @@ -3640,7 +3640,7 @@ get_eth_dcb_conf(portid_t pid, struct rte_eth_conf >> *eth_conf, >> for (i = 0; i < vmdq_rx_conf->nb_pool_maps; i++) { >> vmdq_rx_conf->pool_map[i].vlan_id = vlan_tags[i]; >> vmdq_rx_conf->pool_map[i].pools = >> - 1 << (i % vmdq_rx_conf->nb_queue_pools); >> + 1ULL << (i % vmdq_rx_conf->nb_queue_pools); > > In get_eth_dcb_conf(), > vmdq_rx_conf->nb_queue_pools = > (num_tcs == ETH_4_TCS ? ETH_32_POOLS : ETH_16_POOLS); > > It will only be 16 or 32. > So I don't think this patch is necessary unless you're going to use the value ETH_64_POOLS. > Agreed, this patch can be abandoned, thanks. >> } >> for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) { >> vmdq_rx_conf->dcb_tc[i] = i % num_tcs; >> -- >> 2.7.4 > > . >