From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0051.outbound.protection.outlook.com [104.47.1.51]) by dpdk.org (Postfix) with ESMTP id 137736C9B for ; Wed, 17 Oct 2018 09:27:47 +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=RZdWZzBwt5wMumt/SftlxRldI2XIG3FCgmtCXwtZ22o=; b=uH0XoRfe1+rWuQiTR0AHDMUPkPuzauI8dDYY3dLlWn6IETxfqnJz9acsXyH1GvTt4+e5e40adFZCaJu5aHzUdso2AHLJxBRnmo5VZ6yGHEYAhGoK6O1KLqb4VntWMkOwSyvWXyW69gX0nSwYWzEImiTIix6AS0iEDVMmPCP4N8I= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rasland@mellanox.com; Received: from mellanox.com (37.142.13.130) by DB5PR05MB1253.eurprd05.prod.outlook.com (2a01:111:e400:51cb::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.23; Wed, 17 Oct 2018 07:27:43 +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 10:27:31 +0300 Message-Id: <1539761251-7677-3-git-send-email-rasland@mellanox.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539761251-7677-1-git-send-email-rasland@mellanox.com> References: <1538897848-1693-1-git-send-email-rasland@mellanox.com> <1539761251-7677-1-git-send-email-rasland@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: CWLP265CA0322.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:57::22) To DB5PR05MB1253.eurprd05.prod.outlook.com (2a01:111:e400:51cb::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2fac6fb3-1bc4-41e6-5e1a-08d634020806 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB5PR05MB1253; X-Microsoft-Exchange-Diagnostics: 1; DB5PR05MB1253; 3:WNTZuCY7DwDo21hTFxw8PjD8ax53tw3ltzwjHSyvEjnSief0jmO5H7iwSrGX8CCYuAMlhkMc9a2/mafyxJmT3nqAEsHFMD6kT6ljk9eui9/PYi6IPiT1VVT0V6vLas+lLLgM0n0J3VgDs1BGZPKz5C0zRFzZYs71ei83l4mlbItEW4uySSPTi8sFZnsTXeLd2/Bg+n20/UHf+SGx4t4SlUgq7pGHYiZ6F6e30PqRzaWNINO0q75OSBtAY0lByws7; 25:45T4LNc85v4Cke9fVCf65Y9wCPhGkEeofQcDfYUOCV/iT2SEJtazMi6np/MA72mDhQe5pjSHVofFhaUnJWKK+vfQksLqxCv20SAqVx/dNrLEjMA2LlBiKSmDw9xPU++4nMgYAT4Y9mNVT9iH2mYlWLPieBts3TyEiRNGPIvGLQxJH4tcPeaYelMiQuZ9RhTnRImMxF2Y4QmbwykqUR53+Me4y1D7HmJNQucFF072me0qbw/qNch1MF6W3xsUtBfGftreuXdEZtsqAWcezVHc9jKKa8GOzx5/vhtyDn1/fDY9A5hA7kFKWybJzSoNL9uxMLQhmGzhlmxP4CZpuZkHKhaB5WQetjB35QqzQPVDl9Q=; 31:nacYbYe0qQwYsDCKXjh3WrRaN04JWtSLRsgZo+u40MtzPrVZGNOiiz/Uaq0568QOz6jWUy+cTaNOkBuqxbJUql8TiZ5+aKViP+faNLhxxeo4/cghz3lyn1jkFfxFRD5vR5+csTnEQeftBvtJeTDuegpnN0bieLBBshNi5TPt0pfoXPKI9ygR+ou/bb1HHLuICLe2ACv1ohvKhiIj2xNf373nTToXMBppLEoiZmhGSxs= X-MS-TrafficTypeDiagnostic: DB5PR05MB1253: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; DB5PR05MB1253; 20:x5FXSP0xZZisY4VNsOHiADsBgJt/8yxen8PLm/7O5no13bm+BPrEvnbf3wKX0uoN5d/r758YEb4DD9jD+MkBIqKgLVIj7pFrF5+FHs95csw/wOyZ6zB2hXE5rkWmLJegoIu6GDTjIL5TmejPVHtnYxyknM4ja7osEL365P8gqPKfJh1CsCRW6owvEqGpq4/tVX1YwMRe/0dzttRx42Jg+fS9V9/9tRxsyfNXCF9qg63qn7cv77JC6kxTHCto828JsUyHFs4W99nOnuWG26XFJ/PJZ9wdwTCmAqzAc60Nw7nekeY5meg7nVakURx00QfAksl18EyHm7xmLlZLs1qnpPXstuJEsOOm65iyJqGAJq4Yo/URSzL+aqPtkr7drLpohDRtjqv3sOgnVBCMCZ/hYob3mMgKlMf1SnKDfu52c45+V8emlTSnFMvbWFyqdhFHyBeFgILm/s1Nh7it8N4J2/CsKAJ1Jsr8dGwuqUuAct9gQJxXrMDyBIHTDhTu6MuN; 4:LqIXOzQ8kx5L8I4bn1OzAiIz4GPX7+KcRRxcfXvWRj91JaVveJlHn3ee4+R75sgqIGIHT5DDtnWG9B26f0jDJPXtTJghqnOzNlfJZe9mkiHoPduA3aFGkCmn8nHbiUNb+eKrbU/imRNzErehafvvPw8Gg36MsbaBu5Xr8UD/6PPwfdn4jlPb/JgXvyzirXprnQaTzjmlM6S3c+zrV4lO6e/6WF4cbL451Ls6FGGJdZSSNQWPZCkhs5n9A7iuO6MvreLnfhDt5Y7xwQh1oCx67JjD9JKmB7+ZsTOP86QhcExi04zi7N/C0KmVwrs/EpWO 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)(8121501046)(5005006)(3002001)(3231355)(944501410)(52105095)(10201501046)(93006095)(93001095)(6055026)(149066)(150057)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:DB5PR05MB1253; BCL:0; PCL:0; RULEID:; SRVR:DB5PR05MB1253; X-Forefront-PRVS: 08286A0BE2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(396003)(346002)(136003)(39860400002)(376002)(366004)(199004)(189003)(33026002)(476003)(97736004)(50466002)(48376002)(55016002)(50226002)(16586007)(11346002)(21086003)(105586002)(36756003)(3846002)(106356001)(6116002)(446003)(2616005)(956004)(68736007)(69596002)(316002)(4326008)(2361001)(2351001)(7736002)(6666004)(53936002)(47776003)(25786009)(305945005)(66066001)(486006)(186003)(7696005)(52116002)(16526019)(81156014)(2906002)(26005)(8886007)(8676002)(86362001)(5660300001)(386003)(81166006)(478600001)(6916009)(76176011)(8936002)(51416003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR05MB1253; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB5PR05MB1253; 23:DCsNkvBehbBIwXFsPYLuArVXymRWDOuN9sggh6nSJ?= =?us-ascii?Q?L6cSvwOwCrSZqzdo26Us5AxX+m7eYASjtC+0sU0194kMYYr3nOJ6xhBYwByf?= =?us-ascii?Q?WSCsNUCPbsXy+l8lMQpK9w7v3bUgU4IdXo65aDKF75F29MFt5IAy4PwWZ90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htY5vX3Xt2CcU2bX6ocw/qDtZOBR2sbnCAsEwGQdVEBisnaCSK1oMNi+LNjGyEYDOWV9XfhN/b+4B7165t5b3vJ+O2gHzTqj/rd9YOY+HcUVCimv3Mw94LiHwp0ZNofY90AvfUJl9l2UkDALOkcmw0u6C32KP9uafke1rR/h1+AEVK5nSLWV30cygwLi7dYPmIWVNUe8c9ydJ50OGduqRobvg580y9cSXDLjE5mNaApExD80jVq4XBkakA1mj7n+cag==; 5:Yeh9KGKkJQs2k1G2+39N+NQA8JAeKw+VSRnlPeV4sD1g0n3YFoQFyoCmE5OniFhqNK0cfUzIG9rl6COTLzxRazdFpctb0ZafQ4vixoFMEycSkXT1SkmJYZ1C2xlFmAlhCJJMHCdRBH4zwjv/Aoxwr6NrP9yUyJiTpGv0N5SFM7o=; 7:Nnx/I2ou6P5uJymaXMGqDIBD+dwPTdyom3GzcujHo9WJ/MJR/k8TuFGd3+BYhrTV2XnA7PhIDxJZg1700BXKxudoZUNuqNKRicW7kJtLWWhOEGgnX2PU75ahSxY2P+aFcKEamy9NFUKHIdLhX1j+H4vO9mc/eZsuZb6UEsSN4HYNXTTjphZdzrobTvgPWy0ucr0PtKgHCX3GYkoqRBTF0YiAtlVJ6J99StZ35zzeCDito810p/ELInGQ+gRhE5TG SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2018 07:27:43.8019 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2fac6fb3-1bc4-41e6-5e1a-08d634020806 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR05MB1253 Subject: [dpdk-dev] [PATCH v5 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 07:27:48 -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 --- app/test-pmd/config.c | 25 +++++++++++++++++++++++++ app/test-pmd/testpmd.c | 4 ++-- app/test-pmd/testpmd.h | 1 + 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 431fa2a..87a90ad 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 d550bda..20582e4 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1991,7 +1991,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 */ @@ -2090,7 +2090,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 0e923d7..1ca7c6a 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -778,6 +778,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 -- 2.7.4