From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr60043.outbound.protection.outlook.com [40.107.6.43]) by dpdk.org (Postfix) with ESMTP id B8D8E1B171 for ; Wed, 10 Jan 2018 10:09: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=FUf4UZ0RjCBPTOZuGnyYYsplKHHuP3snz8gb1JDqPH0=; b=RrJrLdagnENeJW8gCuOBQABGuCMQmt9fHC4PkunVjvxVmoKndICxH5bXe9KE+YT1KBN9291VSMmbe8pzOuoai0vaW2d9TNT5hvH/j8xo/Kf5G1a60/ZMlhzISZVenyHA09hvfZYryG4p5qjIHtnvIjQoMV4nlfJtQTfiBlZczsk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (82.166.227.17) by AM4PR05MB3137.eurprd05.prod.outlook.com (2603:10a6:205:3::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Wed, 10 Jan 2018 09:09:56 +0000 From: Shahaf Shuler To: jingjing.wu@intel.com, thomas@monjalon.net, ferruh.yigit@intel.com Cc: dev@dpdk.org Date: Wed, 10 Jan 2018 11:09:11 +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: VI1PR0202CA0030.eurprd02.prod.outlook.com (2603:10a6:803:14::43) To AM4PR05MB3137.eurprd05.prod.outlook.com (2603:10a6:205:3::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3c6d6fe5-7bf0-462c-333b-08d55809ebbb X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:AM4PR05MB3137; X-Microsoft-Exchange-Diagnostics: 1; AM4PR05MB3137; 3:Ll+7pZRxMVJBks5n4V2AZTK9hNp1QZ+DTBmVQAgV0YTkAomyIMO47FdeWC72bbZ+VC9c306YMjadPw79v0Wx/rjpGyYLSKMPJpeGi2B4Hi7SpKIxL4B82Ujlin1NGZ+XaTfwsuKazRJC7ZKlqp8JznIet/JZAjMjOaCLfe4Cl3SL9SRTjQhWydOnMTG5jLMuMIR80ct7DAI+KbU7uW0+N4QhI2uVPVujegnlhHZqdZMo4YnTSVHxohSoyD06SM3x; 25:LprAoY1CTQMNWFeuiwLsLSEB0hwfe0M16WtvpiVanUAFxVDg6T6iLjWHhYCekwQzwtsk+Jb+ApoLBJA7qU3uYZ5OD5kix7rJOFxYiMLYWbuYEW699ijqsVoMzHx3wsWhUPYVMeCd39rWRuC2kBvPcyWzGR4iTIF2cWk76mte+M43RsfzSSMhgFi+74v+X7vTNGIbN9HqRKg25Yxe/9+hdND6s66K5COYICRMtwFUUnVMKP9cNN4qN85Ka8EknJqPuRb8Dw5HvCrJWi8PxZplnmCObVAP25/0Pc5/9xx6GvysPXCaQKpsN08qb694ybBYtcAlFVh5xKjrjvl1suoDXw==; 31:gPTkC3uQSVYLzvog2xpbGsfT5hhc753AbilEKgo7XsebnsviyOuPbRnZ1ZE5dGw0CUNp+uiJTMkFLsnyj8NLwcdQOzmN3YnyeMm3+U6HsyVGcJXLzqiK4PoRwBPy4JicTvdwSuXWY3onVP6nSZkX4Dhr86K2VcxlN4GDLkLvTTOu7ybqnpdLnv56YL8XJ2tQhnwldVAJCV8vpePJGdQRE+AHawsqU2nfgqa4RKM/TFE= X-MS-TrafficTypeDiagnostic: AM4PR05MB3137: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM4PR05MB3137; 20:WZjcDYRUCDPlIzdwfsx8ebSDAcnUHDpi8e3ozGKD3dz7QdmS4YcSqmZnJUKcu8lpt2W6XTRylwCtdNdNA1XMMajs6xwOB5IaByDDwxotXNrcsKuq5r4MJ+BbDOvBdDuxhsrMLMRauQW0X/ObOI1CNoKBr/aDhAejLYL/7BDgrq8RYkpmKRD3sok+iuXWVNnlCK68vyBkcdK49tI5b3IOAP/J/thCpbXdhnPcPqHG8XgrnyzUrCUpFDeLPFJWgznqh/7Z3nF/qE/OVoUgyJ5w7PcM97hVCXOm13l4upetiQSax9vSaYzvI27GI3aYJsLKQPDz6Vjm/Jo5LGsClapXEumdXC4icQNOLJrjdKXVH6WLH4fWLiVAY3oOJzEElTRLi++tKdTbK3RzjNFhstiKGg/AADfwLk9bbQoBk8EWqQFGY8VX9Int0RrgzYRw3+HsEq4A2uKAf9UbLMt6HqcVVA75UlOY62dlmCfG4emaf6GUAnzZvD1u+A3n/la0d7TO; 4:KPDTrgNNED6QEpV1MEp/+oBlHiau7kds9fyqnjDFl65F8qdBXjdh2SijaPyhLhujDrajpWkENXL3aC3tckC7/2zWQXTJfsDUqAPfJJJrooIKrll1auJB1esvqHTrnHtAH23iSZrpEypVBDu1tyS/iHi/cM08xMBKJ3/tl3ziEjGqGsatJZnNDkYrZ1XCc/U6FBoZBAqA3xfhb5W+vfDHOfUJsvCP28PweySMSvqiBBipoP4Ra+an57TsbSDOO4FuSxWcvjkrr7Bv17S39z7jSYhO4w2Plq1SK+fSlFnws2Yw1E+UQeWwGAdhvZ7FC4Kq X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231023)(944501075)(6055026)(6041268)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM4PR05MB3137; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM4PR05MB3137; X-Forefront-PRVS: 0548586081 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(396003)(366004)(39380400002)(346002)(199004)(189003)(6666003)(478600001)(2950100002)(5660300001)(8936002)(50226002)(8676002)(81156014)(68736007)(86362001)(81166006)(118296001)(5890100001)(305945005)(7736002)(55016002)(2906002)(21086003)(6116002)(3846002)(106356001)(105586002)(316002)(50466002)(69596002)(386003)(16586007)(36756003)(4326008)(52116002)(76176011)(51416003)(7696005)(97736004)(16526018)(47776003)(53936002)(25786009)(48376002)(33026002)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3137; 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; AM4PR05MB3137; 23:gXh3AqxzVWKfwI9puOwi0kcyGaQgKchGHcdqGAp7e?= =?us-ascii?Q?v8XWRlPocYcyNyJaPWTundYVL9vvsVWrVOC5p8X3tOaI21Gm/3blUPeksAP2?= =?us-ascii?Q?/h9hy52kVThQTC6ATk5D81AEghf2thjlrD2p2Tjn3DrzvDB0WYIkHYb41AWn?= =?us-ascii?Q?lCvktu2vFCtnumWL79QuujhEBpQB0H93yo1Gcc4lXZRQFY7RTNEoPj+fQLlP?= =?us-ascii?Q?4l1BRKLkCm/EMpNh3wxI785ydv2gJs6RAluZTu1VQxd49VBgta2ZOsYZrJFt?= =?us-ascii?Q?zPzyQeUtTbh4/kGfxn4gtenw1a3Rjvrjn//HqSHm7C4T+ivN1nS2Nw+GhLxD?= =?us-ascii?Q?Oh6J3BHLfPcpsYtld8m3oalikQXyof2T6MG6ZkGQQFU16I/WpK9aj4pO7ErV?= =?us-ascii?Q?+WQa9E6T7c+ApZnd/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ua6760FHn1cikbTaXSxoSCPd8vdXWwbgbsKkPa4HwuU8UnqWlGDuZ7u8X0ms+eQWKPZ4wAbDFS6nYJ1Xv8Y/N4HOnTA+GtoomiARerfvaLnrC4GfX/ta5S9vRYopHHMaT/NZlWnxcYpNG2lQxC1gUDKMajXudl+HMR8RMxSVb3gUU5RHnDqeJOR04yv/0ra6QaxZbdh5aWqH7Ijf23toWRZmEdK537RgYR5E=; 5:6Y5yth446p7N+BN7hRmir+xb3Vkzly7J+nAZltDj5wmBVbvaYXRm5LbIDtjm+bMOYByAZI1SOXHDxlQ304UgAfGicyqd+RscbI1tUtZRUE3+8+iwk/5DjlAs8E+HfgtYAqxvqwarJPbW34HFzXmYlEs7jwuUEbZLjpImtqlXXuE=; 24:R4R8GMgP0Yd+0e61DjrGjelkd6HaYGht3q/DlWpCrS8mfO589NOvZP5vfzGnJnx3ewhB3q84cY9pg3DdBwyU+bGI/9p74lKBLXDUeNMAT9c=; 7:ZMX8Z/jf5pj3jXnQtH0WlpLstjPSYx5a3XdN9a56o2HvVquMBSG6SB5lZc3c/u9uNVFumEmQEBwLaMuBMc6kRTL0R4Gkd5VurvxPqsSjLHQ/Jg1jLqLjU70hTByRNgVsYIPj6wWAj0tfiw0uIsvmtMreMAZbcpt/adpUj+H9P3UNLBgv+8CeK+rSrhU1mDwIIU+wIn41TZA87eNJtpOeC/+uen7ujry8iANS29I6SKJD/FvK3L/b6bKpRRQw3Afb SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 09:09:56.8313 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3c6d6fe5-7bf0-462c-333b-08d55809ebbb X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3137 Subject: [dpdk-dev] [PATCH v4 03/11] 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: Wed, 10 Jan 2018 09:09: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 Acked-by: Wenzhuo Lu --- 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