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 0D8A0A00E6 for ; Wed, 15 May 2019 16:15:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2AB655F44; Wed, 15 May 2019 16:15:55 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 1E49E5F2B; Wed, 15 May 2019 16:15:52 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 May 2019 07:15:52 -0700 X-ExtLoop1: 1 Received: from npg-dpdk-xiao-1.sh.intel.com ([10.67.111.145]) by fmsmga006.fm.intel.com with ESMTP; 15 May 2019 07:15:50 -0700 From: Xiao Wang To: jasvinder.singh@intel.com Cc: dev@dpdk.org, cristian.dumitrescu@intel.com, Xiao Wang , stable@dpdk.org Date: Wed, 15 May 2019 21:59:04 +0800 Message-Id: <20190515135904.81415-1-xiao.w.wang@intel.com> X-Mailer: git-send-email 2.15.1 Subject: [dpdk-dev] [PATCH] net/softnic: fix pipeline time calculation 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" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190515135904.GocDd4-520AV_PWRxeYGyYLt2Bj8h_S9Qs3XrZx4Kww@z> When a new pipeline is added to a thread, the "time_next_min" value may need update, otherwise this pipeline won't get served timely. Fixes: 70709c78fda6 ("net/softnic: add command to enable/disable pipeline") Cc: stable@dpdk.org Signed-off-by: Xiao Wang --- drivers/net/softnic/rte_eth_softnic_thread.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/softnic/rte_eth_softnic_thread.c b/drivers/net/softnic/rte_eth_softnic_thread.c index 855408e98..2b482117d 100644 --- a/drivers/net/softnic/rte_eth_softnic_thread.c +++ b/drivers/net/softnic/rte_eth_softnic_thread.c @@ -337,6 +337,9 @@ softnic_thread_pipeline_enable(struct pmd_internals *softnic, tdp->timer_period = (rte_get_tsc_hz() * p->timer_period_ms) / 1000; tdp->time_next = rte_get_tsc_cycles() + tdp->timer_period; + if (tdp->time_next < td->time_next_min) + td->time_next_min = tdp->time_next; + td->n_pipelines++; /* Pipeline */ @@ -522,6 +525,9 @@ thread_msg_handle_pipeline_enable(struct softnic_thread_data *t, (rte_get_tsc_hz() * req->pipeline_enable.timer_period_ms) / 1000; p->time_next = rte_get_tsc_cycles() + p->timer_period; + if (p->time_next < t->time_next_min) + t->time_next_min = p->time_next; + t->n_pipelines++; /* Response */ -- 2.15.1