From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM04-CO1-obe.outbound.protection.outlook.com (mail-eopbgr690085.outbound.protection.outlook.com [40.107.69.85]) by dpdk.org (Postfix) with ESMTP id 4AFDC1E954 for ; Thu, 14 Jun 2018 12:19: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=Z85gGbxiN8znr8SG0/EyP+cSao4+PqpNNh9K4Ul27mc=; b=QJTUAqwnXN/AYKvIVqXiwgOzqINQdWQiDhis6JljhfWNDMbJhfX4wlo3oeB7+UqTDK32CNYzPydXOfa7TdoDzGuX73c+BHIwiH3joCO29kNaL25K2rzNVIExqv/qeKqRhZKLl6kvvad4pyrrVfRXPBJE+T5axt6KYPLM8/CxvKc= 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:17 +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:52 +0530 Message-Id: <1528971477-14156-11-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: 8aa55427-bda3-43f6-02c8-08d5d1e04aac 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:sghYCVv/A5hAAvA06yYpvQOGJgGF2qkM8YOQv1Wd5tElJP+RjF6rNdo6RuMy2VZMxt1Xx3q+Yt9J3rLV5PrS7Sqh6M8WSlyThJnbzhyDvTN30ESwK/faeMrg66WmIyPcOB68pRLTelxdx8IoDwG2EvR9OynyhZufBuixuXch/sez+OQ/8QBohVV4rZSZ1FYsqDpXYPSxb8xlJ38sCxmFNq6OD/lo6vYMpgvjfddOdB87myVbYAZauRn973SRryIi; 25:D1UqkQwfYcxnZqMm6PdNozvT1ZyVbtx9+KyjHnJ4+ISA9GAwplxZ2Q/wWimdmsmW9VdsXA+r3NSVtSZHj22WcpdKbPm2WEGwAkiugr6XB0aS/UI2Mc023X0E++yhNX08hFJWTjZOTwl3Ewufs/40/SmutPvrwbNuu8OpTpwgSkcr5V4nTWfP4h222PkrgXkN/ecV2zUgmfYcfiIEYu3MNqWR37SQNGihrmoSpuqOTqCNXrwcloDkyneTF4VhpP6oD3rWxytu4Apsv4iwzxgWztLwW/3PnUr7Cw8owvwVwB/HQe8WZIZMZhUe6jTWTRUSlTjOVlJ2wrB46vwSyjdyzA==; 31:jR+QZMQOGyvgOTe2t4AsEItRNz1oTZiDwygMyqOUhDYcUbpcuDRaY178ugn0suZQUpsYuYbQyEZWvU/qW95qeE6MnW8E1t2LcU6BYc7HR5773BHkQZUz/GSJ4tdSNMQ+EQY9NwArE9PbeUT5isD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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)(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)(66066001)(54906003)(47776003)(6512007)(5660300001)(50466002)(72206003)(48376002)(97736004)(6116002)(3846002)(53936002)(16586007)(105586002)(478600001)(6486002)(106356001)(6506007)(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:kDvz0JuaVGTU07G7QuXcWjsv20Beu3Ets3tSTMfTs?= =?us-ascii?Q?fyaNhexUy+1c3roO+P4IsuhcudY1iILYvUK4cCUlYLCV2LXQLUUxKMwyvGcI?= =?us-ascii?Q?QkGRQErcfv2rviYYums77IUQPpuiH0jWjqhBvMuoj7xZ2//Aqe2E+WS1bMg4?= =?us-ascii?Q?P9wbLMt52BzG65e9nSKlxTp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rlvpR9nYUDkrnimA2i3Z4pnWAah88KG8+/uHm6kqx7mZghCz43qIZRpvlf3+/bZoLrkNnRxyq6uj+9mmdfK/Yrk=; 24:CYokUyTcZQ29PLBidY3YW+rLQAblD8o2FAUMuZ0Ai1Xtol7PaEGnrQiKvCtyVKaFphG31a2pknO6imU2nBJlLlgZQSNigmOKjvPy71WrUJU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4902; 7:BlL8ubAA2s/+xWfc5T0MFHgtCy+v1Fqh9AYYzmZJg2wmD6BFn31Um4k4uvP1YRfEgfqY6ybGcmkFZL00TJB9hXYBwBcvf+ERO6Won489TTXy8H0zZVaLTNpSbgBFWvKL/HJ/XY4au9fwdC8O9CHI6iknuTlBken16ov4S0vSfpmg9suDQ8mNrrL6iMkj0sTNN2XpNQowJIWBkCayHRmCDWawKBSAKm9CkyDUnyGIDSk9C0OlhdCafIqew/Uh6xjy X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2018 10:19:17.5183 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8aa55427-bda3-43f6-02c8-08d5d1e04aac 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 10/15] examples/l2fwd: optimize check for master core 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:22 -0000 v1: * Replaced 'unsigned' with 'unsigned int' Replacing the check for lcore_id & mastercore_id with the check for a flag. Signed-off-by: Anoob Joseph --- examples/l2fwd/l2fwd_worker.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/l2fwd/l2fwd_worker.c b/examples/l2fwd/l2fwd_worker.c index dfa78ed..f847832 100644 --- a/examples/l2fwd/l2fwd_worker.c +++ b/examples/l2fwd/l2fwd_worker.c @@ -135,12 +135,12 @@ l2fwd_main_loop(void) struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; struct rte_mbuf *m; unsigned int lcore_id; - unsigned int master_core_id; uint64_t prev_tsc, diff_tsc, cur_tsc, timer_tsc; unsigned int i, j, portid, nb_rx; struct lcore_queue_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; + int is_master_core; prev_tsc = 0; timer_tsc = 0; @@ -162,8 +162,8 @@ l2fwd_main_loop(void) portid); } - - master_core_id = rte_get_master_lcore(); + /* Set the flag if master core */ + is_master_core = (lcore_id == rte_get_master_lcore()) ? 1 : 0; while (!force_quit) { @@ -188,7 +188,7 @@ l2fwd_main_loop(void) if (unlikely(timer_tsc >= timer_period)) { /* do this only on master core */ - if (lcore_id == master_core_id) { + if (is_master_core) { print_stats(); /* reset the timer */ timer_tsc = 0; -- 2.7.4