ring: fix API documentation
[dpdk.git] / lib / librte_rcu / rte_rcu_qsbr.h
index 3f445ba..0b55859 100644 (file)
@@ -217,7 +217,7 @@ rte_rcu_qsbr_thread_unregister(struct rte_rcu_qsbr *v, unsigned int thread_id);
  * call this API before calling rte_rcu_qsbr_quiescent. This can be called
  * during initialization or as part of the packet processing loop.
  *
- * The reader thread must call rte_rcu_thread_offline API, before
+ * The reader thread must call rte_rcu_qsbr_thread_offline API, before
  * calling any functions that block, to ensure that rte_rcu_qsbr_check
  * API does not wait indefinitely for the reader thread to update its QS.
  *
@@ -283,7 +283,7 @@ rte_rcu_qsbr_thread_online(struct rte_rcu_qsbr *v, unsigned int thread_id)
  * This can be called during initialization or as part of the packet
  * processing loop.
  *
- * The reader thread must call rte_rcu_thread_offline API, before
+ * The reader thread must call rte_rcu_qsbr_thread_offline API, before
  * calling any functions that block, to ensure that rte_rcu_qsbr_check
  * API does not wait indefinitely for the reader thread to update its QS.
  *
@@ -456,12 +456,14 @@ rte_rcu_qsbr_quiescent(struct rte_rcu_qsbr *v, unsigned int thread_id)
         */
        t = __atomic_load_n(&v->token, __ATOMIC_ACQUIRE);
 
-       /* Inform the writer that updates are visible to this reader.
+       /* Check if there are updates available from the writer.
+        * Inform the writer that updates are visible to this reader.
         * Prior loads of the shared data structure should not move
         * beyond this store. Hence use store-release.
         */
-       __atomic_store_n(&v->qsbr_cnt[thread_id].cnt,
-                        t, __ATOMIC_RELEASE);
+       if (t != __atomic_load_n(&v->qsbr_cnt[thread_id].cnt, __ATOMIC_RELAXED))
+               __atomic_store_n(&v->qsbr_cnt[thread_id].cnt,
+                                        t, __ATOMIC_RELEASE);
 
        __RTE_RCU_DP_LOG(DEBUG, "%s: update: token = %"PRIu64", Thread ID = %d",
                __func__, t, thread_id);