From patchwork Wed May 15 13:59:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Wang X-Patchwork-Id: 53433 X-Patchwork-Delegate: cristian.dumitrescu@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org 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" 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 Acked-by: Jasvinder Singh --- 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 */