[v5,7/8] net/thunderx: use new API to save cycles on aarch64

Message ID 1568287473-55306-8-git-send-email-gavin.hu@arm.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series use WFE for aarch64 |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Gavin Hu Sept. 12, 2019, 11:24 a.m. UTC
  Use the new API to wait in low power state instead of continuous
polling to save CPU cycles and power.

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 drivers/net/thunderx/nicvf_rxtx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

Jerin Jacob Sept. 12, 2019, 4:15 p.m. UTC | #1
On Thu, Sep 12, 2019 at 4:57 PM Gavin Hu <gavin.hu@arm.com> wrote:
>
> Use the new API to wait in low power state instead of continuous
> polling to save CPU cycles and power.
>
> Signed-off-by: Gavin Hu <gavin.hu@arm.com>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>

Acked-by: Jerin Jacob <jerinj@marvell.com>


> ---
>  drivers/net/thunderx/nicvf_rxtx.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/thunderx/nicvf_rxtx.c b/drivers/net/thunderx/nicvf_rxtx.c
> index 1c42874..16f34c6 100644
> --- a/drivers/net/thunderx/nicvf_rxtx.c
> +++ b/drivers/net/thunderx/nicvf_rxtx.c
> @@ -385,8 +385,7 @@ nicvf_fill_rbdr(struct nicvf_rxq *rxq, int to_fill)
>                 ltail++;
>         }
>
> -       while (__atomic_load_n(&rbdr->tail, __ATOMIC_RELAXED) != next_tail)
> -               rte_pause();
> +       rte_wait_until_equal_relaxed_32(&rbdr->tail, next_tail);
>
>         __atomic_store_n(&rbdr->tail, ltail, __ATOMIC_RELEASE);
>         nicvf_addr_write(door, to_fill);
> --
> 2.7.4
>
  

Patch

diff --git a/drivers/net/thunderx/nicvf_rxtx.c b/drivers/net/thunderx/nicvf_rxtx.c
index 1c42874..16f34c6 100644
--- a/drivers/net/thunderx/nicvf_rxtx.c
+++ b/drivers/net/thunderx/nicvf_rxtx.c
@@ -385,8 +385,7 @@  nicvf_fill_rbdr(struct nicvf_rxq *rxq, int to_fill)
 		ltail++;
 	}
 
-	while (__atomic_load_n(&rbdr->tail, __ATOMIC_RELAXED) != next_tail)
-		rte_pause();
+	rte_wait_until_equal_relaxed_32(&rbdr->tail, next_tail);
 
 	__atomic_store_n(&rbdr->tail, ltail, __ATOMIC_RELEASE);
 	nicvf_addr_write(door, to_fill);