DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/2]
@ 2014-05-15 21:20 Vadim Suraev
  2014-05-15 21:21 ` [dpdk-dev] [PATCH 1/2] rte_timer bug fix: pending timers count is not decremented when going running. Fix: decrement pending when going running, increment if reloaded, do nothing if not reloaded Signed-off-by: Vadim Suraev <vadim.suraev@gmail.com> Vadim Suraev
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Vadim Suraev @ 2014-05-15 21:20 UTC (permalink / raw)
  To: dev

rte_timer: 2 bug fixes

Vadim Suraev (2):
  rte_timer bug fix: pending timers count is not  decremented when
    going running. Fix: decrement pending when going running, increment
    if reloaded, do nothing if not reloaded     Signed-off-by: Vadim
    Suraev <vadim.suraev@gmail.com>
  rte_timer bug fix: when a perdiodic timer's callback manipulates
    another timer, updated flag prevents reloading the periodic timer.
    Fix: move  updated flag to rte_timer structure (one per core)    
    Signed-off-by: Vadim Suraev <vadim.suraev@gmail.com>

 lib/librte_timer/rte_timer.c |   21 ++++++++++-----------
 lib/librte_timer/rte_timer.h |    7 ++++++-
 2 files changed, 16 insertions(+), 12 deletions(-)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-dev] [PATCH 1/2] rte_timer bug fix: pending timers count is not decremented when going running. Fix: decrement pending when going running, increment if reloaded, do nothing if not reloaded Signed-off-by: Vadim Suraev <vadim.suraev@gmail.com>
  2014-05-15 21:20 [dpdk-dev] [PATCH 0/2] Vadim Suraev
@ 2014-05-15 21:21 ` Vadim Suraev
  2014-05-15 21:21 ` [dpdk-dev] [PATCH 2/2] rte_timer bug fix: when a perdiodic timer's callback manipulates another timer, updated flag prevents reloading the periodic timer. Fix: move updated flag to rte_timer structure (one per core) " Vadim Suraev
  2014-05-15 21:33 ` [dpdk-dev] [PATCH 0/2] Thomas Monjalon
  2 siblings, 0 replies; 7+ messages in thread
From: Vadim Suraev @ 2014-05-15 21:21 UTC (permalink / raw)
  To: dev

Signed-off-by: Vadim Suraev <vadim.suraev@gmail.com>
---
 lib/librte_timer/rte_timer.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_timer/rte_timer.c b/lib/librte_timer/rte_timer.c
index a3d5cca..f98e904 100755
--- a/lib/librte_timer/rte_timer.c
+++ b/lib/librte_timer/rte_timer.c
@@ -173,7 +173,7 @@ timer_set_running_state(struct rte_timer *tim)
 		/* timer is not pending anymore */
 		if (prev_status.state != RTE_TIMER_PENDING)
 			return -1;
-
+		__TIMER_STAT_ADD(pending, -1);
 		/* here, we know that timer is stopped or pending,
 		 * mark it atomically as beeing configured */
 		status.state = RTE_TIMER_RUNNING;
@@ -555,7 +555,6 @@ void rte_timer_manage(void)
 
 		if (tim->period == 0) {
 			/* remove from done list and mark timer as stopped */
-			__TIMER_STAT_ADD(pending, -1);
 			status.state = RTE_TIMER_STOP;
 			status.owner = RTE_TIMER_NO_OWNER;
 			rte_wmb();
@@ -564,6 +563,7 @@ void rte_timer_manage(void)
 		else {
 			/* keep it in list and mark timer as pending */
 			status.state = RTE_TIMER_PENDING;
+			__TIMER_STAT_ADD(pending, 1);
 			status.owner = (int16_t)lcore_id;
 			rte_wmb();
 			tim->status.u32 = status.u32;
-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-dev] [PATCH 2/2] rte_timer bug fix: when a perdiodic timer's callback manipulates another timer, updated flag prevents reloading the periodic timer. Fix: move updated flag to rte_timer structure (one per core) Signed-off-by: Vadim Suraev <vadim.suraev@gmail.com>
  2014-05-15 21:20 [dpdk-dev] [PATCH 0/2] Vadim Suraev
  2014-05-15 21:21 ` [dpdk-dev] [PATCH 1/2] rte_timer bug fix: pending timers count is not decremented when going running. Fix: decrement pending when going running, increment if reloaded, do nothing if not reloaded Signed-off-by: Vadim Suraev <vadim.suraev@gmail.com> Vadim Suraev
@ 2014-05-15 21:21 ` Vadim Suraev
  2014-05-15 21:33 ` [dpdk-dev] [PATCH 0/2] Thomas Monjalon
  2 siblings, 0 replies; 7+ messages in thread
From: Vadim Suraev @ 2014-05-15 21:21 UTC (permalink / raw)
  To: dev


Signed-off-by: Vadim Suraev <vadim.suraev@gmail.com>
---
 lib/librte_timer/rte_timer.c |   17 ++++++++---------
 lib/librte_timer/rte_timer.h |    7 ++++++-
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/lib/librte_timer/rte_timer.c b/lib/librte_timer/rte_timer.c
index f98e904..0cc5fa9 100755
--- a/lib/librte_timer/rte_timer.c
+++ b/lib/librte_timer/rte_timer.c
@@ -58,11 +58,6 @@ LIST_HEAD(rte_timer_list, rte_timer);
 struct priv_timer {
 	struct rte_timer pending_head;  /**< dummy timer instance to head up list */
 	rte_spinlock_t list_lock;       /**< lock to protect list access */
-
-	/** per-core variable that true if a timer was updated on this
-	 *  core since last reset of the variable */
-	int updated;
-
 	/** track the current depth of the skiplist */
 	unsigned curr_skiplist_depth;
 
@@ -107,10 +102,14 @@ void
 rte_timer_init(struct rte_timer *tim)
 {
 	union rte_timer_status status;
+	unsigned lcore_id;
 
 	status.state = RTE_TIMER_STOP;
 	status.owner = RTE_TIMER_NO_OWNER;
 	tim->status.u32 = status.u32;
+	for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id ++) {
+		tim->updated[lcore_id] = 0;
+	}
 }
 
 /*
@@ -378,7 +377,7 @@ __rte_timer_reset(struct rte_timer *tim, uint64_t expire,
 		return -1;
 
 	__TIMER_STAT_ADD(reset, 1);
-	priv_timer[lcore_id].updated = 1;
+	tim->updated[lcore_id] = 1;
 
 	/* remove it from list */
 	if (prev_status.state == RTE_TIMER_PENDING) {
@@ -453,7 +452,7 @@ rte_timer_stop(struct rte_timer *tim)
 		return -1;
 
 	__TIMER_STAT_ADD(stop, 1);
-	priv_timer[lcore_id].updated = 1;
+	tim->updated[lcore_id] = 1;
 
 	/* remove it from list */
 	if (prev_status.state == RTE_TIMER_PENDING) {
@@ -541,7 +540,7 @@ void rte_timer_manage(void)
 
 		rte_spinlock_unlock(&priv_timer[lcore_id].list_lock);
 
-		priv_timer[lcore_id].updated = 0;
+		tim->updated[lcore_id] = 0;
 
 		/* execute callback function with list unlocked */
 		tim->f(tim, tim->arg);
@@ -550,7 +549,7 @@ void rte_timer_manage(void)
 
 		/* the timer was stopped or reloaded by the callback
 		 * function, we have nothing to do here */
-		if (priv_timer[lcore_id].updated == 1)
+		if (tim->updated[lcore_id] == 1)
 			continue;
 
 		if (tim->period == 0) {
diff --git a/lib/librte_timer/rte_timer.h b/lib/librte_timer/rte_timer.h
index c5f936b..235dfd6 100755
--- a/lib/librte_timer/rte_timer.h
+++ b/lib/librte_timer/rte_timer.h
@@ -129,6 +129,10 @@ struct rte_timer
 	uint64_t period;       /**< Period of timer (0 if not periodic). */
 	rte_timer_cb_t *f;     /**< Callback function. */
 	void *arg;             /**< Argument to callback function. */
+        /** per-core variable that true if a timer was updated on this
+	 *  core since last reset of the variable */
+	int updated[RTE_MAX_LCORE];
+
 };
 
 
@@ -142,7 +146,8 @@ struct rte_timer
 	{{RTE_TIMER_STOP, RTE_TIMER_NO_OWNER}}, \
 	0,                                      \
 	NULL,                                   \
-	NULL,                                   \
+	NULL,                                  \
+	{0},                                   \
 	}
 #else
 /**
-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH 0/2]
  2014-05-15 21:20 [dpdk-dev] [PATCH 0/2] Vadim Suraev
  2014-05-15 21:21 ` [dpdk-dev] [PATCH 1/2] rte_timer bug fix: pending timers count is not decremented when going running. Fix: decrement pending when going running, increment if reloaded, do nothing if not reloaded Signed-off-by: Vadim Suraev <vadim.suraev@gmail.com> Vadim Suraev
  2014-05-15 21:21 ` [dpdk-dev] [PATCH 2/2] rte_timer bug fix: when a perdiodic timer's callback manipulates another timer, updated flag prevents reloading the periodic timer. Fix: move updated flag to rte_timer structure (one per core) " Vadim Suraev
@ 2014-05-15 21:33 ` Thomas Monjalon
  2 siblings, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2014-05-15 21:33 UTC (permalink / raw)
  To: Vadim Suraev; +Cc: dev

Hi Vadim,

Your new patchset trial is better but not correct:
- all is in the title.
- the title must be short and begin with "timer:" as it's done for previous 
timer patches
- you must describe the bug you are fixing

I think you'll understand the problem by looking at the archives:
http://dpdk.org/ml/archives/dev/2014-May/002466.html

Please try again
-- 
Thomas

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-dev] [PATCH 0/2]
@ 2019-08-29  8:45 Bernard Iremonger
  0 siblings, 0 replies; 7+ messages in thread
From: Bernard Iremonger @ 2019-08-29  8:45 UTC (permalink / raw)
  To: dev, konstantin.ananyev, akhil.goyal; +Cc: Bernard Iremonger

This patch set, sets the default code path in the ipsec-secgw
application to use the librte_ipsec.
The _old test scripts have been modified to use the legacy code 
patch 

Bernard Iremonger (2):
  examples/ipsec-secgw: set default to IPsec library mode
  examples/ipsec-secgw: add -l 0 parameter to old scripts

 doc/guides/rel_notes/release_19_11.rst             |  8 ++++
 doc/guides/sample_app_ug/ipsec_secgw.rst           |  6 ++-
 examples/ipsec-secgw/ipsec-secgw.c                 | 44 ++++++++++++++--------
 .../ipsec-secgw/test/trs_3descbc_sha1_old_defs.sh  |  2 +-
 .../ipsec-secgw/test/trs_aescbc_sha1_old_defs.sh   |  2 +-
 .../ipsec-secgw/test/trs_aesctr_sha1_old_defs.sh   |  2 +-
 .../test/trs_aesgcm_inline_crypto_old_defs.sh      |  2 +-
 examples/ipsec-secgw/test/trs_aesgcm_old_defs.sh   |  2 +-
 .../ipsec-secgw/test/tun_3descbc_sha1_old_defs.sh  |  2 +-
 .../ipsec-secgw/test/tun_aescbc_sha1_old_defs.sh   |  2 +-
 .../ipsec-secgw/test/tun_aesctr_sha1_old_defs.sh   |  2 +-
 .../test/tun_aesgcm_inline_crypto_old_defs.sh      |  2 +-
 examples/ipsec-secgw/test/tun_aesgcm_old_defs.sh   |  2 +-
 13 files changed, 50 insertions(+), 28 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-dev] [PATCH 0/2]
@ 2019-08-29  8:39 Bernard Iremonger
  0 siblings, 0 replies; 7+ messages in thread
From: Bernard Iremonger @ 2019-08-29  8:39 UTC (permalink / raw)
  To: dev, konstantin.ananyev, akhil.goyal; +Cc: Bernard Iremonger

This patch set, sets the default code path in the ipsec-secgw
application to use the librte_ipsec.
The _old test scripts have been modified to use the legacy code 
patch 

Bernard Iremonger (2):
  examples/ipsec-secgw: set default to IPsec library mode
  examples/ipsec-secgw: add -l 0 parameter to old scripts

 doc/guides/rel_notes/release_19_11.rst             |  8 ++++
 doc/guides/sample_app_ug/ipsec_secgw.rst           |  6 ++-
 examples/ipsec-secgw/ipsec-secgw.c                 | 44 ++++++++++++++--------
 .../ipsec-secgw/test/trs_3descbc_sha1_old_defs.sh  |  2 +-
 .../ipsec-secgw/test/trs_aescbc_sha1_old_defs.sh   |  2 +-
 .../ipsec-secgw/test/trs_aesctr_sha1_old_defs.sh   |  2 +-
 .../test/trs_aesgcm_inline_crypto_old_defs.sh      |  2 +-
 examples/ipsec-secgw/test/trs_aesgcm_old_defs.sh   |  2 +-
 .../ipsec-secgw/test/tun_3descbc_sha1_old_defs.sh  |  2 +-
 .../ipsec-secgw/test/tun_aescbc_sha1_old_defs.sh   |  2 +-
 .../ipsec-secgw/test/tun_aesctr_sha1_old_defs.sh   |  2 +-
 .../test/tun_aesgcm_inline_crypto_old_defs.sh      |  2 +-
 examples/ipsec-secgw/test/tun_aesgcm_old_defs.sh   |  2 +-
 13 files changed, 50 insertions(+), 28 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-dev] [PATCH 0/2]
@ 2014-05-16 10:15 Vadim Suraev
  0 siblings, 0 replies; 7+ messages in thread
From: Vadim Suraev @ 2014-05-16 10:15 UTC (permalink / raw)
  To: dev

two timer bugs fixed

 lib/librte_timer/rte_timer.c |   21 ++++++++++-----------
 lib/librte_timer/rte_timer.h |    7 ++++++-
 2 files changed, 16 insertions(+), 12 deletions(-)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-08-29  8:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-15 21:20 [dpdk-dev] [PATCH 0/2] Vadim Suraev
2014-05-15 21:21 ` [dpdk-dev] [PATCH 1/2] rte_timer bug fix: pending timers count is not decremented when going running. Fix: decrement pending when going running, increment if reloaded, do nothing if not reloaded Signed-off-by: Vadim Suraev <vadim.suraev@gmail.com> Vadim Suraev
2014-05-15 21:21 ` [dpdk-dev] [PATCH 2/2] rte_timer bug fix: when a perdiodic timer's callback manipulates another timer, updated flag prevents reloading the periodic timer. Fix: move updated flag to rte_timer structure (one per core) " Vadim Suraev
2014-05-15 21:33 ` [dpdk-dev] [PATCH 0/2] Thomas Monjalon
2014-05-16 10:15 Vadim Suraev
2019-08-29  8:39 Bernard Iremonger
2019-08-29  8:45 Bernard Iremonger

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).