From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5EA6EA04DC; Mon, 26 Oct 2020 13:29:34 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EA4482BAF; Mon, 26 Oct 2020 13:29:31 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 7001D2BA3 for ; Mon, 26 Oct 2020 13:29:29 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id F0ED05C0092; Mon, 26 Oct 2020 08:29:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 26 Oct 2020 08:29:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= CFmhs+EkFsD1OFI6NHzBVdDWJNOTzMs45TCWiUDxMWU=; b=MSVbBG1QJfbF5i2r +L/RY6pIjVGsq8gwpvZmZNlYOH0wvBjBOhFW6tPKlbG4c82e5hK517P7Cq/Kzu02 4L77B1SYo4OlYE/WetoJyfqs9+xZvSQoV5SUeC0WBCsX4NmCso8rwI/x0NTiQW43 XU2Al56NFPqyF/w+qD7gu0AyDsXa9MXQE7VHtNgzTDmMLN6wRv4vOJixU7ImPP03 +Tx5hNbacPiVrUpf+yt9n/m8p2TP1Q7jTfOwAfPaUuJMYgHVxgxfGH+euD2vdkAK sIIv4nD65uqoraB/LY3f3eUnTT/V5PnmR7zPp9SjDc7R8t+pgSeemJR4U4nHyou8 8K/EXg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=CFmhs+EkFsD1OFI6NHzBVdDWJNOTzMs45TCWiUDxM WU=; b=EoLDhTyvNIQAYUiWvdxHc+6Uz08MyK114CxcDg+p/KO5StBRwYhHNIdqE BEsu78u/uwSjGjk8RdiyY5enYKdiT31iicrJ8gCv8XlRWjyRugkdg4dF4A2O+gQa FE7+wPJgK+f8Xq559cw7ObVmbeG+Be2k2rliyaU/Uhs6COhhQPP4U3KdPnjZWD3o 8alKMIJN63b+AuCbjsWYlrPM3Loa/DtWRT6tFLUkhR8TifS5qRbukueBWzyQRDfy f4iGhChpmuP9flt526Z6ZXUQ4LnNVE/a27fql65hi9v5moJDw917SZw5fCeEnyhA H89pPuRqgTmTvmBRWZD8ciw8ss8uw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrkeejgddtfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei iedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 0D7123280063; Mon, 26 Oct 2020 08:29:24 -0400 (EDT) From: Thomas Monjalon To: Yunjian Wang Cc: dev@dpdk.org, ferruh.yigit@intel.com, andrew.rybchenko@oktetlabs.ru, jerry.lilijun@huawei.com, xudingke@huawei.com, matan@nvidia.com Date: Mon, 26 Oct 2020 13:29:24 +0100 Message-ID: <2394739.RyDTFpqa36@thomas> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] ethdev: fix data type for port id X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" 26/10/2020 13:24, wangyunjian: > From: Yunjian Wang > > The ethdev port id should be 16 bits now. This patch fixes the data > type of the variable for 'pid', changing from uint32_t to uint16_t. > > Fixes: 5b7ba31148a8 ("ethdev: add port ownership") It was 32-bit on purpose, to avoid overflow in this loop: for (pid = 0; pid < RTE_MAX_ETHPORTS; pid++) It is now replaced by RTE_ETH_FOREACH_VALID_DEV, but I wonder whether we still have this theoritical overflow risk. If yes, we should change more variables to 32-bit.