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 40104A0548; Sun, 25 Apr 2021 04:05:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 10F6A40685; Sun, 25 Apr 2021 04:05:30 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 877C24013F for ; Sun, 25 Apr 2021 04:05:28 +0200 (CEST) IronPort-SDR: d430UUCpcc/4kzl84VbYnTCdQwNaaHbNK+/ewU0SbZbT3/v5MlET84qGdPmrqrUgx8vqMAMKr1 F24U2EYol2IQ== X-IronPort-AV: E=McAfee;i="6200,9189,9964"; a="196265602" X-IronPort-AV: E=Sophos;i="5.82,249,1613462400"; d="scan'208";a="196265602" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2021 19:05:27 -0700 IronPort-SDR: RHtVSZNs/IUbkz6RiKuPow+UGdcU8KN+V+AO4hVOjxj0DsnvP9vwqFOwy/csOszH+ILuBd8NZv 6mVaQPrzJ+rg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,249,1613462400"; d="scan'208";a="535875425" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga004.jf.intel.com with ESMTP; 24 Apr 2021 19:05:27 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Sat, 24 Apr 2021 19:05:26 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Sat, 24 Apr 2021 19:05:26 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.172) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Sat, 24 Apr 2021 19:05:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bFAbwcbhA0FbrzF+h2FR9X/Iuac29svIcoMhpB0PV1kHtVbRZSJxXR3p7xsT0ja5CM7O0PO+CA2RS8FeS0Ior/Z085WqYokqsYDZbWN6lHYKyT5kp4H50TiRStInjoKLWu0wYwT7Y+U+sLPvX8zLvYEaONMUT785ZJ5a8PHi5keKdsC6/CHofjcn9TgZlQ3wTPzzmqExOuFfLyZKIr6h6sHI3h+DuHSzwUR/1Xq8jqUT9iHpNP6izSdI5Nwteo1h4/wSE8MJ0cb4EPmOKk8OSfQAWEDDc4ekQwwyPl0/oDX50139mveKTnCTtFSb/weWQUQE1viD9iFnw38uTcCTtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3ISSfw+8k/CzmxGj2U+cjfdySnukFamml/oCJ+8nPTI=; b=NcRUND432+cGOe3cyvQFR5XZpXiN8TMRdmqe2c2AU/1rQczUwuxGaXN7bXdvUNoX+lPjBxiXxbdBqPbjY3m6jiSL5qb/iUpGXRSWMWpdR4wxUL40PJXo7j7cfreG8ZNm/zTcwc0+6yJOsvVez4BGdfpbA9Rv4eo8+zPO3ROrFiBih2xzKPDXX8E0FzLjB4k7BcE57GAIkMry9cf7dN0v0J3EZz4eXHrSJKFxV/LgsukbbfNhj2obQEKdI+hPza4s9Hqz1D4qQwBMHuHnVGxPI6Ol00tnnKZnR1JYm4/K1Fa3kAuk8f3Sp3CeEkq6KTI1glQHMcaNydPxuAc0vrnYuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3ISSfw+8k/CzmxGj2U+cjfdySnukFamml/oCJ+8nPTI=; b=x9xwRIOByHheFiwkhgEeUvdgm90jaOsBZWJ1UlfmLNdXb9nSVPetUOH0chH+jYIaBT/3WBrItILKICC1qm3F3za9ya8kjNliLvRN7erhQLc3+vSLQnlD4BVWKm6dS3mQ47heKe161x1C6jnEVSTtlfVsToMVXuAc4fmxXRWVT+w= Received: from DM4PR11MB5534.namprd11.prod.outlook.com (2603:10b6:5:391::22) by DM6PR11MB4252.namprd11.prod.outlook.com (2603:10b6:5:201::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Sun, 25 Apr 2021 02:05:24 +0000 Received: from DM4PR11MB5534.namprd11.prod.outlook.com ([fe80::9034:15e:7cf3:4b78]) by DM4PR11MB5534.namprd11.prod.outlook.com ([fe80::9034:15e:7cf3:4b78%4]) with mapi id 15.20.4065.025; Sun, 25 Apr 2021 02:05:24 +0000 From: "Li, Xiaoyun" To: "Min Hu (Connor)" , "dev@dpdk.org" CC: "Yigit, Ferruh" Thread-Topic: [PATCH 1/2] app/testpmd: fix integer overflow during get DCB conf Thread-Index: AQHXN0WpPzCEXKyGGkGvv+aKmtJWIqrEf3bQ Date: Sun, 25 Apr 2021 02:05:23 +0000 Message-ID: References: <1619075011-11810-1-git-send-email-humin29@huawei.com> <1619075011-11810-2-git-send-email-humin29@huawei.com> In-Reply-To: <1619075011-11810-2-git-send-email-humin29@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.53] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: aaadf795-330e-4372-1e0b-08d9078e9673 x-ms-traffictypediagnostic: DM6PR11MB4252: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4125; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 0NlhaNJEehDp2v1UnhnNnKmhp5evlqiQ0cum8ST/jHrApOhAaKf8yKjMAj1GkvK/BdGI/We1TrVcB0IpjbmQChSCWYWEYHqndmwxqFPMYb2QxdXMGZdQ9mMYrxAM/2fsUS9uDns+KAJsFgFzMTrO1nx5zGjAQqDobzLgAexGWzJpN7aAaWZNMW3cBhTMXSa78KFPYh3l0jdCUSmF0qiGlbjczM8COQftca9z7xS+evAwe3tCjGe6vz+WCdlbq4nkd94n95oZexGa7Sb2GaeN3D2yg6JD0B7WCw5UuLV+DpWKePvO43JHKoQZUXaL6dcBcxX1dFQALL03jLYXjFaF0v77r6jYn+2KkVLUBAoFi/3bXAh/IzLoDYeNfSuxjq/+U/GBTdYDE07tez4lqofrsjedeZiQIinfZc15JKpQEZJ0JMleX3b4YWMF7CFLmD1oxfd9f3CyH8tUHCKBMwMhkf1/xv61FFiSLHbgkrx3itkIkaX11pbLJN9Gd3G5KgsjduUYJN74W2rgFxtXfh3X0DvNoB44jZANnC4urZa+j4957Ac8RrPsCEuvKposHzDGa+u0lFA9NUBrjhXxSmddZpQyPruPDOG4wikeZMSQjuY= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5534.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(39860400002)(396003)(346002)(136003)(376002)(366004)(66556008)(107886003)(5660300002)(66476007)(66446008)(64756008)(316002)(478600001)(2906002)(66946007)(4326008)(86362001)(76116006)(186003)(38100700002)(71200400001)(55016002)(26005)(122000001)(8676002)(8936002)(6506007)(83380400001)(33656002)(7696005)(52536014)(53546011)(110136005)(9686003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?U8N4yRPIQqhRJihKNLpXrPUCIgwNs9bCbGjwbWcqbqbFSin9wG1/qAMydcU+?= =?us-ascii?Q?SlvPMCj5103zzuZqBgHWAxJQbNps3aKzPD7Z2GGYPWhn+8ausCw3HShQ7hCI?= =?us-ascii?Q?U4YUQ3zc7aZttAm71qK5VdZ5fZ+3YM1rnnupwJIdyphL1Qkw3v8yykIY+AUE?= =?us-ascii?Q?r6dje11b36hFNzeUQ9ga5uGZm283D/8fOb0hiKOEJOmxE75d6bw/z3oFOBAU?= =?us-ascii?Q?KBghKUdRyBuTA1r3vEvHmid1eoSgNPhGMCLc9d0KZEPfesotzkwaU6fqFXL/?= =?us-ascii?Q?0CC57bKyXw+4LEs935cO9M4lDbs0Jp6V4Pppobsh/B73YuVATDPEe5na9yi5?= =?us-ascii?Q?Jv7TevXvW7HpAZTqqkkupdopyCYjcXoIX1vX8ELCLzTxOBeg7BghjEa2wVOg?= =?us-ascii?Q?osorSHExCxoyKRPjqCwG/h8ihbkmtfEqc4pU3Kw6mfiCdHoyEInL7lzyiKbh?= =?us-ascii?Q?u96ohnvHfDg78ig5w818vASKHbb3ptxqhUKSP9YrzvrD64gEMzaM+RctW92c?= =?us-ascii?Q?1eoLhSMUDQwOBh49qGA2KzJaR3ymSPPUl6zx/9Zp4W2knTyaysejWGkumjoG?= =?us-ascii?Q?KXpM9zRC8zbp3PQbewGDL2CaZGzr8mvMxyKyDixKQvDAke5+ujMD0jICS+Vy?= =?us-ascii?Q?f18JqwrVfFprtc5KmDSiDI+mpnhBN8T9ZyTqNJj/9b7AKppIzFvVMr5dYpNZ?= =?us-ascii?Q?lc6R7neq+p2M3UfLKhBjsProVmqDMbMDxJ/chF9eiL4mbt+wQNQDoD4w242P?= =?us-ascii?Q?HSHXThUYgnzxJjktKkWJBLiuAy4qi5KortsvrC6Gd9Iix9MvbQ7DA57KVH+D?= =?us-ascii?Q?74cOM0NCxWbGXKKzHiPQrD8Z0LLhTmLKZBGfvEAXe+MFLjaRzelequVF6kaI?= =?us-ascii?Q?DW4PpA4/YSpN6r12GpYHPIU0DPvm1QKBg28BZ4ldSM2WxOSzZ2o9hFpY6/Rz?= =?us-ascii?Q?gviZ/VCm2QdiCfzGWNXZLk9WiN25RYZB1kzY4qpl8A1a1Q5BA7UtW3hsA3uR?= =?us-ascii?Q?zl2QggCakhnYrNQTZpyZBcJ+P3l7v+rbuSDpkz4TPgbxYnoJdsOodJ+jEc0b?= =?us-ascii?Q?TOZyhVcwbgFmjoUZFSIEPDLRE3hQW/ZNq/TVtOtidsJzK7+L5CmSiBN7cHZp?= =?us-ascii?Q?9GGloIjVx4WlHENrgCEyTSiwVROfi+DmU2Un9foaydNB1+xljDTkiD5Aqp66?= =?us-ascii?Q?q4iqcCKHqRpaiTtbtZj12+17kcyXgs/ajDObs8RXXEJ0STWfB0FfBtUR7LRk?= =?us-ascii?Q?AszQvYAOzPrKhV6nQLb9XhXKRIqWCsvis3AEUg40BOsCA88qmKjQvh1EGFaS?= =?us-ascii?Q?s6GnFKbWwlwy9eO7q/3LddMO?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5534.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: aaadf795-330e-4372-1e0b-08d9078e9673 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Apr 2021 02:05:23.7088 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 39RbM7P1F8G+hVHsI4dnvsmNHtJjxloelNYUE6q1vIRMI7oORxWNTh5Vv6YNw6m6uScqWlQINk9fUI93Tc+C5w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4252 X-OriginatorOrg: intel.com 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" 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 con= f >=20 > From: Chengchang Tang >=20 > In C, constant is treated as integer. Therefore, if nb_queque_pools is > ETH_32_POOLS, the shift here may cause integer overflow. >=20 > Fixes: 1a572499beb6 ("app/testpmd: setup DCB forwarding based on traffic > class") > Cc: stable@dpdk.org >=20 > Signed-off-by: Chengchang Tang > Signed-off-by: Min Hu (Connor) > --- > app/test-pmd/testpmd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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 =3D 0; i < vmdq_rx_conf->nb_pool_maps; i++) { > vmdq_rx_conf->pool_map[i].vlan_id =3D vlan_tags[i]; > vmdq_rx_conf->pool_map[i].pools =3D > - 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 =3D (num_tcs =3D=3D 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 val= ue ETH_64_POOLS. > } > for (i =3D 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) { > vmdq_rx_conf->dcb_tc[i] =3D i % num_tcs; > -- > 2.7.4