DPDK patches and discussions
 help / color / mirror / Atom feed
From: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
To: Tyler Retzlaff <roretzla@linux.microsoft.com>, dev@dpdk.org
Cc: Akhil Goyal <gakhil@marvell.com>,
	Anatoly Burakov <anatoly.burakov@intel.com>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Chenbo Xia <chenbo.xia@intel.com>,
	Ciara Power <ciara.power@intel.com>,
	David Christensen <drc@linux.vnet.ibm.com>,
	David Hunt <david.hunt@intel.com>,
	Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,
	Dmitry Malloy <dmitrym@microsoft.com>,
	Elena Agostini <eagostini@nvidia.com>,
	Erik Gabriel Carrillo <erik.g.carrillo@intel.com>,
	Fan Zhang <fanzhang.oss@gmail.com>,
	Ferruh Yigit <ferruh.yigit@amd.com>,
	Harman Kalra <hkalra@marvell.com>,
	Harry van Haaren <harry.van.haaren@intel.com>,
	Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>,
	Jerin Jacob <jerinj@marvell.com>, Matan Azrad <matan@nvidia.com>,
	Maxime Coquelin <maxime.coquelin@redhat.com>,
	Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>,
	Nicolas Chautru <nicolas.chautru@intel.com>,
	Olivier Matz <olivier.matz@6wind.com>, Ori Kam <orika@nvidia.com>,
	Pallavi Kadam <pallavi.kadam@intel.com>,
	Pavan Nikhilesh <pbhagavatula@marvell.com>,
	Reshma Pattan <reshma.pattan@intel.com>,
	Sameh Gobriel <sameh.gobriel@intel.com>,
	Shijith Thotton <sthotton@marvell.com>,
	Sivaprasad Tummala <sivaprasad.tummala@amd.com>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Suanming Mou <suanmingm@nvidia.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
	Vladimir Medvedkin <vladimir.medvedkin@intel.com>,
	Yipeng Wang <yipeng1.wang@intel.com>
Subject: Re: [PATCH v3 14/19] cryptodev: use rte optional stdatomic API
Date: Fri, 27 Oct 2023 14:05:42 +0100	[thread overview]
Message-ID: <280f4bff-6f12-422a-a6ef-f518c6e9bb85@yandex.ru> (raw)
In-Reply-To: <1698280314-25861-15-git-send-email-roretzla@linux.microsoft.com>

26.10.2023 01:31, Tyler Retzlaff пишет:
> Replace the use of gcc builtin __atomic_xxx intrinsics with
> corresponding rte_atomic_xxx optional stdatomic API
> 
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> ---
>   lib/cryptodev/rte_cryptodev.c | 22 ++++++++++++----------
>   lib/cryptodev/rte_cryptodev.h | 16 ++++++++--------
>   2 files changed, 20 insertions(+), 18 deletions(-)
> 
> diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
> index 314710b..b258827 100644
> --- a/lib/cryptodev/rte_cryptodev.c
> +++ b/lib/cryptodev/rte_cryptodev.c
> @@ -1535,12 +1535,12 @@ struct rte_cryptodev_cb *
>   		/* Stores to cb->fn and cb->param should complete before
>   		 * cb is visible to data plane.
>   		 */
> -		__atomic_store_n(&tail->next, cb, __ATOMIC_RELEASE);
> +		rte_atomic_store_explicit(&tail->next, cb, rte_memory_order_release);
>   	} else {
>   		/* Stores to cb->fn and cb->param should complete before
>   		 * cb is visible to data plane.
>   		 */
> -		__atomic_store_n(&list->next, cb, __ATOMIC_RELEASE);
> +		rte_atomic_store_explicit(&list->next, cb, rte_memory_order_release);
>   	}
>   
>   	rte_spinlock_unlock(&rte_cryptodev_callback_lock);
> @@ -1555,7 +1555,8 @@ struct rte_cryptodev_cb *
>   				  struct rte_cryptodev_cb *cb)
>   {
>   	struct rte_cryptodev *dev;
> -	struct rte_cryptodev_cb **prev_cb, *curr_cb;
> +	RTE_ATOMIC(struct rte_cryptodev_cb *) *prev_cb;
> +	struct rte_cryptodev_cb *curr_cb;
>   	struct rte_cryptodev_cb_rcu *list;
>   	int ret;
>   
> @@ -1601,8 +1602,8 @@ struct rte_cryptodev_cb *
>   		curr_cb = *prev_cb;
>   		if (curr_cb == cb) {
>   			/* Remove the user cb from the callback list. */
> -			__atomic_store_n(prev_cb, curr_cb->next,
> -				__ATOMIC_RELAXED);
> +			rte_atomic_store_explicit(prev_cb, curr_cb->next,
> +				rte_memory_order_relaxed);
>   			ret = 0;
>   			break;
>   		}
> @@ -1673,12 +1674,12 @@ struct rte_cryptodev_cb *
>   		/* Stores to cb->fn and cb->param should complete before
>   		 * cb is visible to data plane.
>   		 */
> -		__atomic_store_n(&tail->next, cb, __ATOMIC_RELEASE);
> +		rte_atomic_store_explicit(&tail->next, cb, rte_memory_order_release);
>   	} else {
>   		/* Stores to cb->fn and cb->param should complete before
>   		 * cb is visible to data plane.
>   		 */
> -		__atomic_store_n(&list->next, cb, __ATOMIC_RELEASE);
> +		rte_atomic_store_explicit(&list->next, cb, rte_memory_order_release);
>   	}
>   
>   	rte_spinlock_unlock(&rte_cryptodev_callback_lock);
> @@ -1694,7 +1695,8 @@ struct rte_cryptodev_cb *
>   				  struct rte_cryptodev_cb *cb)
>   {
>   	struct rte_cryptodev *dev;
> -	struct rte_cryptodev_cb **prev_cb, *curr_cb;
> +	RTE_ATOMIC(struct rte_cryptodev_cb *) *prev_cb;
> +	struct rte_cryptodev_cb *curr_cb;
>   	struct rte_cryptodev_cb_rcu *list;
>   	int ret;
>   
> @@ -1740,8 +1742,8 @@ struct rte_cryptodev_cb *
>   		curr_cb = *prev_cb;
>   		if (curr_cb == cb) {
>   			/* Remove the user cb from the callback list. */
> -			__atomic_store_n(prev_cb, curr_cb->next,
> -				__ATOMIC_RELAXED);
> +			rte_atomic_store_explicit(prev_cb, curr_cb->next,
> +				rte_memory_order_relaxed);
>   			ret = 0;
>   			break;
>   		}
> diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
> index be0698c..9092118 100644
> --- a/lib/cryptodev/rte_cryptodev.h
> +++ b/lib/cryptodev/rte_cryptodev.h
> @@ -979,7 +979,7 @@ struct rte_cryptodev_config {
>    * queue pair on enqueue/dequeue.
>    */
>   struct rte_cryptodev_cb {
> -	struct rte_cryptodev_cb *next;
> +	RTE_ATOMIC(struct rte_cryptodev_cb *) next;
>   	/**< Pointer to next callback */
>   	rte_cryptodev_callback_fn fn;
>   	/**< Pointer to callback function */
> @@ -992,7 +992,7 @@ struct rte_cryptodev_cb {
>    * Structure used to hold information about the RCU for a queue pair.
>    */
>   struct rte_cryptodev_cb_rcu {
> -	struct rte_cryptodev_cb *next;
> +	RTE_ATOMIC(struct rte_cryptodev_cb *) next;
>   	/**< Pointer to next callback */
>   	struct rte_rcu_qsbr *qsbr;
>   	/**< RCU QSBR variable per queue pair */
> @@ -1947,15 +1947,15 @@ int rte_cryptodev_remove_deq_callback(uint8_t dev_id,
>   		struct rte_cryptodev_cb_rcu *list;
>   		struct rte_cryptodev_cb *cb;
>   
> -		/* __ATOMIC_RELEASE memory order was used when the
> +		/* rte_memory_order_release memory order was used when the
>   		 * call back was inserted into the list.
>   		 * Since there is a clear dependency between loading
> -		 * cb and cb->fn/cb->next, __ATOMIC_ACQUIRE memory order is
> +		 * cb and cb->fn/cb->next, rte_memory_order_acquire memory order is
>   		 * not required.
>   		 */
>   		list = &fp_ops->qp.deq_cb[qp_id];
>   		rte_rcu_qsbr_thread_online(list->qsbr, 0);
> -		cb = __atomic_load_n(&list->next, __ATOMIC_RELAXED);
> +		cb = rte_atomic_load_explicit(&list->next, rte_memory_order_relaxed);
>   
>   		while (cb != NULL) {
>   			nb_ops = cb->fn(dev_id, qp_id, ops, nb_ops,
> @@ -2014,15 +2014,15 @@ int rte_cryptodev_remove_deq_callback(uint8_t dev_id,
>   		struct rte_cryptodev_cb_rcu *list;
>   		struct rte_cryptodev_cb *cb;
>   
> -		/* __ATOMIC_RELEASE memory order was used when the
> +		/* rte_memory_order_release memory order was used when the
>   		 * call back was inserted into the list.
>   		 * Since there is a clear dependency between loading
> -		 * cb and cb->fn/cb->next, __ATOMIC_ACQUIRE memory order is
> +		 * cb and cb->fn/cb->next, rte_memory_order_acquire memory order is
>   		 * not required.
>   		 */
>   		list = &fp_ops->qp.enq_cb[qp_id];
>   		rte_rcu_qsbr_thread_online(list->qsbr, 0);
> -		cb = __atomic_load_n(&list->next, __ATOMIC_RELAXED);
> +		cb = rte_atomic_load_explicit(&list->next, rte_memory_order_relaxed);
>   
>   		while (cb != NULL) {
>   			nb_ops = cb->fn(dev_id, qp_id, ops, nb_ops,

Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>

  parent reply	other threads:[~2023-10-27 13:05 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16 23:08 [PATCH 00/21] " Tyler Retzlaff
2023-10-16 23:08 ` [PATCH 01/21] power: fix use of rte stdatomic Tyler Retzlaff
2023-10-16 23:08 ` [PATCH 02/21] event/cnxk: remove single " Tyler Retzlaff
2023-10-16 23:08 ` [PATCH 03/21] power: use rte optional stdatomic API Tyler Retzlaff
2023-10-16 23:08 ` [PATCH 04/21] bbdev: " Tyler Retzlaff
2023-10-16 23:08 ` [PATCH 05/21] eal: " Tyler Retzlaff
2023-10-16 23:08 ` [PATCH 06/21] eventdev: " Tyler Retzlaff
2023-10-16 23:08 ` [PATCH 07/21] gpudev: " Tyler Retzlaff
2023-10-16 23:08 ` [PATCH 08/21] ipsec: " Tyler Retzlaff
2023-10-16 23:08 ` [PATCH 09/21] mbuf: " Tyler Retzlaff
2023-10-16 23:08 ` [PATCH 10/21] mempool: " Tyler Retzlaff
2023-10-16 23:08 ` [PATCH 11/21] rcu: " Tyler Retzlaff
2023-10-16 23:08 ` [PATCH 12/21] pdump: " Tyler Retzlaff
2023-10-16 23:08 ` [PATCH 13/21] stack: " Tyler Retzlaff
2023-10-16 23:08 ` [PATCH 14/21] telemetry: " Tyler Retzlaff
2023-10-16 23:08 ` [PATCH 15/21] vhost: " Tyler Retzlaff
2023-10-16 23:09 ` [PATCH 16/21] cryptodev: " Tyler Retzlaff
2023-10-16 23:09 ` [PATCH 17/21] distributor: " Tyler Retzlaff
2023-10-16 23:09 ` [PATCH 18/21] ethdev: " Tyler Retzlaff
2023-10-16 23:09 ` [PATCH 19/21] hash: " Tyler Retzlaff
2023-10-16 23:09 ` [PATCH 20/21] timer: " Tyler Retzlaff
2023-10-16 23:09 ` [PATCH 21/21] ring: " Tyler Retzlaff
2023-10-17 20:30 ` [PATCH v2 00/19] " Tyler Retzlaff
2023-10-17 20:30   ` [PATCH v2 01/19] power: " Tyler Retzlaff
2023-10-17 20:31   ` [PATCH v2 02/19] bbdev: " Tyler Retzlaff
2023-10-17 20:31   ` [PATCH v2 03/19] eal: " Tyler Retzlaff
2023-10-17 20:31   ` [PATCH v2 04/19] eventdev: " Tyler Retzlaff
2023-10-17 20:31   ` [PATCH v2 05/19] gpudev: " Tyler Retzlaff
2023-10-17 20:31   ` [PATCH v2 06/19] ipsec: " Tyler Retzlaff
2023-10-24  8:45     ` Konstantin Ananyev
2023-10-17 20:31   ` [PATCH v2 07/19] mbuf: " Tyler Retzlaff
2023-10-24  8:46     ` Konstantin Ananyev
2023-10-17 20:31   ` [PATCH v2 08/19] mempool: " Tyler Retzlaff
2023-10-24  8:47     ` Konstantin Ananyev
2023-10-17 20:31   ` [PATCH v2 09/19] rcu: " Tyler Retzlaff
2023-10-25  9:41     ` Ruifeng Wang
2023-10-25 22:38       ` Tyler Retzlaff
2023-10-26  4:24         ` Ruifeng Wang
2023-10-26 16:36           ` Tyler Retzlaff
2023-10-17 20:31   ` [PATCH v2 10/19] pdump: " Tyler Retzlaff
2023-10-17 20:31   ` [PATCH v2 11/19] stack: " Tyler Retzlaff
2023-10-24  8:48     ` Konstantin Ananyev
2023-10-17 20:31   ` [PATCH v2 12/19] telemetry: " Tyler Retzlaff
2023-10-17 20:31   ` [PATCH v2 13/19] vhost: " Tyler Retzlaff
2023-10-17 20:31   ` [PATCH v2 14/19] cryptodev: " Tyler Retzlaff
2023-10-17 20:31   ` [PATCH v2 15/19] distributor: " Tyler Retzlaff
2023-10-17 20:31   ` [PATCH v2 16/19] ethdev: " Tyler Retzlaff
2023-10-17 20:31   ` [PATCH v2 17/19] hash: " Tyler Retzlaff
2023-10-17 20:31   ` [PATCH v2 18/19] timer: " Tyler Retzlaff
2023-10-17 20:31   ` [PATCH v2 19/19] ring: " Tyler Retzlaff
2023-10-24  8:43     ` Konstantin Ananyev
2023-10-24  9:56       ` Morten Brørup
2023-10-24 15:58         ` Tyler Retzlaff
2023-10-24 16:36           ` Morten Brørup
2023-10-24 16:29       ` Tyler Retzlaff
2023-10-25 10:06         ` Konstantin Ananyev
2023-10-25 22:49           ` Tyler Retzlaff
2023-10-25 23:22             ` Tyler Retzlaff
2023-10-17 23:55   ` [PATCH v2 00/19] " Stephen Hemminger
2023-10-26  0:31 ` [PATCH v3 " Tyler Retzlaff
2023-10-26  0:31   ` [PATCH v3 01/19] power: " Tyler Retzlaff
2023-10-26  0:31   ` [PATCH v3 02/19] bbdev: " Tyler Retzlaff
2023-10-26 11:57     ` Maxime Coquelin
2023-10-26  0:31   ` [PATCH v3 03/19] eal: " Tyler Retzlaff
2023-10-26  0:31   ` [PATCH v3 04/19] eventdev: " Tyler Retzlaff
2023-10-26  0:31   ` [PATCH v3 05/19] gpudev: " Tyler Retzlaff
2023-10-26  0:31   ` [PATCH v3 06/19] ipsec: " Tyler Retzlaff
2023-10-26 15:54     ` [EXT] " Akhil Goyal
2023-10-27 12:59     ` Konstantin Ananyev
2023-10-26  0:31   ` [PATCH v3 07/19] mbuf: " Tyler Retzlaff
2023-10-27 13:03     ` Konstantin Ananyev
2023-10-26  0:31   ` [PATCH v3 08/19] mempool: " Tyler Retzlaff
2023-10-27 13:01     ` Konstantin Ananyev
2023-10-26  0:31   ` [PATCH v3 09/19] rcu: " Tyler Retzlaff
2023-10-26  0:31   ` [PATCH v3 10/19] pdump: " Tyler Retzlaff
2023-10-26  0:31   ` [PATCH v3 11/19] stack: " Tyler Retzlaff
2023-10-26  0:31   ` [PATCH v3 12/19] telemetry: " Tyler Retzlaff
2023-10-26  0:31   ` [PATCH v3 13/19] vhost: " Tyler Retzlaff
2023-10-26 11:57     ` Maxime Coquelin
2023-10-26  0:31   ` [PATCH v3 14/19] cryptodev: " Tyler Retzlaff
2023-10-26 15:53     ` [EXT] " Akhil Goyal
2023-10-27 13:05     ` Konstantin Ananyev [this message]
2023-10-26  0:31   ` [PATCH v3 15/19] distributor: " Tyler Retzlaff
2023-10-26  0:31   ` [PATCH v3 16/19] ethdev: " Tyler Retzlaff
2023-10-27 13:04     ` Konstantin Ananyev
2023-10-26  0:31   ` [PATCH v3 17/19] hash: " Tyler Retzlaff
2023-10-26  0:31   ` [PATCH v3 18/19] timer: " Tyler Retzlaff
2023-10-26  0:31   ` [PATCH v3 19/19] ring: " Tyler Retzlaff
2023-10-27 12:58     ` Konstantin Ananyev
2023-10-26 13:47   ` [PATCH v3 00/19] " David Marchand
2023-10-30 15:34   ` David Marchand

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=280f4bff-6f12-422a-a6ef-f518c6e9bb85@yandex.ru \
    --to=konstantin.v.ananyev@yandex.ru \
    --cc=anatoly.burakov@intel.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=bruce.richardson@intel.com \
    --cc=chenbo.xia@intel.com \
    --cc=ciara.power@intel.com \
    --cc=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=dmitrym@microsoft.com \
    --cc=drc@linux.vnet.ibm.com \
    --cc=eagostini@nvidia.com \
    --cc=erik.g.carrillo@intel.com \
    --cc=fanzhang.oss@gmail.com \
    --cc=ferruh.yigit@amd.com \
    --cc=gakhil@marvell.com \
    --cc=harry.van.haaren@intel.com \
    --cc=hkalra@marvell.com \
    --cc=honnappa.nagarahalli@arm.com \
    --cc=jerinj@marvell.com \
    --cc=matan@nvidia.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=navasile@linux.microsoft.com \
    --cc=nicolas.chautru@intel.com \
    --cc=olivier.matz@6wind.com \
    --cc=orika@nvidia.com \
    --cc=pallavi.kadam@intel.com \
    --cc=pbhagavatula@marvell.com \
    --cc=reshma.pattan@intel.com \
    --cc=roretzla@linux.microsoft.com \
    --cc=sameh.gobriel@intel.com \
    --cc=sivaprasad.tummala@amd.com \
    --cc=skori@marvell.com \
    --cc=stephen@networkplumber.org \
    --cc=sthotton@marvell.com \
    --cc=suanmingm@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@nvidia.com \
    --cc=vladimir.medvedkin@intel.com \
    --cc=yipeng1.wang@intel.com \
    /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).