DPDK patches and discussions
 help / color / mirror / Atom feed
From: Xiao Wang <xiao.w.wang@intel.com>
To: jasvinder.singh@intel.com
Cc: dev@dpdk.org, cristian.dumitrescu@intel.com,
	Xiao Wang <xiao.w.wang@intel.com>,
	stable@dpdk.org
Subject: [dpdk-dev] [PATCH] net/softnic: fix pipeline time calculation
Date: Wed, 15 May 2019 21:59:04 +0800	[thread overview]
Message-ID: <20190515135904.81415-1-xiao.w.wang@intel.com> (raw)

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 <xiao.w.wang@intel.com>
---
 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

             reply	other threads:[~2019-05-15 14:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-15 13:59 Xiao Wang [this message]
2019-05-15 13:59 ` Xiao Wang
2019-05-31 14:45 ` Singh, Jasvinder
2019-06-02 10:46   ` Wang, Xiao W
2019-06-04  9:27     ` Singh, Jasvinder
2019-07-09 10:32     ` Dumitrescu, Cristian
2019-07-09 14:00       ` Wang, Xiao W
2019-07-09 14:18         ` Dumitrescu, Cristian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190515135904.81415-1-xiao.w.wang@intel.com \
    --to=xiao.w.wang@intel.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=jasvinder.singh@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).