From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM04-CO1-obe.outbound.protection.outlook.com (mail-eopbgr690061.outbound.protection.outlook.com [40.107.69.61]) by dpdk.org (Postfix) with ESMTP id B1ADF1D02A for ; Thu, 14 Jun 2018 12:19:27 +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=q5eCadllLcjZvLy71mSLtvPz5adRAR8bn4pqhZTHRWk=; b=KHWQO9y3m43D7TANzZec2iMdlKsTv+y9KjSKjK5KAkUCUwfiY3lpkD47m8baI6kufhgv/3ds2i+qA7z0CoHg5uwAbpmg18r6qGP96rrKohK5IoIt1B2aOKn+qrmL6JafWhMTU/pyBHCWBBwmDIp5SpQfnebieS++jp8dufITY/0= 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 BYAPR07MB4902.namprd07.prod.outlook.com (2603:10b6:a02:ef::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.841.19; Thu, 14 Jun 2018 10:19:23 +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 15:47:54 +0530 Message-Id: <1528971477-14156-13-git-send-email-anoob.joseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528971477-14156-1-git-send-email-anoob.joseph@caviumnetworks.com> References: <1528477766-15788-1-git-send-email-anoob.joseph@caviumnetworks.com> <1528971477-14156-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: BM1PR0101CA0031.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::17) To BYAPR07MB4902.namprd07.prod.outlook.com (2603:10b6:a02:ef::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7fd93beb-fcf8-42ae-d752-08d5d1e04e4e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(711020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BYAPR07MB4902; X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4902; 3:1HgZNc29OF3k4/EL8njJmhTP9UiU6cZaP2yRXzSqEp7XjwwECKqHqf5hrSogJPtQEWLrYqNMqb872DQ0Y8kwlK+2neDhZJ1m5VVa+yGikJj9iYONLD95tQ60hGriwN4Xm+1XaRBEX38vXaDRkkRh9qrU7giwNJ/aHJnsFmPr4qW9Nzjt6dpmPlTPJU6PwN9L98C/clGmcZJpswrKHhSujCHf/Z0r3/sVUGeJqz6/moyhvQjAXk/RrGB2n6FJefbM; 25:tberMfqtrSxOoGTAY4vdZ65I0G7sBxLFFAKNkKe01lHDeThvFOYqId+RaNvcAefkE7dq8ijjJ1LyPO1fDhdIq9vz2kOtnIBpOxuIJg3tBdMBRTWhi9U2gcsFlJZSbEAUfz4YnPOqSQzQfoSRSwxmKfVE+Qohqz3YI9rUfIO2QA/AXus21yJmiaJpJ+xDNjlowpslI58G9RQ3crdlOLUvxBryNBxix9a/wvdcjH0acWOywTBLvKB1kvZQgkEJpQ4EsLV4kc+sgs8QafQ/3SkEnxJu+F8dGjpWJcYGarKx/hNlSHGZVFHNnjuy3OBnErlwqkyjInmt6CiAA3vC/nBVEQ==; 31:kG1HPYY52ciZj+PHIAFnLSNFmuJadFLNDyq5koMRRPZbpU71d5BvDVMp2Xcaeep09Cnar7dSKdXFUlAPGgEeA9q+IuxAR4pujxEzOfw0FqykejSGmAvZOLIQLqH+2leard8fiAyGxDOsPOa7Q6CU4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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)(5005006)(8121501046)(3231254)(944501410)(52105095)(10201501046)(93006095)(3002001)(149027)(150027)(6041310)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:BYAPR07MB4902; BCL:0; PCL:0; RULEID:; SRVR:BYAPR07MB4902; X-Forefront-PRVS: 0703B549E4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(39380400002)(376002)(396003)(366004)(189003)(199004)(316002)(6666003)(110136005)(68736007)(2906002)(15650500001)(66066001)(54906003)(47776003)(6512007)(5660300001)(50466002)(72206003)(48376002)(97736004)(6116002)(3846002)(53936002)(16586007)(105586002)(478600001)(6486002)(106356001)(6506007)(575784001)(36756003)(11346002)(956004)(25786009)(4326008)(50226002)(16526019)(186003)(81156014)(486006)(81166006)(8676002)(7736002)(26005)(8936002)(2616005)(476003)(386003)(44832011)(55236004)(52116002)(42882007)(51416003)(76176011)(446003)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR07MB4902; 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; BYAPR07MB4902; 23:UXuBSHV1hG+3S5QiuQcrftVI2MaPVrpWFZ7Adn/kt?= =?us-ascii?Q?F7sRyGaJoItv9k+1eII3W65nKyUfc5iL+H7sdbUSeKpw2pZTGQAnNed/Mdag?= =?us-ascii?Q?D/4bF7XI3dFJgMQV4gEKyoS4uQR3zs6SzQSAaq1aA78FTCw1mn8GS1Bc74wm?= =?us-ascii?Q?kmYGpJ4MSs/Pc90Jb7GF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vKVRm31/a0RyiGZgYipacRCAUQC7APVtylbOB22F/HoehLFNDtzkqW5Ftpo1iwFFlPL8oWco/prCpdR1pZzIHVdXk+arO0ys8PZlFQ4J6X0wpVmrJkLhuQ2HWTNZOd4uYVIaKhww+0YHIKVL5Epmk=; 24:aJYAGiou+ig8MJ8+SeAH3TZWmwbhn6O5WU53/Aki6KYJP74M7rBYJv0oQaN0O4GPaDZzkigPY1gA8sQYzInK3mB/OSP9npuEeeCFLv9Cl8A= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4902; 7:Kh769tWIMppsqkSrY3kB7GCTZHQjGibZ/x7f0BX+FwGImAKsYKLOwvo8Yy9m3SHlPbQjwDcyCCjVep7qDmlJ17TxKBJ98+2IHKpBUfn3o52Up7na0vngmDqQjqqok8airU/Jdbcbm+avXwaAqoEpDEeHDYphWYfLTz+nXBFOqa/WB+tO85TtU4fSiAXrjvOWouAKeKegMDbaoHvXbMldZScnP6jJmI3BOvUPi2QdWi+aAI5jYu/zVdvl2RSGQnXF X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2018 10:19:23.6286 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7fd93beb-fcf8-42ae-d752-08d5d1e04e4e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB4902 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 10:19:28 -0000 v1: * No change 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 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