From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0059.outbound.protection.outlook.com [104.47.0.59]) by dpdk.org (Postfix) with ESMTP id CF3121D8E for ; Tue, 12 Dec 2017 13:53:40 +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=NpW5OACAm+hAIdCuV6WsQVU/ulBSXCPRhZCLYWRGw1M=; b=V2QZikqPLmSTqjYC6gMuQjpHLiC2Ho+n2+bMAZIG9k6Dq12iaI8uOGJcDTy3Me9L3SpnviQO6neSSbeDVYz4EWv/O/4XRgXHC53SJ3cGGht0PVXtrKQzEP9FjIsijQZ46yPI/uHdkrNlIMVJCMZA5GKVMls18WnsMA6xpCv8LVA= 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.302.9; Tue, 12 Dec 2017 12:53:35 +0000 From: Shahaf Shuler To: ferruh.yigit@intel.com, jingjing.wu@intel.com Cc: dev@dpdk.org Date: Tue, 12 Dec 2017 14:52:47 +0200 Message-Id: X-Mailer: git-send-email 2.12.0 In-Reply-To: References: <20171123120804.143897-1-shahafs@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: DB6PR1001CA0037.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:55::23) To VI1PR05MB3150.eurprd05.prod.outlook.com (2603:10a6:802:1b::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4c520648-79a6-413f-d003-08d5415f5c14 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603307); SRVR:VI1PR05MB3150; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3150; 3:+oKY+RHJMyBy+ztqzwPts7ouEiLa2SkoAJSifHB2DwIyRuRhazyZRMoDzi3jx78C547Z8TmSb8AzGGZE69Fk5Ya9m/BzScI5diVjzEgkcsWRaWHpQwhfQiD/BXIa2Mhj70pOOXC1gTtu50KykDubBVBVQ87X6Qj3nrkGTiYgUW7vmAaAaQlFHargi07kHDn20J5+pTZl2zXjhinW4MafUtGF5Ag66BkTnPnM6iqXSpd4t9Qa+qHaNGiZ4aQEaB8M; 25:OFwJ+BF6qJZnovnEOowI+55PwUKx7nW7Y2asOAoOonBMyBvUhmq6+qFv9r6CqdeTr3OZ5jBJKSezlPyBWVuqpCB9jCQ9jf+IoW/UA0G1y/3CKt8KKbvL+eIOU7anEdgyoBoAU6xHybQ6bO1xC+7dn5x50Wwfs8kfOwdEyMxLDB2jgODJAz4OHYNQ14m7/GzTp1FkwMeUAnHuhGvvYELZs2gBIoukWmBGLBA/qQiZe0VojclHrQwJt8D/Mw7iXiiuR0ZgrHHnz/06YcG2daXS2pL8CAMAfZl7xMZ/Se5285yJgAM3+I3nzOwb1r8FGXuSWlWmkdy1w8SXea8/sH5MrQ==; 31:29YB+BEiSMlg7MP57TK5vfXzk+jECFaUQwRNXnwVZq7lxKajgSmRhHBSIUS8i/F9I0jjtZuLhOHheOlk6J9zvk94PXgTV0/F7jqQ1qCyrmizFzfoymCACIExyFMmOVP6lU89/rEbjZFyodZB0fFbcnu8CRsmJUm1D6PsiAf9p37CO9224aEkvkDU2Yjf6wG729MI/kPsIq352uuaGXv17JVDY33MXosZgSxcivCJCsg= X-MS-TrafficTypeDiagnostic: VI1PR05MB3150: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3150; 20:ifrH7SSamqrgQ8jKksweAN0agfEaSLwAY+6m4NJNYd1EInuW1+M31McNMxvun/LK4m8TqLB2ouoza67Sl9WTUm84yPVWik23k6PRB/bPs5eMeXK11uzRr5/YNJS8dB/T0hC/fNJDOZTlCCCw/FVD2C1/TBnxIdxOqQ+/TdbuvWQ0dMAFm7jHjDFpBO+dyWUx4G+xH8oesKpIAQiedF5ElWUE2itstcH4+OsHpo6VHytnXKUzkXTqvF0d9B1/yrF/bLhIAQnk0S0utSfrNfIyWLuRNcCh96ANjHIUjxxjdjq0tbijuF8jvKvtAs+9/W4Bld71WI5+7Ga6Kbya2PwYHbbYp9fq1l4shHeIr7J7XxDWt7dTl4hC91Dvkjgf8jwIv1Ld7ArN7F8dIAkwOh9NOcSnG1u/Dz5rWK9o8vYD8uWeDKICKF+4hAmPYXDOaEX8gVzkghv5xCMhT60xwqQMuM6RatAF7U/UeBlHCOeLIhePgaQxveo2K8lL6b3+hdXy; 4:TzvkW9cIK52SfbQEyUJYU2v8p+KRAuxklzrsUJzzu5aLnLeMM7riKdogiNXzSydisCy/Rpo3WEm8MMCXyyllUQihNt7jDcIckCKXYswu2Oyt7CwuHKyH3RgKKb4fNpnB44n2nz05xAFJU5NliedTu8psK/RKikOyFKYh6SKV7qgDwE7+e8lGGY2FB6p+Vmn5g1P3qSbvXbQiqcWDwHd1C8dtFZIsG/0Oijenv6Xpxuw18eXdU29zlj7CGOkSoPE7p4oNWUJ8gS/cIweLcIKB3A== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231023)(6055026)(6041248)(20161123564025)(20161123558100)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011); SRVR:VI1PR05MB3150; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR05MB3150; X-Forefront-PRVS: 051900244E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(346002)(376002)(199004)(189003)(55016002)(81166006)(106356001)(7736002)(81156014)(47776003)(8676002)(305945005)(105586002)(66066001)(36756003)(4326008)(118296001)(53936002)(16586007)(50466002)(48376002)(7696005)(33026002)(69596002)(52116002)(51416003)(478600001)(5660300001)(16526018)(97736004)(5890100001)(21086003)(316002)(6116002)(76176011)(3846002)(50226002)(6666003)(2906002)(2950100002)(8936002)(86362001)(68736007)(25786009); 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:NhMFgA3Epevgwm1BTrV9gsKUa0MFB+sxTdJKwT58/?= =?us-ascii?Q?9NLEsZd8YG8I5Ryh/Uv87q0ptRM4ia5zxQY7AQ/QhEt2wEg0y+vK4bmR5sBn?= =?us-ascii?Q?wLEIZlkUycbmr+Vs5FVGzCvv9dBwU73Zu5uaguwg9bE581bjYUf9nTiLq77V?= =?us-ascii?Q?X7CFn6en7ejW3N/hKYG/dHDvmYn4GIsyNf6buzTziaGBBRmt1xPumwXv4qAJ?= =?us-ascii?Q?xKx4U8Ws/D3wLWw2FUSUn0/ufF9KWCkyD6TLnzlFyWALaSr7KtBvztxDPS6h?= =?us-ascii?Q?GJ8tzPXWVPEBnCKffBVglpqjHGueO6L9uc4jpziVZNFyXRcZLjt0n0Cd56aZ?= =?us-ascii?Q?bA9F6p/j920bnFTvYTg45jQGV6sA6TL5yioqgkwY0avISG2IPKWZ21zp2F9C?= =?us-ascii?Q?D4u+mu7Yq21xnG/tA1SScTpHeN2v7a65fTw2+scKs37MwTz7aF+GSgeEa1Hc?= =?us-ascii?Q?w7poCD+i+yhXlDlWcfr83SmHQd4J6vQQTYFY/ZOWXfcINCcHwku2fgPPjc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4eiqyYZb397yo8HyT3JYWcOK/Ak5kWBRn6OiGd4XnQ01wNbGuYD3OogDRg2XiKQ=; 5:BdNc7OQSn94ClPIueZWamh1wo9TzwzjQ+SPWIh0kHBZOhyKlVAWLnUI//r9zq0bfpyXAqI6sGWzyuqMKp23Hi/JVoOgKJxMY9btuP6ARgt0DdOl5s8dKsi3uYAkWypYXEfGwg60BosJsqdPs6KSfSeP8JkUYr96vaDtEE5qbnY0=; 24:6XqO4yPU9y08o/JFmV252gO5WqJCGo6N26KpcQ4Nvg5QRJq5hSXDuDI58+u0WdWSWigqM7adoSjbPL8Pa14oDfSGXSIQcFgOJsdJU7dlXfk=; 7:DHcPgVmBO3x/KX8jP/yhsjV14pv/fRpAtXMrOTsO2vVEiCmMgXQtyBKCeWvOV3Ux7izuIg2B9p++lQLEHdlddYUlf/Unfmldr22Pg3oMfz3uV0T1PSxrBNJyBHL4C78MJ5gXgdphXf7WQN8xOaT0dpCcU2bkvQZBFJqRHNJ2iHJpkFq/61GTZxdraikImFhOC0H7fD7JpliJI1CnI8ASrsxJbiGoedNtsKuEQeZIqRUDJ2xFEECfMSfOLT724lUR SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:53:35.8953 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c520648-79a6-413f-d003-08d5415f5c14 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 v2 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, 12 Dec 2017 12:53:41 -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 6785b09..77154ef 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1394,15 +1394,23 @@ static int eth_event_callback(portid_t port_id, } 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 1639d27..ab74d39 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -682,6 +682,7 @@ int init_port_dcb_config(portid_t pid, enum dcb_mode_enable dcb_mode, 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); -- 1.8.3.1