From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0084.outbound.protection.outlook.com [104.47.1.84]) by dpdk.org (Postfix) with ESMTP id 07CCB1B63A for ; Tue, 26 Dec 2017 10:44:58 +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=ioXEGFM+APDCoUPWgZFTXh46ibYSZ/pqcQYSxDQL1lM=; b=RUzNcoIeWjG/7BxyfkW3OZ5riHZuLODSn/5B+w+0eOOTWQrP3SpOpOTxSZAVpn3WKdDBRWpIDAMQsvdi3g6wLDuPl0OzvPuh2scH354/+Uky8FX1yf+8ys7lyrD6idE155hNn+xn23KPlK3pQ+8RhDc1fTRicubQyINLMDjIHB8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (82.166.227.17) by VI1PR05MB3150.eurprd05.prod.outlook.com (2603:10a6:802:1b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.345.14; Tue, 26 Dec 2017 09:44:56 +0000 From: Shahaf Shuler To: jingjing.wu@intel.com, ferruh.yigit@intel.com Cc: dev@dpdk.org Date: Tue, 26 Dec 2017 11:44:17 +0200 Message-Id: X-Mailer: git-send-email 2.12.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: DB6PR07CA0012.eurprd07.prod.outlook.com (2603:10a6:6:2d::22) To VI1PR05MB3150.eurprd05.prod.outlook.com (2603:10a6:802:1b::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3dda6124-d3b9-4557-53a0-08d54c455338 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(48565401081)(2017052603307)(7153060); SRVR:VI1PR05MB3150; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3150; 3:90pbfxF63qtc9o2HEJqHRrkhM8FVEcsDEoVOkDQRftgdlsSXavhiq208BImqqXsz1ZshPhjfr/4JWcOFCXU4MHR0zYFpyn1F9V0R9IqZT2HOFA9ZFDq6BBn+GABvYy+MCKXwJSDmH3sE/Lj7GnoSHEzBcsJRDHfToYagMQWelyeoRaYsJhhRXkPt7gQXII+MDusNHADZg22RkUjfNfINeCWcByoDakOngxt7vmcjNNhPGN2zxlANvrbOSQk2m0rT; 25:saKA9hJ7vSYUAXkHlXNjasDsew22+HPPkS8zqRU6J0pJa8Kw+rEJWN9AU39dSWECtrZOZziUxAIoQ+nMclaja0yXoGlH0QC/3eqiqbWIDegIS3PJFkHRyWrNoNwL+8/dCRgkirLqhxVPWEns5P29CqmYvqYre8/IRQ7Ens8AT1hpOdiFYx7l2RZ9vMDvFNz0TQQVk44NN9BwUtk9sfY4Z5J34IIdUZN822PUuQccrAavaqiVqGLqOVJyRXuyv1VFg+37Cxpp/KAgVdTaBQDc2oQ1U+JfBzLt3pIrRez6RQogtJk7ccDnVGHvXzMPz0wmh6NjZe5ASTJ8x8CSFEdVow==; 31:n4mfgAs2NqnWiBiL35tv24uAr6ayLjo1THHmvLeBV6C5Ro5/pUMpUbrOHeL/w7mGE/o5c86jgXuNA2FpXDHTSSmlcEyl6FR4QkJH/P94dOH8i/TNMrwlqUdsh2oeCCUIwLRUIfn2CRVfKSHH4RCMDFW/d/DMUINHuzSQsqozQd8GhAy8tJQU+xuUvWeAlfSaIuCw1wtfRZqlvE6P4Eut6qKyNjMmYyIojcP1Kq1ZbII= X-MS-TrafficTypeDiagnostic: VI1PR05MB3150: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3150; 20:RFeZDGtgN2JWF65wO3lW6RBLpxUbQ8oBI2r0r3BvHJQJzSS7EuJBaOvVdpj+MQbd3Yy+6BC0XcuPtN+BIJEyzdUyLhWrhIuteLNShjjbdc9KiNmu2rzUnYPDd0Z2PhCUC7UCo2gar4463jp+nhcQXraAfXKjOgkzIv5goW5BUjC163hK/mkJodtkCWlvWr8NkMkDOj7RL0fN58hIbngpTcnet0MS01cvKSFDOmSsyQWyhDxyov1n13RvNUoKEXehoVpw8iCzVfwPGmaZMrz4JmlXQtWaLHLhNJs1ZA5WAUF082+g/RxCCwYuZrFveIVLJaS4iI+KuDBDyJUk8zEGRQZh26RD1NeY6x8XoGHnbj8r8urP048fR2gWhwfMW77BpauE+70i7dmJsZl26lncRQit2T/Q80wIu+TEKjQeGOlb/avyuCb0FBoOWpU/37dxDBxoIRtlQ6q2zAK5KkOFc5f8Wpae+zWYBDtO569PgUFnzZSd9YLDShz6lIBB9AnH; 4:RmUfNCDQyvRHNYFTdOSYogCkiHTI/2Q9UGEM8YSuN7HrcKpjP9xYk2h9Zn6oHT4Q6Ih0lFJCJo6Y+I2/Ss6Luh2wDq1GcW2ILFSzEWmleVP2CAV8mHrxCoiOnd88B2ZV88LHMeWrbnUUpFPj35RHCSuen8HgkKwsIXy/c0eUxe079Coi4L0kPKGPW3bEePzcVHFpHRmDaR8UvJPFfr56GNgV27638Tms9lKU64cjY7vCrFMqwK2IEbC3E25NxTINiLELL45Z7vkeP01C6AeENw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3231023)(944501075)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041268)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:VI1PR05MB3150; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR05MB3150; X-Forefront-PRVS: 053315510E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(366004)(346002)(39380400002)(376002)(199004)(189003)(33026002)(50226002)(52116002)(51416003)(55016002)(8936002)(76176011)(7696005)(81166006)(36756003)(86362001)(68736007)(3846002)(81156014)(6116002)(386003)(16586007)(316002)(8676002)(50466002)(69596002)(48376002)(53936002)(2906002)(25786009)(2950100002)(6666003)(5660300001)(5890100001)(118296001)(16526018)(21086003)(4326008)(478600001)(97736004)(106356001)(47776003)(305945005)(7736002)(66066001)(105586002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB3150; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; VI1PR05MB3150; 23:cDgEki06QGBWcoxZMtyZCVP7sSiGlQurlNG3Qv+XT?= =?us-ascii?Q?OY4ZuCyUeRn/d0suvTU7k65+WdXqr+j/6CT6kIz8L6aHclQEytjuyN+DIvuf?= =?us-ascii?Q?XWrN4zFVsoQN/qxZfEeXoryRHYnXZV41OhxYpTmdn+/iis1yWJLO1U1v2EV3?= =?us-ascii?Q?acKvDvmJrlfSnDUtQXcKd3EM6Rw6qXnshcYId1zjOU+6eQNGGUc1sdiNTupr?= =?us-ascii?Q?Pfy8aDfX7b3iQKqShpKhfjlgpvAMG/VtCI4QCJww+d8wrVmKMRAK4RbBcCws?= =?us-ascii?Q?7sY7iIuUrAR5zoHMvP1WOSOfp9kjY52AvC8Uj/4m3ysOhBl1ev1wzmdCAbnU?= =?us-ascii?Q?U6C6b+IojKCPuzQ4bAxSQGZiWQcfwl3vNHi89UfU4CVn1DMWStT/Guy6kZ/y?= =?us-ascii?Q?Q/X6JA03p5QxrXnFUUNq+ghbLoEidBFrlpaeb1wT/YA/tM0nj0J9qkVOyS6i?= =?us-ascii?Q?a68F/7zhdPZVc+WdcnKhd7xcFIhbY6f7mmwWsiHCaHCubKFU2xBlW7ZFIodD?=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8ePTUYTe0rRHOBZ+G9FxHUr9lG5xC2BgqzzyCU1W2T2AFxWfJ7hcY41uHOT6G3X7VpeSYoXZdwT1v7c8sF7qd+NAXMUIODMx+grWR4SsYsIEBg=; 5:WCHAMQM0WYKom5TBxna6MS+DTaB/8VdgW/mC/zY16AvLC1VPrs9rbcXSH3eoHCnyE8Vof1s8ZL9zEqd8r/03cQsZaSOwUgDQseI2AtLB+o9ERstsAUVXXLh3I5fOZBoPcs76DOn23rBvkwpAhYDxxe6qURTr8kMFD+trB5L/RYM=; 24:K8LXuJ13mbpWcrCOSsHxOuz3PxHQPYQGffvNMODe51HdM5BONpHUpM7mRz3l/rXZ8x6j8gILrsNfoEt+8HBMhpODtI9Q7mYVAuuJ8b55sGg=; 7:elGk48TRE8xnVwk6C4EELf7blIzcmXP8AUsIDJJIizjxqhhOgCI4Pa46uB9lF+crJ+MD0Qj0QaybM6dI7aegiv1xKz6RF9vuq65HlUbvicKjhEZ/AFZ8kOPsdhApmfUyYITsj6R31PRAPG7eHGd/SImx26yca3crclUZUM0yJGzVNd5gFcVscOxFmYX/JmQwk5kSWpweBoo6TsJDZEEivXjpUO7ESWXN3sr0ljkiWFAE6nS5WrRguB9zfK28/90x SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:44:56.9197 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3dda6124-d3b9-4557-53a0-08d54c455338 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3150 Subject: [dpdk-dev] [PATCH v3 03/10] app/testpmd: support check of single port stop 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, 26 Dec 2017 09:44:59 -0000 This patch adds supports for checking if a single port is stopped. currently there is a function to check only for all ports. Signed-off-by: Shahaf Shuler --- app/test-pmd/testpmd.c | 16 ++++++++++++---- app/test-pmd/testpmd.h | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 6785b095f..77154ef3b 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1394,15 +1394,23 @@ all_ports_started(void) } int +port_is_stopped(portid_t port_id) +{ + struct rte_port *port = &ports[port_id]; + + if ((port->port_status != RTE_PORT_STOPPED) && + (port->slave_flag == 0)) + return 0; + return 1; +} + +int all_ports_stopped(void) { portid_t pi; - struct rte_port *port; RTE_ETH_FOREACH_DEV(pi) { - port = &ports[pi]; - if ((port->port_status != RTE_PORT_STOPPED) && - (port->slave_flag == 0)) + if (!port_is_stopped(pi)) return 0; } diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 1639d27e7..ab74d39ce 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -682,6 +682,7 @@ void reset_port(portid_t pid); void attach_port(char *identifier); void detach_port(portid_t port_id); int all_ports_stopped(void); +int port_is_stopped(portid_t port_id); int port_is_started(portid_t port_id); void pmd_test_exit(void); void fdir_get_infos(portid_t port_id); -- 2.12.0