From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0079.outbound.protection.outlook.com [104.47.34.79]) by dpdk.org (Postfix) with ESMTP id DF9921D014 for ; Fri, 8 Jun 2018 19:10:52 +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=P6CbUHIcMqUXgIhK6kbG1sPsZPYCfNx5ugGfQYdef6s=; b=TUs7K20REYwB5zetIPu0l4FyzEsu+Tjl6ekd9JxrqCn8yfielRmM8HVUKsD7LnSpbhjevh2+I5b5tRTYYaSLPM2F14+b4RFiLzXWEe+prYcVNoKBzVsjNYdqthQMQqZzqYiZzswbPzXe5GrGrDjvcvyyLSlkrG4FwI4wWMHS7eo= 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 SN6PR07MB4911.namprd07.prod.outlook.com (2603:10b6:805:3c::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.15; Fri, 8 Jun 2018 17:10:49 +0000 From: Anoob Joseph To: Bruce Richardson , Pablo de Lara Cc: Anoob Joseph , Jerin Jacob , Narayana Prasad , dev@dpdk.org Date: Fri, 8 Jun 2018 22:39:23 +0530 Message-Id: <1528477766-15788-13-git-send-email-anoob.joseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528477766-15788-1-git-send-email-anoob.joseph@caviumnetworks.com> References: <1528477766-15788-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: BM1PR01CA0111.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00::27) To SN6PR07MB4911.namprd07.prod.outlook.com (2603:10b6:805:3c::29) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB4911; X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4911; 3:dS8zLg7QdnhDRLdMAOOe78blvQ1ICoQialrxG5ecTNLkMcU/J8KjpHKYVk7ofs2zMY7TrtkHkT2paKLvjX4jDMdYbrQ3rghM1BFAlCUSTHurIN2Zx47AlZ8I5/1ryN562owBrsW53pz2ScmVR7AzOB7sSSJNUQ640G/VsbTtNte8g0mXiXxNwPUPRROwg/Y36dbIVWNCApLpif5OKQh7gJWqCf0r+8A5QJJN3bxuw3griLZ4RTRgucZfjNrB+wxF; 25:j8fWJKnvkvEPoZPDmRmS3UMbx8I9JlzV8aiq3GcM50r9E7YiH1Th8drcDemooA8Xiq9Zl3LfWUojQjiwmZWcarF8QsX2czhzJg/fnNjNWPDZtyahJeV5Q9j1wiu/oT8UX9scOha9IakPyf1SrbKwQg84evGQev8yJ0Z7VSU9dyN3/i8oPc1PvKapJsC4dNd3f0IYl0JIHrbvvOdjW6mfGaKYYbizZvWJ+pfz3r/gpAeXqvZC7X1Lr6LeHpTyXq/Cg05cZFCW5xnkXayCsuqKZp/7HcEIezH6jsgIV23P+qCm2cgWld/+1nJiM9pygCEY8Qoz1WdM8A+M3mmc+ibSNA==; 31:e7R7AEI7tJJnLMeGARxB8BXFmA+QJMyMGHkC0PQyR+GWMoIoqqPtQl5w+WJQ7ZC2mcRvU/V71uXlpe1KRuQF0tMTAxf11a85eEx95NPwjW90PBYvpuKhCpSZMrlwtGl7Z5nQacEsNqEDszqiy8fKI0tLI+/ontHqcA8D2LXN5xZoXMceWMyx4RhAoKvCy8c+n33iLNjIpLcYf/DyYiPWX4UhINxoVTp4vHAWb3ci42A= X-MS-TrafficTypeDiagnostic: SN6PR07MB4911: X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4911; 20:y1oHkw4tplr4OI0YpUy4on1UXWCDihWFMvma9j2b9Qn+s52VEUWvtouNxlz0s4zFv/dxHGeyxxxg8f/oiwlq5CWzYcT2Mx046ra31Cr0uKmxjnVaSTUy0mXqNGYZBqV9YeymuZpvMSQhLwKx54JXtniEpEDeNZXAXmOPMnz0WVtx2rm1/60wjKTz6NWlvHHJhyJM++2JGDBAlh5PUwg5OOS+zjwyerc7yoTORrMClZtbyQdqzEWxIvjBirS6Nchbq9qRGuoJYA2exZ85U3WUUrzTPCmxXwRE8jfeXYv23kpyuYmozzxes6U2o1PSDypI4QSVKJgy50hXXBKF+6NpOon7ZWZLgA0iRp5FZAAjMcCsZke2avyU3vOvos/69rMEu/ZRlYyagDlyIpkW0Vd4VpHFEYbys7ABSN7O3AX/c77QweKivjAD9HZ6pHw36+LC6lTra/50BwG6jozvA9xEi2htvYLkqe8GylLjBK88vFLvRtfWVmCcYRzvbLE2n0Gxhf/iGm9XWaLmgM2U3qoZ+f/y6ivyJMeZsoI+Vr7ZE6JWRscx+Utf7NTL+8kv2LhAKX7Xp5qmG/LiJo9av0DapkkUYKJ88cPltx329PgJ38Q=; 4:ODLxyRhdD4HuuDUxXaxdxMl/m17JRWEWlmmYtDVFSXeH2AFj28iZLmN0NQOr2WYNsvex76FSYISUxXswaZ3rSA31hZb2kdvUV61gHYNc0er9ZpDIi7LCGFJZxWxbCUtQ7uVj2gdDxbKzvbJ2hXDKcS322OELre6rZ6yHGUE0efjEcdinPw3MtuX/CfhwIVTgEqP2jBF3sLxW5Ub0TRDdE+WchZhVpXki6Y66QegSPVKfDI9jl0v11jPm5NYPI+PFBJe5NHEePl0lXv7mhwCX+g== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231254)(944501410)(52105095)(10201501046)(93006095)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:SN6PR07MB4911; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB4911; X-Forefront-PRVS: 06973FFAD3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(39380400002)(39860400002)(376002)(396003)(346002)(199004)(189003)(6666003)(4326008)(54906003)(76176011)(5660300001)(25786009)(48376002)(50466002)(446003)(15650500001)(386003)(186003)(11346002)(16526019)(2616005)(42882007)(44832011)(51416003)(476003)(66066001)(110136005)(36756003)(316002)(55236004)(2906002)(7736002)(81156014)(81166006)(8936002)(50226002)(106356001)(105586002)(68736007)(52116002)(26005)(956004)(8676002)(305945005)(53936002)(6512007)(47776003)(486006)(478600001)(6486002)(6116002)(72206003)(3846002)(16586007)(6506007)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB4911; H:ajoseph83.caveonetworks.com.caveonetworks.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN6PR07MB4911; 23:CAAS5YVEvJzcHlzQQ38+ike9rzI+Bwt9acBSRbt5z?= =?us-ascii?Q?LaRH04MDwsfA8x/STqLtIG9WHLfJz7jCuEhbX0c6W4LW8YIls5Q868gMruk9?= =?us-ascii?Q?HawINsGMgmyYECsCkPr5csjjbLLLRitIsiJ4uJNyWhFQT9A6XyppVwzOacTJ?= =?us-ascii?Q?en1yhIs+0uFoYaV/Bvi/QXaMB+LZxkxyc9eK+fX2U2ZSt92RjGWxSilU2dp6?= =?us-ascii?Q?yp42c35RETGjDZWyiC1CQmawWkf7+EdImwrumq1i3cvveZJZPSFvB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xnSmUsnQ0wbWoyz0X6rGvhk0=; 24:G75vPuxjoBhrn7UxSUanJXaVHILqOXFlO7QV2v2/JeXSxnPFK1ORcYQNFk9rVo1+dPFsYW5QAhz5KUGvSUbKy1cQ1MgXYg5iz0jO1b8VH1Y= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4911; 7:task2+B1CyWWkCOKIxQdyZF+3nzt1J7q79OcgXEXQdzQNLoaVeErirgrLCwDrKeN07h9k+8mV0Wzye2o2EOhQ+rVn+Stf+wbV+tcS6TjzUqP82ApJ3rn97lk6AnYZj/vOYwEcLIAGbXEMUpgdk00FwtAz50kCzUDwqZAzxd4wKjCm5IrZDi1XMFOUMn5y/9OcRKPYmi19ywMET2rm/4QcCSWtrdBVjbE7JbDFeC19hU6Mfh+gwpPvsveXUpGhpT+ X-MS-Office365-Filtering-Correlation-Id: ee17abe7-efa8-4018-f6f6-08d5cd62c983 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2018 17:10:49.2095 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ee17abe7-efa8-4018-f6f6-08d5cd62c983 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4911 Subject: [dpdk-dev] [PATCH 12/15] 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: Fri, 08 Jun 2018 17:10:54 -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 --- 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 231b849..9ba78f6 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