From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 52CCBA0096 for ; Mon, 3 Jun 2019 18:51:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A255E1B9AD; Mon, 3 Jun 2019 18:50:47 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id B0EDE1B9AC for ; Mon, 3 Jun 2019 18:50:46 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x53GduVv031506; Mon, 3 Jun 2019 09:50:46 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=AC/59OI0lJMluuOqqotyVsKCQZ0q8g8tU+16VXPS95g=; b=S7Xtz3vLRCVLbVfj/a8q+LWOjjhhwjQPaSlUWcDDuFNK97WTU2byxoML2rfT2SNS4DYx avG0lxJ7tegU+GHCplATWAa7nbkAl3sGCFTLvLeJEQqqJv0mUGVTltymxIJcxXMddXyH 51hY9YkEUihOmp8u+zYcAOlwB25wlDGc2llsIvgHgQ9J4NYYA4FCfE552ALVIY/VJl18 MyceBLfWD3XLLTBldygGuvDkmzBVy0ziE0PQLmaXyUh16drgmX4VJn6A5BmK3bJA1/R8 MAx94SoYX0heEln3FuDP/8vt19vCzoELhb7766s85/2G2Q0w7ENlrtBlutW5GK15sHVm MA== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2sw2wmh707-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 03 Jun 2019 09:50:45 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 3 Jun 2019 09:50:44 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Mon, 3 Jun 2019 09:50:44 -0700 Received: from ajoseph83.caveonetworks.com.com (unknown [10.29.45.56]) by maili.marvell.com (Postfix) with ESMTP id E7B8B3F7043; Mon, 3 Jun 2019 09:50:39 -0700 (PDT) From: Anoob Joseph To: Jerin Jacob , Nikhil Rao , "Erik Gabriel Carrillo" , Abhinandan Gujjar , Bruce Richardson , Pablo de Lara CC: Narayana Prasad , , Lukasz Bartosik , Pavan Nikhilesh , "Hemant Agrawal" , Nipun Gupta , "Harry van Haaren" , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= , Liang Ma , "Anoob Joseph" Date: Mon, 3 Jun 2019 22:19:15 +0530 Message-ID: <1559580584-5728-11-git-send-email-anoobj@marvell.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1559580584-5728-1-git-send-email-anoobj@marvell.com> References: <1559580584-5728-1-git-send-email-anoobj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-03_13:, , signatures=0 Subject: [dpdk-dev] [PATCH 10/39] examples/l2fwd-event: do timer updates only on master 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Signed-off-by: Lukasz Bartosik --- examples/l2fwd-event/l2fwd_worker.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/examples/l2fwd-event/l2fwd_worker.c b/examples/l2fwd-event/l2fwd_worker.c index 49bbdb6..58fd5b8 100644 --- a/examples/l2fwd-event/l2fwd_worker.c +++ b/examples/l2fwd-event/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