From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9E91CA0471 for ; Fri, 16 Aug 2019 09:56:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AD9DE1BE8D; Fri, 16 Aug 2019 09:56:24 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 5F5571BDFD for ; Fri, 16 Aug 2019 09:56:22 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Aug 2019 00:56:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,391,1559545200"; d="scan'208";a="261048660" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.251.81.21]) ([10.251.81.21]) by orsmga001.jf.intel.com with ESMTP; 16 Aug 2019 00:56:21 -0700 To: Jim Harris , dev@dpdk.org References: <156586845525.44449.11798632267644345382.stgit@jrharri1-skx> From: "Burakov, Anatoly" Message-ID: Date: Fri, 16 Aug 2019 08:56:20 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <156586845525.44449.11798632267644345382.stgit@jrharri1-skx> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 1/2] timer: use rte_mp_msg to pass TSC hz to secondary procs 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" On 15-Aug-19 12:27 PM, Jim Harris wrote: > rte_eal_init() is much faster in secondary processes since > hugepages don't need to be zeroed. But there's still > non-trivial delays in the timer subsystem initialization > due to the 100ms sleep used to calculate TSC hz. So use > the rte_mp_msg framework to allow secondary processes > to get the TSC hz from the primary process. > > This cuts rte_eal_init() execution time in a secondary > process from 165ms to 66ms in my test program. > > Signed-off-by: Jim Harris > --- > @@ -89,6 +96,65 @@ set_tsc_freq(void) > eal_tsc_resolution_hz = freq; > } > > +static void > +set_tsc_freq_secondary(void) > +{ > + struct rte_mp_msg mp_req; > + struct rte_mp_reply mp_reply; > + struct timer_mp_param *r; > + struct timespec ts = {.tv_sec = 1, .tv_nsec = 0}; > + > + memset(&mp_req, 0, sizeof(mp_req)); > + strcpy(mp_req.name, EAL_TIMER_MP); > + if (rte_mp_request_sync(&mp_req, &mp_reply, &ts) || mp_reply.nb_received != 1) { If rte_mp_request_sync returns 0 but mp_reply.nb_receieved isn't set to 1, you'll be leaking mp_reply.msgs. -- Thanks, Anatoly