From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0049.outbound.protection.outlook.com [104.47.2.49]) by dpdk.org (Postfix) with ESMTP id E695228EE for ; Thu, 30 Nov 2017 08:51:48 +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=3I37/NgDUk52/0qnrLS5NiOBnS0M7E72Z8fqrxfefH4=; b=FbzJHvJrnrqBl1n+7kpSOFw3pY+sJ9cSF9v2rEylvqwHB6y2ik2oa500b0ZrlutvcEHhCjd46Vn4WtMIZJPKvRZTBdmQe+HJPinm7991/51MgZKI54YVOSqui0BGNhUjfCX3kGdCstFc+V/jz1hFKeVk4mRXn2DJIiOgJD5xkPE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by AM6PR0502MB3656.eurprd05.prod.outlook.com (2603:10a6:209:9::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Thu, 30 Nov 2017 07:51:47 +0000 From: Matan Azrad To: Jingjing Wu Cc: dev@dpdk.org Date: Thu, 30 Nov 2017 07:51:23 +0000 Message-Id: <1512028283-18903-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: HE1P191CA0021.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::31) To AM6PR0502MB3656.eurprd05.prod.outlook.com (2603:10a6:209:9::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 8c15919a-23c6-4fe7-bd2f-08d537c73569 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603282); SRVR:AM6PR0502MB3656; X-Microsoft-Exchange-Diagnostics: 1; AM6PR0502MB3656; 3:vrvAMGLBR/UYPwKQTWgyl8d23uy0Y6ChIU6falCpF3x61u/kw70Vlpd7ti6HVPeJRyFOiGh2NAqLRwf2uUNPYfLhKilb5XLqQ/W85pdGu5pfF4syNXl423AKkRTv4VsQ4TFpvGKuvOFdhwPX+viT8ZE0ybCEDrR5ylj+yn4R/GGQoSiGCkO4+f/i42A7YrsyFTSIVJ1sJTUXO8JUBU37POcpT81jACu6QcEa9+IzxyuB8JfMMJzPgOiy9+le9zdv; 25:UG88u0DzElYDWpopLHM5IaqW8VhIaS7cs13rn/D0ybDTvvqLQqIRjHcahagVyjosh66NNZ0d4wd76IQIrwVt817oW2mdGpnr4CheFZJZtCXjsWhyrrh2beTKP+ObNhyH2r/gQb2vCIiijwTov0R44RPIDgOPiie2KCYONU++uSE1KzkbxuE2zOHzhG7hJczzM0S0sVSqjpG5SWZRkHC/gLQQmy0+xs4H1atKu0AxbWQPMgnEvMS8q75sNjPD7VeY1y5ACwoJIkPsbwQQ6dTec5eSxi9XkQFuIl0hS22qqP09SKXe8D/1eElpx4VuqxXFYjd9zvz3YqIeZ3Ri6g7r8g==; 31:RknAHMxgnWLA0N8AV0UOrIXV0x+y3hNpE3va3qTXno989wnqjrULD9++DnWcEYyGEVZzgqINIiaXYsYE8NWVDrNOwUdS3ePopyVpf3v/XKT0Fa3tCzFWB4Nr2914WUa5FPH2mh4Kk4MFbwWt0zX7vo/q3L6ByTtqFc88tIMKLXt9+NMCFz63StdUu1X4kB1vrWimgVl40zaDMoC6NdbkR6LnRkeB6vo1xFSSQZwN3bg= X-MS-TrafficTypeDiagnostic: AM6PR0502MB3656: X-Microsoft-Exchange-Diagnostics: 1; AM6PR0502MB3656; 20:Tx3lhQvaJ1FOOjJe9aR1goPXxTZK4lL+uf43k7fjmbp4PYq9fShIfmwU5rxXx/kQmJOgNU9pExYojqAtvUmpeurbgy1iwgXAmiy0G4rG3l43cc8EIJ9xWnK2M5vlvtw66bk1A6HtzCLyxCSgznugfeNsPll9imXJABygiy7re8ERq5fukwJQW97Wc0p/jdhptCTzH82lEFs+Wcrlcm9k0RwraitgB9Mdl9sBImPpotIUqoxkEROW7p7EhCmqXfR9CsgBaamxeVhNnaLQLrnEr8aufEckeVhcJ1DkmICxcFyXYA9Dahtopjr3HaFzCDldE1/RmKziSwX7NLMFASieG23utd74VlX0McDhSVkETrW9PomXCNJN738LkUsX16+OcZNKYJrOsm88XOLG6MU6Ko9/HMoZq2/1UxCqfd8AtmWjGX0khA6bimY2Cj0KToWeXEK33b/oNKWvTavQu0q7G/UQmBXQh6VJPFO5JUT3cqsEndNdfzqWhm6x1IIauZsR; 4:JFC8wgAPyfS2HgoET20QEP0LF77PAEUcQh4D9TcjxTf2eB1coiB2a0BLcs72yTF5Op11qPDr91cMgzLL+TTt04Ih7oJQP23ZEHQlVgprOskeG76L9uYOdqJYbnYvzktTFiumsPNPj4GGQNZ0pUheLNuz0C38DDUGRjsCKzOKhvwWM1jNVn/EzGCL/yk20jTlimO4c4oASqY9yePXABiA19cqYC4hO4kFSYZQqttO0q4+Xe0hRUW/VxpD2PAY8h0RlxBY5WFJqp0UWfvcdzHv5Q== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231022)(6055026)(6041248)(20161123555025)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(6072148)(201708071742011); SRVR:AM6PR0502MB3656; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM6PR0502MB3656; X-Forefront-PRVS: 05079D8470 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(366004)(346002)(376002)(39860400002)(189002)(199003)(8936002)(36756003)(50466002)(66066001)(2906002)(48376002)(33646002)(6916009)(6666003)(47776003)(4720700003)(478600001)(68736007)(105586002)(106356001)(52116002)(7696005)(97736004)(50226002)(50986010)(55016002)(53936002)(51416003)(4326008)(86362001)(101416001)(575784001)(16586007)(5660300001)(189998001)(33026002)(305945005)(69596002)(316002)(25786009)(81166006)(7736002)(81156014)(8676002)(21086003)(16526018)(3846002)(6116002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR0502MB3656; 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; AM6PR0502MB3656; 23:jLBUXH777s18X908BG/0dPcPzJyEEEfvxC57n5N?= =?us-ascii?Q?c2FLXh7LOVn0wT8NsvMEsG1Oyp7s9+Gyd5PEM4ap3Fap8Dnkc8U990b3Wjtj?= =?us-ascii?Q?m0SY0t/1twxpRMOJm5Pi0wL+Nv+TjJqIeiQdIbZOKCjmFHO4GU2/L77wLTRS?= =?us-ascii?Q?FFPDtd70S+IJwBoWbYZ1QDtYodpl2iihrq8Ed8tI9Ns2yHOPAvoq81sYn4A5?= =?us-ascii?Q?eXqt7kx2taDcuArFMjhIGwzIuIB6oBY5J+uVNDLyV4m0TJFgmIU4hQBcyxrk?= =?us-ascii?Q?yN6L5q2rTGvUt3M9zXTOuSdjYoRrJt3OoCUMryNHHT1YKHxMCpozWWqmMdgu?= =?us-ascii?Q?k8bygd07yPILpVrhMdXGLmM/cw25dcPzZhcSavOYLy0PNYT4Ag4MwzyjRlv9?= =?us-ascii?Q?7JNMG923bQv50UaByjLM2X9/n/z62rIZb9d/vEwSo4/FE8WC4sRh0BQUI8od?= =?us-ascii?Q?nttvWdiCKO83BIqeDqDGQj5GYomrxp9Gu5hAFZ5JZEZ/J+HP6FzjcRW3acxm?= =?us-ascii?Q?nTOLDe3cL+IDcCd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zm9FaHj8y06c/NRCEE2HhhugKvYGlx/Rtw8DApDOnzUgPcNV9UajwgxaQ54E+KGO/n01tLzHQ3bIdz1GkRG41ftXaoTnMkqi1mR9bO0Ns+1kkXKcexzMI0Yj8gxRY1ck=; 5:fQMToOoFZX/IJ+fSoXIdcsw7PGcsBf7vKreO4/Ks+a1Z9EacyoupG3Uc0UjK6Rn0aYfXvRooA+2i4D1rWQwEzivXHTNJcAApu6TkWXqVCwkGB50v3w85yHOs9HYUChPICH1wyaI5Cho2j+LNQ8OrxJw2lQPgUIt8pFULXhou2Tw=; 24:s3kMAQ7OHbkh7Gi2uU1n3LomKeGCQsTjryvSR6qKVagYX2xClSMRKH5K4F3opZKm/Y9DiM468eJ8Yqxvq2xCDVTJZ40z8qPPZVA6GhMt4aU=; 7:AKkCaLjDpQkBobz8TXcYpxlcSvskEmmPQ+7RGZzg2ifGmpTjaLmNhmSPcUpIBtpH0ZTuugtMOPsOR2p4sudcUUp+hjQuNxMmBtIISZW1PiBlOLxXBoCgGmdn+E9YovRNoeQxxoflAkw+zBCsODhxO82O7f0/0SNSzx/M6hFrHRkCCjBurV7SYJcosebWyaS3SOH8cOwSns8mCxH1Q9ZkXMDEV47rfCpH3JsKZTmbGY/V42lC3pcsF5s7ggp8co0Z SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2017 07:51:47.0216 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8c15919a-23c6-4fe7-bd2f-08d537c73569 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0502MB3656 Subject: [dpdk-dev] [PATCH] app/testpmd: extend event printing 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: Thu, 30 Nov 2017 07:51:49 -0000 There are new Ethernet device events - NEW and DESTROY, and new option to register all ports by one call. Adjust application to aforementioned changes. Signed-off-by: Matan Azrad --- app/test-pmd/parameters.c | 4 ++++ app/test-pmd/testpmd.c | 30 ++++++++++++++++-------------- doc/guides/testpmd_app_ug/run_app.rst | 4 ++-- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 84e7a63..796d1a5 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -546,6 +546,10 @@ mask = UINT32_C(1) << RTE_ETH_EVENT_MACSEC; else if (!strcmp(optarg, "intr_rmv")) mask = UINT32_C(1) << RTE_ETH_EVENT_INTR_RMV; + else if (!strcmp(optarg, "dev_probed")) + mask = UINT32_C(1) << RTE_ETH_EVENT_NEW; + else if (!strcmp(optarg, "dev_released")) + mask = UINT32_C(1) << RTE_ETH_EVENT_DESTROY; else if (!strcmp(optarg, "all")) mask = ~UINT32_C(0); else { diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index c3ab448..26576eb 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1568,20 +1568,6 @@ static int eth_event_callback(portid_t port_id, } } - for (event_type = RTE_ETH_EVENT_UNKNOWN; - event_type < RTE_ETH_EVENT_MAX; - event_type++) { - diag = rte_eth_dev_callback_register(pi, - event_type, - eth_event_callback, - NULL); - if (diag) { - printf("Failed to setup even callback for event %d\n", - event_type); - return -1; - } - } - /* start port */ if (rte_eth_dev_start(pi) < 0) { printf("Fail to start port %d\n", pi); @@ -1608,6 +1594,20 @@ static int eth_event_callback(portid_t port_id, need_check_link_status = 1; } + for (event_type = RTE_ETH_EVENT_UNKNOWN; + event_type < RTE_ETH_EVENT_MAX; + event_type++) { + diag = rte_eth_dev_callback_register(RTE_ETH_ALL, + event_type, + eth_event_callback, + NULL); + if (diag) { + printf("Failed to setup even callback for event %d\n", + event_type); + return -1; + } + } + if (need_check_link_status == 1 && !no_link_check) check_all_ports_link_status(RTE_PORT_ALL); else if (need_check_link_status == 0) @@ -1930,6 +1930,8 @@ struct pmd_test_command { [RTE_ETH_EVENT_VF_MBOX] = "VF Mbox", [RTE_ETH_EVENT_MACSEC] = "MACsec", [RTE_ETH_EVENT_INTR_RMV] = "device removal", + [RTE_ETH_EVENT_NEW] = "device probed", + [RTE_ETH_EVENT_DESTROY] = "device released", [RTE_ETH_EVENT_MAX] = NULL, }; diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst index 4c0d2ce..377b076 100644 --- a/doc/guides/testpmd_app_ug/run_app.rst +++ b/doc/guides/testpmd_app_ug/run_app.rst @@ -492,12 +492,12 @@ The commandline options are: Set the logical core N to perform bitrate calculation. -* ``--print-event `` +* ``--print-event `` Enable printing the occurrence of the designated event. Using all will enable all of them. -* ``--mask-event `` +* ``--mask-event `` Disable printing the occurrence of the designated event. Using all will disable all of them. -- 1.8.3.1