From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id E77DA325F for ; Thu, 1 Feb 2018 10:49:45 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A2AF720CCB; Thu, 1 Feb 2018 04:49:45 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Thu, 01 Feb 2018 04:49:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=hCxcsU+qatwYnLHeN 8TeNE6GfWEQqS+SASwRwQy9ScU=; b=tU33W9cB2DIiq+/Dtt4u/hwRpLsKU6agB NhmbSOpdjo6nCQ1i0Yr7jy20FV6YcEcKFlSJDuFRa8kTmw/0CCvykNKE/SqMMJQW O59rulqBDjOTgxwKboZq7MEe8cz3xtInt5Exe3TdGEMJNmrnd2onEefvZeH7EEzq TVBT56/e3XBUA7fty/OGzqlAijJZCfjxbysHBEML2o7HiIyjypFHsgzbPqLNyN9x 1XD4Gf5x+Dxcu0NTvTi2ihTUsxENqRvJA9V1fuk1noCR6YOn26Q0fvAHBPQJioR0 V/HOAtetbX+5m6+N58z40fDdJB6Tp+03gViyiFtRSqKkWhzaH7qJQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=hCxcsU+qatwYnLHeN8TeNE6GfWEQqS+SASwRwQy9ScU=; b=HDiHeUiW MaDyGXuQ9uxIjwrLD9OeJ7Cx1BLHyg2kH7Nku4MwtQOvZBiNuqF+W3wvNSPC1tfX xYOC6hXEzvUYxIRc0cowPvMJKdByFLWHR8YW6vUtQGwJwOnfnvXq9Zp16etKdGfb xCdNeSyCI3+nqh3OzJYiH5WP5S7jvzc0YtoUIiQp1lFs/WDXewZaZLW7rVJO8uOr xcqCYn4UlK2TBjz0AuaNSOsZYpXOBUCaLx7pj2hwPe+aQbCiFBodCOwGnWNNH5QB 0/wR4O26shc2awFUqRXFagwHGqTupfIwMWDgVT++gveeIx2Z+uwJ3PJw9veg/b6d R6FNFXIXwfI2LA== X-ME-Sender: Received: from yliu-mob.mtl.com (unknown [115.150.27.200]) by mail.messagingengine.com (Postfix) with ESMTPA id 74D89240B6; Thu, 1 Feb 2018 04:49:44 -0500 (EST) From: Yuanhan Liu To: Matan Azrad Cc: dpdk stable Date: Thu, 1 Feb 2018 17:47:55 +0800 Message-Id: <1517478479-12417-41-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517478479-12417-1-git-send-email-yliu@fridaylinux.org> References: <1517478479-12417-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'app/testpmd: fix port validation' has been queued to LTS release 17.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Feb 2018 09:49:46 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/03/18. So please shout if anyone has objections. Thanks. --yliu --- >>From 188fa9633efa97223e2cc62d183228f7305b05ef Mon Sep 17 00:00:00 2001 From: Matan Azrad Date: Tue, 30 Jan 2018 14:13:39 +0000 Subject: [PATCH] app/testpmd: fix port validation [ upstream commit 1ae1b8c72d33a1d11ba82178c924ee7df3fd6c9a ] rte_eth_dev_is_valid_port() API validates each valid port from ethdev point of view and may validate ports which should not be used by the application. Testpmd should use only the ports available through the RTE_ETH_FOREACH_DEV iterator. Replace rte_eth_dev_is_valid_port() usage by RTE_ETH_FOREACH_DEV iterator usage for testpmd ports validation. Fixes: 7d89b2610353 ("app/testpmd: use ethdev iterator to list devices") Signed-off-by: Matan Azrad --- app/test-pmd/config.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 8a2d30c..726c737 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -724,11 +724,14 @@ port_offload_cap_display(portid_t port_id) int port_id_is_invalid(portid_t port_id, enum print_warning warning) { + uint16_t pid; + if (port_id == (portid_t)RTE_PORT_ALL) return 0; - if (rte_eth_dev_is_valid_port(port_id)) - return 0; + RTE_ETH_FOREACH_DEV(pid) + if (port_id == pid) + return 0; if (warning == ENABLED_WARN) printf("Invalid port %d\n", port_id); -- 2.7.4