From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 1F8F82BC7 for ; Sat, 3 Mar 2018 13:29:50 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Mar 2018 04:29:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,417,1515484800"; d="scan'208";a="179573282" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.252.21.107]) ([10.252.21.107]) by orsmga004.jf.intel.com with ESMTP; 03 Mar 2018 04:29:48 -0800 To: Stephen Hemminger Cc: dev@dpdk.org, jianfeng.tan@intel.com, konstantin.ananyev@intel.com References: <92186ea34a31743ed76dbd9267f0586da22575f3.1519742486.git.anatoly.burakov@intel.com> <20180302104825.1e419ce7@xeon-e3> From: "Burakov, Anatoly" Message-ID: <6239f74a-ef7e-961b-f518-a3167d68708e@intel.com> Date: Sat, 3 Mar 2018 12:29:47 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180302104825.1e419ce7@xeon-e3> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] eal: add asynchronous request API to DPDK IPC 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: Sat, 03 Mar 2018 12:29:51 -0000 On 02-Mar-18 6:48 PM, Stephen Hemminger wrote: > On Tue, 27 Feb 2018 14:59:29 +0000 > Anatoly Burakov wrote: > >> +rte_mp_request_async(struct rte_mp_msg *req, const struct timespec *ts) >> { >> + struct sync_request *dummy; >> + struct async_request_shared_param *param = NULL; >> + struct rte_mp_reply *reply = NULL; >> + int dir_fd, ret = 0; >> + DIR *mp_dir; >> + struct dirent *ent; >> + struct timeval now; >> + struct timespec *end = NULL; >> + >> + RTE_LOG(DEBUG, EAL, "request: %s\n", req->name); >> + >> + if (check_input(req) == false) >> + return -1; >> + if (gettimeofday(&now, NULL) < 0) { >> + RTE_LOG(ERR, EAL, "Faile to get current time\n"); >> + rte_errno = errno; >> + return -1; >> + } > > gettimeofday is not a good API to use in DPDK. > It gets changed by NTP; if you have to use system time you want monotonic clock > We need current time because pthread_cond_timedwait() accepts current time. So it's either that, or reimplementing pthread_cond_timedwait() in DPDK using monotonic clock :) Unless, of course, there already are alternatives that use monotonic clock and that don't need other DPDK machinery (e.g. rte_malloc) to work (like rte_alarm callbacks). -- Thanks, Anatoly