From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0085.outbound.protection.outlook.com [104.47.34.85]) by dpdk.org (Postfix) with ESMTP id 7722E1B502 for ; Wed, 11 Jul 2018 08:08:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+lixC/zKtJ1we0PYtNKIVcQdUFbuAk9EhQY18T85fbY=; b=IvSFluRRcRZBUUr3DaeFbDWGwHlQeXfW1tJ+5iB+MQJUjH8oGNjBb8GZUB+nsu1zKxBTWeh9qYqsQSRmYZRrOKgQGvEZHNNrbcHCKThuKu81mmaHBHFz+0Ltq8YgrRad/PsyrzIRhGxJufPIJz//kQEtTwOR+OMyjKMyiCABDm8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from ajoseph83.caveonetworks.com.caveonetworks.com (115.113.156.2) by BN7PR07MB4898.namprd07.prod.outlook.com (2603:10b6:406:ef::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.21; Wed, 11 Jul 2018 06:08:18 +0000 From: Anoob Joseph To: Bruce Richardson , Pablo de Lara Cc: Anoob Joseph , Jerin Jacob , Narayana Prasad , dev@dpdk.org Date: Wed, 11 Jul 2018 11:37:25 +0530 Message-Id: <1531289248-20025-10-git-send-email-anoob.joseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531289248-20025-1-git-send-email-anoob.joseph@caviumnetworks.com> References: <1528976946-14396-1-git-send-email-anoob.joseph@caviumnetworks.com> <1531289248-20025-1-git-send-email-anoob.joseph@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [115.113.156.2] X-ClientProxiedBy: BMXPR01CA0027.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:c::13) To BN7PR07MB4898.namprd07.prod.outlook.com (2603:10b6:406:ef::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 48322009-acc6-4756-34af-08d5e6f4b39c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:BN7PR07MB4898; X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4898; 3:VICy+ULkma873lDL4/kB1qLMUvf9ps35kbeAd9ND8QEeicXjZawxP0plKNFEWNyflzRJRYLZH6dClTgL4femKFMNFZGRFrxDKjcaxrbpA8guOpdUicogr0knxCtTq2sMrsKyV9D1tYAO4hht6vx9nsYGxuvqrtodd2DgG8sgNkuPHiRVVDbEcfr1mPTOk7eY/F4A3kANYR3Bk0sEav/M0hln3Tt6d9Cw8QF0ET6nnwowstNYvgAZoQcUx/JWOrXE; 25:EGdDsirZA+EOnPHgz429a/BuHVEcz1j8ECyON3kTqTuy5XBjwEgoRGyPXZiCUxrf1o7jSY3XmQBHuxPnS4aAwxKTOSp12NN0Q5w3hEPZjpQnJmv8seiv7HUgNAAO9BPSneeYXRJMDBpfPrrI63NgeP9jmiYqOSqZzICajeCKUxlXUjsbtFviHgLOKTJ1NG5H6zW3vq5ugmZ63GwUydyu/kKqAA72jfVhTMbUSy4FNGGkrfaJkP7BIbA8M/wspwUy5JMflq3DoLqpFbFe5j9jhdMe5qWRBOpy6k/k6Ai2onKfLAgh4qveYF/pFoK4W4FRRqfXQo+M/8gZrv4s8wk4Aw==; 31:MXt9nZoEcwoRswFHVL4rbLyEM7DubODdshdgogIOOnyudD2cLyZRJxnJVEhg8NNUreZ+F0sz8mlzhuSwe/sYgKPrXsJK5RuE/Tgaod0Q9zONc5i/B6/qKvVRHNEDHBmQPSGCax7YIojQKEl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-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(10201501046)(93006095)(3002001)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:BN7PR07MB4898; BCL:0; PCL:0; RULEID:; SRVR:BN7PR07MB4898; X-Forefront-PRVS: 0730093765 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(136003)(39860400002)(366004)(396003)(189003)(199004)(68736007)(81166006)(8676002)(81156014)(44832011)(50466002)(6666003)(25786009)(6512007)(7736002)(4326008)(6486002)(48376002)(8936002)(2906002)(3846002)(478600001)(575784001)(72206003)(15650500001)(305945005)(6116002)(486006)(16586007)(2616005)(54906003)(110136005)(316002)(36756003)(476003)(956004)(446003)(11346002)(47776003)(26005)(42882007)(52116002)(105586002)(186003)(76176011)(16526019)(66066001)(106356001)(51416003)(97736004)(6506007)(55236004)(50226002)(53936002)(5660300001)(386003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN7PR07MB4898; H:ajoseph83.caveonetworks.com.caveonetworks.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN7PR07MB4898; 23:ksq/P41tsqVCxEIvE898i7N/DVYlBxlKDYNq6HHWD?= =?us-ascii?Q?lLBmSQKqz2yj+xMhIHhfbgkzv6ZBLpjjm3yFEWvYGQua/YA0XHEJiBY27Kab?= =?us-ascii?Q?Tj73hLYKYqDFzOEvcb5cjDzj4cmKovZ4DMwOlxneQMi90n7RMk5NFqG19tQg?= =?us-ascii?Q?jXiyoPXbbxbbFchYSGKrNRoHAAb5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ZE0QK9bEYu7oP3OUBudYml87rlksK3t+CUeU6gpqPxcWYt7ZjJ2bk8O/ySHZ8Qy6SH4rmUzE6tRWBUu8MuYV4sCX78g/Cq2idPKIU1kACyjvEgWtoqtRJtZpzOrW3GP7k2lgOmo+chdaOwmLtg==; 5://iZONchbjk41p9d5XIKqOReSeRF7ukvgqCX0YDRqIrtpsVl9b5Xw13sRfi69HpKVAuDR3d6QZEMefwQTIvKQaygKZfFe9EArAgAYu5Qu2FM25ZxtyG6/PwSHygij8Y7Cj4zA5egSgpsndQN5y9FGYGZARfeMT168AQV+7XZ+Wg=; 24:mosLc9IuuuMf+abQJDZxgFeWfWaFFDLt+3Hi8GL9lHXLuhWAkxFtpsRLKvbFMYtIm5kF5T77zjy78DA242FuP3xVGbNEbZkdSbEAOJVXFxY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4898; 7:oOMB7lFQ1x3IM0x/cxem5r+A5wQDz+rejMoLJ/dlaqCSk6549SeAV4zTuQdrit3JL0bwrJASzoEB7k/r+unVBMe0/CnkVZgYtwiyBKOqwQYZmhLde2OfRPQO1LaRfy5wx+1HiSp2RAUdP2i3Cbyb8Abop7ACdBOou1nP1dKhdn5ziMhf6RyO+nMOrybASTlPxpDhrCPJqWJlSWctnTyIhqOjUv58a0P3osA3GudQm+ce08KNbeWjf2gAjiUSFG/f X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2018 06:08:18.4537 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 48322009-acc6-4756-34af-08d5e6f4b39c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR07MB4898 Subject: [dpdk-dev] [PATCH v2 09/12] examples/l2fwd: skip timer updates for non master cores 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, 11 Jul 2018 06:08:22 -0000 The timer updates and checks are required only for stats printing by the master core. This can be entirely skipped for other cores. Signed-off-by: Anoob Joseph --- v2: * No change v1: * No change examples/l2fwd/l2fwd_worker.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/examples/l2fwd/l2fwd_worker.c b/examples/l2fwd/l2fwd_worker.c index 868d0c6..d6a5e90 100644 --- a/examples/l2fwd/l2fwd_worker.c +++ b/examples/l2fwd/l2fwd_worker.c @@ -111,6 +111,14 @@ l2fwd_periodic_drain_stats_monitor(struct lcore_queue_conf *qconf, /* Drain buffers */ l2fwd_drain_buffers(qconf); + t->prev_tsc = cur_tsc; + + /* Skip the timer based stats prints if not master core */ + if (!is_master_core) + return; + + /* On master core */ + /* if timer is enabled */ if (timer_period > 0) { @@ -120,16 +128,13 @@ l2fwd_periodic_drain_stats_monitor(struct lcore_queue_conf *qconf, /* if timer has reached its timeout */ if (unlikely(t->timer_tsc >= timer_period)) { - /* do this only on master core */ - if (is_master_core) { - print_stats(); - /* reset the timer */ - t->timer_tsc = 0; - } + /* Print stats */ + print_stats(); + + /* reset the timer */ + t->timer_tsc = 0; } } - - t->prev_tsc = cur_tsc; } } -- 2.7.4