From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0049.outbound.protection.outlook.com [104.47.36.49]) by dpdk.org (Postfix) with ESMTP id C5BA01E43E for ; Thu, 14 Jun 2018 13:50:25 +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=iiA6PdC2rDWACp81Dtj6YEqSpQi+zdrLoKUppo3MYaI=; b=dfoAq3v9xps6p93Q8LPbB+oSEgsCS7/MGsix8cPilF7AkWYaMBBFvcp7PN0XCRxkRSaBGVWREIQFgZRGnarTbwewchF3T5KtiHb8Vd+P8wfj++Znz/QccS2Icw5nZCOIVQ5Asb3EX3dtx2zyiTrj4VO9JzxIGNTU+MStrE9zkKY= 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.863.16; Thu, 14 Jun 2018 11:50:22 +0000 From: Anoob Joseph To: Bruce Richardson , Pablo de Lara Cc: Anoob Joseph , Jerin Jacob , Narayana Prasad , dev@dpdk.org Date: Thu, 14 Jun 2018 17:19:03 +0530 Message-Id: <1528976946-14396-13-git-send-email-anoob.joseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528976946-14396-1-git-send-email-anoob.joseph@caviumnetworks.com> References: <1528477766-15788-1-git-send-email-anoob.joseph@caviumnetworks.com> <1528976946-14396-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: PN1PR01CA0095.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00::11) To BN7PR07MB4898.namprd07.prod.outlook.com (2603:10b6:406:ef::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a6b579c3-76fd-4552-4304-08d5d1ed03f6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(711020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BN7PR07MB4898; X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4898; 3:VZOuz1OSLsmjqJvXTAsMO1ZgWpA+DSCMRifIWyun1dEBAdM6tOKsI1tpFA+q83gjVjhUgbAYA4+cCDxwmPNACYCXRmVLPISzksKRCgnJ4aHWcsDo3ZG7yeWeVvF3T85hu7J8hrrhlj3RrcvVMgJiDANLbZ/LTCEy2YJjNkeMNEK6wiqp14N2R3Ai7pAq92DV7cd4ZUrT7qFbDK7RLduaSBcpz3KNdPtiT3jH5PSk60/D1NKPiwjVa7ygBJ95EVL1; 25:kmUZ3wPijyMgNc5qM28hgsKr4LNC/aeB3I0XjxOxySvOZ4WnMT3AvMuqGbd1qNJb8fki2OKFaDFQR8UkA5QlHpIhB6amwvv43Cny1t+7pMU4mUJX66Wxe6/WJcGccfFb8PSrGW6qmcEpaY5dsyjUNu8/kyptyMBEvXWavQpjL9XPq7FcWgHjFzAU+b9y643R7faagLATcD1ffOIngvziD9NPCgFzSvuVZ+AHSM/37KUYYeCJlQusmkHv3vtWsc1VGscsG7aloQ27RYif+vjza3DGAdYGDg0T9b8RyCwP9Y3LOQDmtzoxG6zecs4hyCJauTgo8m1XHkKViOKNE/T5uQ==; 31:crRQv0TsCYpM5U/gvIvN4RF1R1S0SJCkskgOt6Y+vjQRNv0M/qJA6RVKER0F24SfMuZ4ObQMLsyitVTZKD5pVaLG64f0HlcKsYGppc7V/evzPuctJMm3XtZyEL1+WTCZfF+vJKxX3NnWkZtty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am-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)(8121501046)(5005006)(10201501046)(3231254)(944501410)(52105095)(93006095)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:BN7PR07MB4898; BCL:0; PCL:0; RULEID:; SRVR:BN7PR07MB4898; X-Forefront-PRVS: 0703B549E4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(39380400002)(396003)(376002)(346002)(366004)(199004)(189003)(446003)(956004)(2616005)(305945005)(6666003)(47776003)(476003)(54906003)(44832011)(53936002)(68736007)(486006)(110136005)(8936002)(8676002)(81156014)(16586007)(316002)(81166006)(25786009)(4326008)(7736002)(15650500001)(6116002)(3846002)(11346002)(97736004)(36756003)(106356001)(478600001)(105586002)(42882007)(52116002)(51416003)(26005)(16526019)(186003)(50226002)(66066001)(72206003)(6486002)(2906002)(55236004)(50466002)(575784001)(6512007)(386003)(6506007)(5660300001)(76176011)(48376002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN7PR07MB4898; 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; BN7PR07MB4898; 23:QqG8jPgiyzAvUVKYwTtT/J/vcaeT1vvm3g7uAhLJ2?= =?us-ascii?Q?+FtrF/A+NKyRPBoENkoOwO0sOu8ihP86UTH1uy1yimf9E/WLYXAALg9N1Nyg?= =?us-ascii?Q?WkhovTIHI8xn6XJqNCKF/dzBpyz+epXxm1trU9dYogE0BOHqLd7EpFpTHLGL?= =?us-ascii?Q?g9q+DeH70irGNtANm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b0wE36m?= =?us-ascii?Q?I33h65TLhzeEv6+uPCiNcL6mA29y35bPf6NtmCMwDdZUHCerpofI+YlKr070?= =?us-ascii?Q?94jWd9dLdklJo6tcOsONyTxBV36KZwetvTjW5f8BN3h5jD78r3xIiuCX0vDg?= =?us-ascii?Q?Tz0/hYx2hXTeVzqCdt7i6AmArjt5tmKK5PtkHLIPXNVYvOws4w4y5BRJ2JpR?= =?us-ascii?Q?Fw98BF8HyMl9gZ+V35hyd6Aq4sw76iUHSNSaP2HN7X8T17lP2zurhtQDhjbL?= =?us-ascii?Q?GCVm0uQZccgs6UumOBD1JI=3D?= X-Microsoft-Antispam-Message-Info: rzpl2+73F3W9PVS+tX8Jea4eGe3LHSH22kokMAPZPU8fyLGCZIqFUVISXNt+PZMmutDlGEv12E7nCShactJiX17JzMOJ75gTyHU2CyNNSk+V//FDzRYuAiNzXoA1dK5zkWr9OMixE+yUo6BlLvLIs2aldhh3HnPtK+Osh/VxrOVTl53dNZY48org4PV5dwfs X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4898; 6:ZhPlpkJMCkl5sWdLi12XdykwuUBcgrqhHt2TMnjSOA/tqm9BrTZ6CtsmWe73lEcDxhvy9dohRhzfwmrZaguqimAnDhJ5ZvUU9OrmMA/F6rlXEeRkzzSeJVZqzHUa062iu99pMb7GSKLlBgCWZjfyN4pFqqbiyqQT8SsWOsE9TyUkejatRY9ZU9MeUykUYYjIKC5TbkdQLu2jLckleHpIimniMV68gmxdwTiOb9Z+W5+K/wZc3TmcZ0yGfwxlbmYCcOEHkkuH4AEvBiuCG1zsA9U5u84MGaiJc6bikKzDfJNG4QW0HelS5GBfi+dpS23js5vjK5RFbi92BLZUNl6DsBpRQEX6bwxE7TkoZN0sE/YzClTbrQd5MVq26BbGX0mlkUTPSD8fPk/ihRa3hb4suCpmd4h4sKqD0aUt1jbVMNHSf/SeTJi7ArJHSVM0hHFSfbmHCaOOk2fyKpVwgBGLfw==; 5:yCp7J2A5+UsGx/YU1hMSOvpiAU/oe56mrihZWmfG/t+y7euyrTnGEljKMp5pXQ+PLDXOPFsBlCqlrWqqVbQlGwnABqyfWe4gkidx83hBkSgO+2Rbjrkwtned6qq9toi9gc5+8eGtzS9mhDFLh23c6cYqfJdIquYapsMGQOraMEM=; 24:SCwBDgk1INSKP5qYkhf8BVkIGUMH2nM3r9F9Kf2vkuRSxql3QnSs4moGJVJ+WdQV6Rk2x95cSYzfn1+xiUw2TSuKugvOHlnJq7KYbMUxF1M= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4898; 7:Z65OCurXNlrfhAQP+BIKgAgrt/trVtDc5lMeHsOkCAHhOmudFPa2KWe4m7Vt/Ai6NpI9gogri91ZxBBhtNmWUGKFQmT6/RC6E9x/llD+o3++L9JdJf7CpFh1HeafaLUwV2WRdN5oCS/nEnEw5AR0/Hg8TDap9lprA/j/7/NAsfsEJSSDcawZokvfETZHBHl8dhrSnzqTAbu1eUNqDLVbmG6FGAau8tQLbtxl3NY18tgd59iNFRenepZt4imILVhh X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2018 11:50:22.9375 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a6b579c3-76fd-4552-4304-08d5d1ed03f6 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 v1 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: Thu, 14 Jun 2018 11:50:26 -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 --- 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