From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0051.outbound.protection.outlook.com [104.47.1.51]) by dpdk.org (Postfix) with ESMTP id A2D2F1B31B; Tue, 30 Jan 2018 15:14:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=OyT+VHz53Ln2I5lJHWCS3YozxxgWMOlt1pj6dFQG++M=; b=EkFPPDikCUgd5QzsOFEp+uKmPT5lZRdz98CRMNi9eJzf+t0XW502+bxIOcFzIqorO7fUTXrCC5XxV7AR9iIQmfnYpzyhlUPIEiAw9zUhA6qb9E4h4jNQt2bPTZ6gEMj6WyKK67FCcb+HiAG7p2xlZV6fr6xGRHEJ1FElVrAXmto= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by HE1PR0501MB2666.eurprd05.prod.outlook.com (2603:10a6:3:cb::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Tue, 30 Jan 2018 14:14:06 +0000 From: Matan Azrad To: Wenzhuo Lu Cc: dev@dpdk.org, stable@dpdk.org Date: Tue, 30 Jan 2018 14:13:39 +0000 Message-Id: <1517321620-14198-1-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: AM6PR0402CA0022.eurprd04.prod.outlook.com (2603:10a6:209::35) To HE1PR0501MB2666.eurprd05.prod.outlook.com (2603:10a6:3:cb::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 250121cd-d1e2-483e-b07d-08d567ebba22 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:HE1PR0501MB2666; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2666; 3:g4Ji36Ys+D4YZ+b6XMyV/6rXOxXZBsE44e05s6fzVj7hAw8VD4Y331TA1jXG8ZyatfbFvkzMhbCIyVHWQ9EkpFg5Gr9NtbilE/7Uxu9ewzh1wKSQWTA5vTcVn9cRB5a8SamqWQURWOJ1A1HiEbpBlD0jN8KKHPnIBW8RWs+6yOAgFByGjBnZwTQgtoPFt/u2BPNV7vMp/ZjVS/EerAgpy/hY9VBnGjZAk8GmMHKEBLJfr88OZJxPfTy3nBRiInIr; 25:IdhzrNlahaX7u6abA7BM3F+nMWTOGKkUyBjqB6sre85xnmGsRSmZ6oUv6ZMDe1ff/6vv4SypWM/7lfFmAsxiwq7TAjeks9N1BqMy9tF4d0wg+5h6FSChUMIYjyHRSTPmXxlhCchqY12JHBohQ1RS0KN+80H4ZHPDKdV/y8stuFY/AD6/eggfFfzS5pcO7MP7C3FQdkhaiO8y4QP4mtoTkMGZcmDerGtzAGayTRFf92P3IohuOBlkrwjhEjVE8pQrWP0e9eZarNoDHMlDMFDMIsioS26uy74/8oOpDY0bsaS0zICHmKQp6WJS7cf0ahwKsYurMUo+ctTCyvJvoarxaA==; 31:8cZ3SiHsSEZ1id7+CU0bTlhe1DZ2bykF7aFTLHi5RRMAkvR5MFQu5tApAcNj5N3z/UJbAkA00QxHOSGEXgYqAPpKiwGdP0MIU+kec/BgMm5CGczesWv/BH84caKLWl8eXHGJKXSxNAnHJPUtNAPLrY4yQIZT/HOdEVZkHyHyX9vemoTA9Zh2ois6+chaKatJxPt+pd87TTacxnlsh+Ll+Un9FAoNDqoKgqoX9bZX4ro= X-MS-TrafficTypeDiagnostic: HE1PR0501MB2666: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2666; 20:ER3EZKRE2qZNM9jBNRXSipAnyeFCJAgPTISHG/1aZENoTqZ4SV39iW8MAdqUvZHaqDvVE7MUJ300yWvDa00FmMZH8Y1sI4S7hapxB2zCt5oLQf3CuhmKMLVu5JKQeWYHkTIqx7LSI+s4GFkXH2L5dYHgwGKVYqRIOvruh+NcPmMnpxkKNt5pIBBt7cGakxvJk3NOVMJKl3QYZWjV21AdErxLy3mdJBJ2j8SjRrq0I0YPEpDIg69RSsAKimmD1LNvyon2h6KoFhLb1CuIBLlcRcLoCfmSRN4E45OPk6pF6/GZ5AnVqKTbO175MmgbTchNKNw9/LjgINOUsOf+YTbx3gObQmEukiAxK3ESdAjXbnrwwxXacKO+NkoYglUkc7IxV2QNpKPNG+2xSL/GTsRSYmDrgTe0caweI0h43Bo5AFZBuZcpg9DwqvMngHRHVI9xt2YxFrfiilQk050hriuDBl0E5Q9hqipoC+jXJtNmGZNDrHYc5t/zju2OS3rxBBGC; 4:On7UcF5MzJbvDMtpu91mzJrN5DlKQzSLTU67xTlPFIbI/Q/TjGvvI+3pSet0YJowfHRNWB5IS6c5q//V9EUAj52NUeVzaRZ+fklxVWBIAqiqUlGAt4Zk1RhNPiWDNbFzoPmFGZalejPkzWrOFmQSlpr1Kkmj88E5i7gZvBAJ4wg7O4FlxKjYK4/KHDOn9HGhV/YczJ3UR6wKFfLp21ao//GBrDJ82yxwIk/0FyrnHGPwE2Kl9X9tF/tdq7tsLdTXHqewWjett3PhaVjnkqlfJChvVBIFG0KZ2H/1FX63ahY7Q2AB22MOQV/ROq3IjvmO X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231101)(944501161)(10201501046)(3002001)(6055026)(6041288)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(6072148)(201708071742011); SRVR:HE1PR0501MB2666; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0501MB2666; X-Forefront-PRVS: 0568F32D91 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(346002)(376002)(39380400002)(396003)(189003)(199004)(6666003)(16526019)(106356001)(186003)(25786009)(4326008)(316002)(81156014)(47776003)(16586007)(97736004)(8936002)(26005)(50226002)(68736007)(86362001)(21086003)(478600001)(105586002)(81166006)(386003)(51416003)(53936002)(305945005)(7736002)(6916009)(4720700003)(66066001)(59450400001)(5660300001)(52116002)(7696005)(36756003)(8676002)(6116002)(33026002)(3846002)(55016002)(48376002)(69596002)(2906002)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0501MB2666; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0501MB2666; 23:WS+YLk55Q4PkdWmGuk88hNxrVbnPayzex4gfZcq?= =?us-ascii?Q?df3czriYkiwHi+HmO3C2dM1ycrXkf8kUJEDFKYQ7IlahwpjIm5Qj1iin4F0l?= =?us-ascii?Q?G95AS09WwcGT+7v/mBckM+5ymKbB4toGqGnn8BgEP6EhBeOWEtjT7ZuKwOVA?= =?us-ascii?Q?CoiJ0H+CTWwuZ5yqnDcW6a06InHKSRRrnBM9CfHc95LAs9wP55MTulQyHcXZ?= =?us-ascii?Q?NLF6yJeUyk0GAdiZLa5HeswaY4imcMK83BD+txKjzvvtxLYrZkUr2bxys8Yb?= =?us-ascii?Q?b1zaX2J7r78rq1Akin7QVuXdldBEBh2AHfg+YUvzg404jWuxYNEO1XpmTQs8?= =?us-ascii?Q?g9XHMEkAArFkPlX+PhFRW0hptIbJmnGzTpUpdty+ko6pu1GShRxBOWeJzy5N?= =?us-ascii?Q?Uxcdl+TGjBBWfzgYdjObDdnTGOQwxJpNALcl2jz5Gvwy7U7yJkQlo9ETafhA?= =?us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8LeqfGOvfdJe/AEJtZuJEH+53V7+EV0tAzy768SRE2iu7hdzzv3GxAOCilxqKOB8/vrP3HQrBM9xbrIMiXJ1Y2Vj76bva4cclVT4CivcWBWKjUan9fD+MW2uTSADmnF0VMMOxHpFXH1u6RUWviPnZxuUy3MOMsR/QICUovF0lwm8qNvmf3n1iaEVfWB1is3Vc79wKqcwdQbQrR5X7jMmVBXZ/W56rGLeQ=; 5:QEqy/fH7vp1WHB5gndGD1WwHD3mCiAOGDrEn3X9+wtLyft1JXdpf6sTbFRC4QV6sLBpZ4MidbOX/rZB+mxhC0QsOcx+8UKWnFV5iIi/8r2XEDnGddxAb2PgLu+hwjE4n07v+M2ynbkFwRy+ggg4/UynnIKnQSz3IeUYbdUqXmIg=; 24:HHJMhOwp7CVgUADED34fIkC8E6zP6N8E+1nvh/0jbYD45TnsvkLrJyhhGyeoCZL87PEvyLWyYXMoZyTTwbWVYpiOuut+AEWsw1+09E7r3V8=; 7:gdunzsmisU9ZtOZvKLSSo/g0JvJb9bDDbTtScXZj+J/WRdHKVtOd1DIUbjgbqhCN9FsbBNWfacbdx5JZIEAeVH8lCanoAhRt8cZbnuH5OlnXXifVAj1r8rS/CzsgCi6ITlBErqOWyN7NPNi9LL94UeuBNI/HM/8WO3DltszT9Gsps0LTbxL8STRqkyw4Iy340C2ATibWOQpT0ul1+IVneEKcBgdSfumYVwRqvVAXqCN6BQDYmAdAw91UMO2unqMe SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2018 14:14:06.9823 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 250121cd-d1e2-483e-b07d-08d567ebba22 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0501MB2666 Subject: [dpdk-dev] [PATCH 1/2] app/testpmd: fix port validation 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: , X-List-Received-Date: Tue, 30 Jan 2018 14:14:10 -0000 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") Cc: stable@dpdk.org 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 957b820..8c920a2 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -756,11 +756,14 @@ struct rss_type_info { 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); -- 1.8.3.1