diff options
author | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2019-07-04 10:40:06 +0200 |
---|---|---|
committer | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2019-07-04 10:48:05 +0200 |
commit | 8d53e9f3c6001dcb2865f6e894da5b54e1418f88 (patch) | |
tree | 63907f21c13636a987d43463c675d0727a04e327 /lib/librte_ring | |
parent | e2bea7436061ca2e7e14bfcfdc5870f2555c3965 (diff) |
New upstream version 18.11.2upstream-18.11-stable
Change-Id: I23eb4f9179abf1f9c659891f8fddb27ee68ad26b
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'lib/librte_ring')
-rw-r--r-- | lib/librte_ring/rte_ring.c | 3 | ||||
-rw-r--r-- | lib/librte_ring/rte_ring.h | 4 | ||||
-rw-r--r-- | lib/librte_ring/rte_ring_generic.h | 9 |
3 files changed, 10 insertions, 6 deletions
diff --git a/lib/librte_ring/rte_ring.c b/lib/librte_ring/rte_ring.c index d215acec..550549db 100644 --- a/lib/librte_ring/rte_ring.c +++ b/lib/librte_ring/rte_ring.c @@ -189,7 +189,8 @@ rte_ring_free(struct rte_ring *r) * therefore, there is no memzone to free. */ if (r->memzone == NULL) { - RTE_LOG(ERR, RING, "Cannot free ring (not created with rte_ring_create()"); + RTE_LOG(ERR, RING, + "Cannot free ring, not created with rte_ring_create()\n"); return; } diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h index af5444a9..e265e947 100644 --- a/lib/librte_ring/rte_ring.h +++ b/lib/librte_ring/rte_ring.h @@ -57,7 +57,7 @@ enum rte_ring_queue_behavior { }; #define RTE_RING_MZ_PREFIX "RG_" -/**< The maximum length of a ring name. */ +/** The maximum length of a ring name. */ #define RTE_RING_NAMESIZE (RTE_MEMZONE_NAMESIZE - \ sizeof(RTE_RING_MZ_PREFIX) + 1) @@ -302,7 +302,7 @@ void rte_ring_dump(FILE *f, const struct rte_ring *r); * (powerpc/arm). * There are 2 choices for the users * 1.use rmb() memory barrier - * 2.use one-direcion load_acquire/store_release barrier,defined by + * 2.use one-direction load_acquire/store_release barrier,defined by * CONFIG_RTE_USE_C11_MEM_MODEL=y * It depends on performance test results. * By default, move common functions to rte_ring_generic.h diff --git a/lib/librte_ring/rte_ring_generic.h b/lib/librte_ring/rte_ring_generic.h index ea7dbe5b..953cdbbd 100644 --- a/lib/librte_ring/rte_ring_generic.h +++ b/lib/librte_ring/rte_ring_generic.h @@ -158,11 +158,14 @@ __rte_ring_move_cons_head(struct rte_ring *r, unsigned int is_sc, return 0; *new_head = *old_head + n; - if (is_sc) - r->cons.head = *new_head, success = 1; - else + if (is_sc) { + r->cons.head = *new_head; + rte_smp_rmb(); + success = 1; + } else { success = rte_atomic32_cmpset(&r->cons.head, *old_head, *new_head); + } } while (unlikely(success == 0)); return n; } |