From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60063.outbound.protection.outlook.com [40.107.6.63]) by dpdk.org (Postfix) with ESMTP id 0A4857D04 for ; Wed, 17 Oct 2018 17:22:25 +0200 (CEST) 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:X-MS-Exchange-SenderADCheck; bh=tqiSmnNvJ1Z9hmX959TayRbL9WewbOeMAucjWiW5+ok=; b=HqT4C6ibugm6Z/A4ag6KL4E4tln/Ug2FP6PNtUM7GtsG8b1nw1Tiwb3XyIdZOVYlfLd2RTKZcrNf1VKAUeBUk2LyIcy2YoH5CnSLIS5ZDYksPqVYwp7QgILG+eyzrrqoR/HXVTrFMJzpymPcF5REsfF+zpRLGXbuYwG2dH6URpI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rasland@mellanox.com; Received: from mellanox.com (37.142.13.130) by HE1PR05MB1257.eurprd05.prod.outlook.com (2a01:111:e400:5889::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1250.21; Wed, 17 Oct 2018 15:22:23 +0000 From: Raslan Darawsheh To: jingjing.wu@intel.com Cc: thomas@monjalon.net, dev@dpdk.org, shahafs@mellanox.com, rasland@mellanox.com, xuemingl@mellanox.com, orika@mellanox.com, jerin.jacob@caviumnetworks.com, david.marchand@6wind.com, bernard.iremonger@intel.com, ferruh.yigit@intel.com Date: Wed, 17 Oct 2018 18:22:11 +0300 Message-Id: <1539789731-18409-3-git-send-email-rasland@mellanox.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539789731-18409-1-git-send-email-rasland@mellanox.com> References: <1538897848-1693-1-git-send-email-rasland@mellanox.com> <1539789731-18409-1-git-send-email-rasland@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: LO2P265CA0158.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9::26) To HE1PR05MB1257.eurprd05.prod.outlook.com (2a01:111:e400:5889::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4fa51e7c-756b-4609-87a1-08d634445786 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:HE1PR05MB1257; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB1257; 3:Wqtb3bsov8WtyM/ooI1Sw9mmJcfX+u5J5+kJ+F5w7n+VZZXONz5b/O0YpUZI1/60EDaOhxFEQatt+t+OrYlrYkpQjikDfIaTdgDrQQN49ZDgwg4mFwth3mt5gRH8/BaIr0NZauWEl/jJu69hEZpbqsy6ebtWnswLB0vr9vHF+xKxs5tR03BMJk0DO7Ima5l3T+Ax1cZnnHEVPLuWNNozZDh8uF+G8XCq0XGU5wDxF10w0ofC+c1DEGREAPanE4cq; 25:9ntvhpmnK0ktSfgNdbd0R8k9RmWxBI6PDbDW31UEdZGjgOCGXgR+iZZe/dSZW5J/ZrfK1LIy6Efcx6Zkv/lYHbWqm7poJzimkSyhzV+fBiLUllifHQZ8faf/0hUYXM0IzePpifmYgpVibao1tbjP/5t8LYNWCpuLdZ/d+mhYtfcja5rPgMQv1qp/KzvDuotPqoGR7QMz6+ap4BilgK6+DaRQlmDp6FDQFo1wy6Gu3PVb+GL7KyIaCX1obdJsVdQ7CvN3f80SGMBuxhheQp7QcdGp1Q7/Cmc5s1GczzJ/AQcCWQHxW2bOj7FzZvGM+wymPGxKPUdeYKQXelI9OzrW4RM1i57/vKc3Avh/wmUdBNA=; 31:Vk9XQDr0UIGWI3grGC2d0vdvIMd1eJbpluYP7pHcLYooeBfeNrqDwFqD0xXV9iXc/1Vqgf3n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+xkeF1PHcvs0y4SL6C7HqDeTXzz0Ab2JvbSS2Te3LkiFrPgK7TPLm X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231355)(944501410)(52105095)(3002001)(6055026)(149066)(150057)(6041310)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:HE1PR05MB1257; BCL:0; PCL:0; RULEID:; SRVR:HE1PR05MB1257; X-Forefront-PRVS: 08286A0BE2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(366004)(376002)(346002)(136003)(189003)(199004)(53936002)(47776003)(3846002)(8886007)(97736004)(55016002)(4326008)(316002)(16586007)(2361001)(66066001)(305945005)(33026002)(446003)(6116002)(11346002)(956004)(2906002)(50466002)(476003)(7736002)(486006)(21086003)(2616005)(36756003)(50226002)(51416003)(69596002)(48376002)(478600001)(5660300001)(386003)(86362001)(2351001)(52116002)(7696005)(68736007)(76176011)(186003)(25786009)(8676002)(81166006)(16526019)(81156014)(106356001)(105586002)(26005)(6916009)(6666004)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR05MB1257; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR05MB1257; 23:+QfnY4VsQ//ClTHZAeXqJH+CSNESh6FSgH11was+H?= =?us-ascii?Q?X9tr2+VBMW3zMAE97NAE9PPqapwE8U1yaQFJKYb/biL3Fvh9l6SZCkGlfkXS?= =?us-ascii?Q?F/7WAzYKaxl0fjqmWDkyMVEwZKzpj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ddFgJpYKGu8nee7K2/thkwFCUR+FIGuLYLv+84FzMFmn67UjXb23YS3+hRdcPXJE3/4lKNprgFWXJeNjH0vTYQ/kd7QUL++pAi6rZ9HmhYztf687A7d1xRMw4nVou9r/6PcFT9qTGdmFNu0izptmLobyXOOmfBzs0faV+ziVQvAeoA==; 5:XfFXW2UdrJ0igMGUvq6yqXKk79Z5FjQWEtp6okmJVpdk7PyTqUPs8svVulVLYxTL3f4uiwGQAeDJ6Au+hbExvnPzA3GCD4M+YwMm7kqxouoWKlX2lqCyL0A63Ng/fwJkKgoe3fUTVA8j/eQpoM009ZO523DdZv3ll1RzAF3Ie6Q=; 7:yiLpjOt6L8MDQyrfoV1kuQrlRmZMMn0pU8pyZXY+aCTh/y+PzeVpfDrdtVJiirOGBeJ8+iouPmU71te3abkqMpjr1jLaEnO2h6YhZOcpL/yQRn5PlqFNDVjy4tK0S+Cry4HXXt7xSIUV0eU+jG0DLlRPC5Hbdoyukdj/0yxJBNSTl1FeBOQaPfWaAyPAMYuUxJeiJOJ0uSeUp8ukz9VBj70QnCWAa/9r4b3/9hSaatHCBaZvZPPP++MDYG+E1/46 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2018 15:22:23.7256 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4fa51e7c-756b-4609-87a1-08d634445786 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB1257 Subject: [dpdk-dev] [PATCH v6 3/3] app/testpmd: set packet dump based on verbosity level 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, 17 Oct 2018 15:22:26 -0000 when changing verbosity level it will configure rx/tx callbacks to dump packets based on the verbosity value as following: 1- dump only received packets: testpmd> set verbose 1 2- dump only sent packets: testpmd> set verbose 2 3- dump sent and received packets: testpmd> set verbose (any number > 2) 4- disable dump testpmd> set verbose 0 Signed-off-by: Raslan Darawsheh Acked-by: Bernard Iremonger --- changes in v6: add documentation for the packet dump --- --- app/test-pmd/config.c | 25 +++++++++++++++++++++++++ app/test-pmd/testpmd.c | 4 ++-- app/test-pmd/testpmd.h | 1 + doc/guides/testpmd_app_ug/testpmd_funcs.rst | 6 +++++- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 55fec7f..1696623 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -50,6 +50,7 @@ #endif #include #include +#include #include "testpmd.h" @@ -2773,11 +2774,35 @@ remove_tx_dump_callbacks(portid_t portid) } void +configure_rxtx_dump_callbacks(uint16_t verbose) +{ + portid_t portid; + +#ifndef RTE_ETHDEV_RXTX_CALLBACKS + TESTPMD_LOG(ERR, "setting rxtx callbacks is not enabled\n"); + return; +#endif + + RTE_ETH_FOREACH_DEV(portid) + { + if (verbose == 1 || verbose > 2) + add_rx_dump_callbacks(portid); + else + remove_rx_dump_callbacks(portid); + if (verbose >= 2) + add_tx_dump_callbacks(portid); + else + remove_tx_dump_callbacks(portid); + } +} + +void set_verbose_level(uint16_t vb_level) { printf("Change verbose level from %u to %u\n", (unsigned int) verbose_level, (unsigned int) vb_level); verbose_level = vb_level; + configure_rxtx_dump_callbacks(verbose_level); } void diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 5dbbf78..3c42924 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1988,7 +1988,7 @@ start_port(portid_t pid) return -1; } } - + configure_rxtx_dump_callbacks(0); printf("Configuring Port %d (socket %u)\n", pi, port->socket_id); /* configure port */ @@ -2087,7 +2087,7 @@ start_port(portid_t pid) return -1; } } - + configure_rxtx_dump_callbacks(verbose_level); /* start port */ if (rte_eth_dev_start(pi) < 0) { printf("Fail to start port %d\n", pi); diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index c07bee8..3da728c 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -777,6 +777,7 @@ void add_rx_dump_callbacks(portid_t portid); void remove_rx_dump_callbacks(portid_t portid); void add_tx_dump_callbacks(portid_t portid); void remove_tx_dump_callbacks(portid_t portid); +void configure_rxtx_dump_callbacks(uint16_t verbose); /* * Work-around of a compilation error with ICC on invocations of the diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index ca060e1..60855c6 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -449,7 +449,11 @@ Set the debug verbosity level:: testpmd> set verbose (level) -Currently the only available levels are 0 (silent except for error) and 1 (fully verbose). +Available levels are as following: +* ``0`` silent except for error. +* ``1`` fully verbose except for Tx packets. +* ``2`` fully verbose except for Rx packets. +* ``> 2`` fully verbose. set log ~~~~~~~ -- 2.7.4