From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0075.outbound.protection.outlook.com [104.47.34.75]) by dpdk.org (Postfix) with ESMTP id 3AABF1D00D for ; Fri, 8 Jun 2018 19:10:47 +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=zFCsW9at6+WG8f1dC2UxeBBuQGkA4cgHveOqSix7x04=; b=hUqJthH8VkFHHifF/c/YSP9kEdvRNZEUPfbODXFXkzus1hJScjiptiULtAPD3O+lxKsvXDRkrCvwFPoUAi1/wooAwP+QJsMcCQVN1jx8xri+ucCf78pOrsiZpSG8f+TS3CfBLDs4DmxsbEska4G0D4onaDI/bSj5fk2Jw9WpsaE= 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:43 +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:21 +0530 Message-Id: <1528477766-15788-11-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:5joQhjGA6NOd2Z7VLUH72+2l4OaB3oJCsGw+TF1Gp9hf1XtnaFoc5IzEQiB2f16iefVZk79C0PgcF/SEs/nKDKh2y1DRkkFGO+TtrkZcg5IxS+U9cxqRGX2ce3zT+STvAYKY/5U8/s49jZN9Y17w7JjF0/zP5U2FCCdrR0GkDwnJpVBGH9bV7lWLrUDqMDhHLyN6+gO+gNL0J8PC6imvlavVtQPpCJVzu9F+YyGTmcpb6UbQFjDM1GVgUBI+AKVW; 25:eiPxJg0C8YzhD1dB0zDuj6H4PlBOZP4rK2YClfQHoxUDWFO69XYZzNW2KEdA9Wa5imNqU0kpfcnhxS8K24D1sTuzqshgS7cW3L1xkqL9GrMY5CDMbAD/+AmflLejbFx9FrzGdYWT5M2E69t1lt5SLbl+gY2szo+ClgDNLJvuiS4y4FulIhfmQy1dNX8iQ9+pL/zmPZ2oWEM0Eh6ary1BXFDbM5pOC6eF9gyOQEjJ7hx2ksC2+zEfFzo1CwwPWBSLbqWSMb9HAYegK6KgVerZjWzpwvG+y8eSfJq/u+0OBOJe8MsDc9Yf4xxx0r0f62e2esbpTa12zqYfNEfoNZ6Qqw==; 31:bw7BzrkH7h7TYvoqNrrnKbud6c1AzCK/guyjMhZLkX5/Nr4q+Gk7lmx2Rk+m3ocrctF/qj8bs0sXyEC59/C0PI8Ts9Aod6JIROCzMPcX3J6PS3Poidm9EHkdJF6BrnB9/27F2ljUMj8aeWh7lBViA2PiL4iGD6f/FKfwUc5MiVLV7OBbdf/NGJHuRyksy49t2hxBJrvTmCBVvnromkomrygYDdmOt5E+LHyh6yc9SHA= X-MS-TrafficTypeDiagnostic: SN6PR07MB4911: X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4911; 20:OzXD9iNwRT/a8v5NmXelowO9977LW3nfLwSFUDCo+WcMNtisLVScjCtCaY19BSr59N9PFeVBKIp+sqAZ6hsXzBA13529rvokEp4U7ix2GZmc2t8LDLAMDJ+0z41vYsaxWj8a93qeLfOd1J/lvrx/gXqaHJpH2MP00OORkXmjWKFaf88jLh/eJXACyGPbTAqnOb6L9iJdzF77TJZKB8LXo0GfT+4NxB3te8tKxx39RqK6/INN0AoRB2/zh/n15IToYjMl84GDuZUR5aCCnXvsHw5MWRQWwCMZfg8cmdkuhL9F2PBkkXr8gXafN7vlCU7iEEg1/Ys6SN4t5r2uPxwJfH+s4aTgjYSqH2MxeT6fMdfmfDwC6rAIHFtAIMC6LS6iySpp04CMBLJoyopMbeCy9IJC3NnrsYEUAecxEVP2fbIdpajmZDwA5HsdLlEfi2MxChDk6MR8og552YrsuvkcgMQNhSgMETLHp9zq0DY2/M1ttQgUn3UiC4nGrN7JIv01ZMLh16jnveZFB3QGI7E0tUlHSt1elc6efV18TvgW1ygiHSrPPbI9KFwc/bVWL2+d0awGRMl+x8tZSJGwvyy/ymuFpthkjFus36oWQEIpTzU=; 4:0S0jZwAn1cJP06GlhVvVjNR7w1xQd1fjB5X8dZjn2QGzt1c0ZL+q+BLEYfbZMDs4tdOV6ikX3W7H1MjpJxJfthjbPuFOLTHIUDvlgGnq8ragybve5DVyV9rbaKbOmMUaolnVl5e+zc3SLnjXJX2P1B96nuC6HqGBijuCnNCum4XPY1+rWKk4aUg9Vb5ijzO/WKE+SY9NQzZG5tqsqJLCDqh76lSZtTH+qr/mi0FRX6dsytpOVuEMO6PVWc2BQEUqVeP3ROotrunDgA2dnxtanQ== 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)(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:8wmd7xty58u9Al2iOztXJEXcQSykwYh+oYuZZMACp?= =?us-ascii?Q?TcWJVyQcjoRYDtyTEN6s2qkUTbULPkfAzIPqe2viB/xzCMFSKYsDjLeT5JJU?= =?us-ascii?Q?yYKLera0lfmGid+3HNkxjs8ylGzJ9Au1X0NLXvhyo5oatHjgtJzGSA+gDvwh?= =?us-ascii?Q?PwdLKLrOJPCbOR3W3Hk0Ts4hetaZVx0JvDFbYtN0t8M7YJ3vTFirzgDVdccs?= =?us-ascii?Q?+9QdrqPFa/cLae+uu/klWVyO/ZWh72wzbyUeSkOs62cBfTU+M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5soTbpVXyl7WOZUBMYDy90NkzmyLoRHls09Ape+hquaZk2NemLTN6aQxRy2XroBUV6AO2F4bhpmNNWMw8MAXQBRxvVbsDshU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4911; 7:A3p9nqtKRu1O8RBBe0xkBXxZbS1TGfiQ77PK6MiNNKjvQPAN9E3kaX25aEvamARbe2MuSaRAwnWCGBY8c+nKdpUDTR8eJOoaIuq/q/MD1BBGgYJkxZc6n9yFIE/BCYkst0DMmYUW03tbuj9d06PZi4YpFCjkF+Ajzqj3F8erqjOR4EFTjDqCyHhkvOTjpnwNqw5VwbiouziGbZ3VoZS+Q9BlpANxM7If0geZUn6tO6VP6oSfRpWxhrKLkjvTlpsD X-MS-Office365-Filtering-Correlation-Id: dfa3aad0-b064-4380-b911-08d5cd62c635 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2018 17:10:43.6596 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dfa3aad0-b064-4380-b911-08d5cd62c635 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 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: Fri, 08 Jun 2018 17:10:49 -0000 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 ee2de58..f73de82 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 lcore_id; - unsigned master_core_id; uint64_t prev_tsc, diff_tsc, cur_tsc, timer_tsc; unsigned 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