[1/4] vdpa/mlx5: set polling mode default delay to zero

Message ID 1606952203-23310-1-git-send-email-xuemingl@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series [1/4] vdpa/mlx5: set polling mode default delay to zero |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Xueming Li Dec. 2, 2020, 11:36 p.m. UTC
  To improve throughput and latency, this patch allows Rx polling timer
delay to 0us.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 doc/guides/vdpadevs/mlx5.rst  | 3 +--
 drivers/vdpa/mlx5/mlx5_vdpa.c | 9 +++------
 2 files changed, 4 insertions(+), 8 deletions(-)
  

Comments

Maxime Coquelin Jan. 6, 2021, 3:30 p.m. UTC | #1
On 12/3/20 12:36 AM, Xueming Li wrote:
> To improve throughput and latency, this patch allows Rx polling timer
> delay to 0us.
> 
> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
> ---
>  doc/guides/vdpadevs/mlx5.rst  | 3 +--
>  drivers/vdpa/mlx5/mlx5_vdpa.c | 9 +++------
>  2 files changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/doc/guides/vdpadevs/mlx5.rst b/doc/guides/vdpadevs/mlx5.rst
> index 3a6d88362d..903fdb0e60 100644
> --- a/doc/guides/vdpadevs/mlx5.rst
> +++ b/doc/guides/vdpadevs/mlx5.rst
> @@ -125,8 +125,7 @@ Driver options
>    - 0, A nonzero value to set timer step in micro-seconds. The timer thread
>      dynamic delay change steps according to this value. Default value is 1us.
>  
> -  - 1, A nonzero value to set fixed timer delay in micro-seconds. Default value
> -    is 100us.
> +  - 1, A value to set fixed timer delay in micro-seconds. Default value is 0us.
>  
>  - ``no_traffic_time`` parameter [int]
>  
> diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c
> index b64f364eb7..5020a99fae 100644
> --- a/drivers/vdpa/mlx5/mlx5_vdpa.c
> +++ b/drivers/vdpa/mlx5/mlx5_vdpa.c
> @@ -651,12 +651,9 @@ mlx5_vdpa_config_get(struct rte_devargs *devargs, struct mlx5_vdpa_priv *priv)
>  		return;
>  	rte_kvargs_process(kvlist, NULL, mlx5_vdpa_args_check_handler, priv);
>  	rte_kvargs_free(kvlist);
> -	if (!priv->event_us) {
> -		if (priv->event_mode == MLX5_VDPA_EVENT_MODE_DYNAMIC_TIMER)
> -			priv->event_us = MLX5_VDPA_DEFAULT_TIMER_STEP_US;
> -		else if (priv->event_mode == MLX5_VDPA_EVENT_MODE_FIXED_TIMER)
> -			priv->event_us = MLX5_VDPA_DEFAULT_TIMER_DELAY_US;
> -	}
> +	if (!priv->event_us &&
> +	    priv->event_mode == MLX5_VDPA_EVENT_MODE_DYNAMIC_TIMER)
> +		priv->event_us = MLX5_VDPA_DEFAULT_TIMER_STEP_US;
>  	DRV_LOG(DEBUG, "event mode is %d.", priv->event_mode);
>  	DRV_LOG(DEBUG, "event_us is %u us.", priv->event_us);
>  	DRV_LOG(DEBUG, "no traffic time is %u s.", priv->no_traffic_time_s);
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
  
Maxime Coquelin Jan. 8, 2021, 9:13 a.m. UTC | #2
On 12/3/20 12:36 AM, Xueming Li wrote:
> To improve throughput and latency, this patch allows Rx polling timer
> delay to 0us.
> 
> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
> ---
>  doc/guides/vdpadevs/mlx5.rst  | 3 +--
>  drivers/vdpa/mlx5/mlx5_vdpa.c | 9 +++------
>  2 files changed, 4 insertions(+), 8 deletions(-)
> 

Series applied to dpdk-next-virtio/main.

Please when multiple patches, add a cover letter to avoid me having to
reply to every patches when applying your series.

Thanks,
Maxime
  
Xueming Li Jan. 8, 2021, 9:56 a.m. UTC | #3
Hi Maxime,

>-----Original Message-----
>From: Maxime Coquelin <maxime.coquelin@redhat.com>
>Sent: Friday, January 8, 2021 5:13 PM
>To: Xueming(Steven) Li <xuemingl@nvidia.com>; Matan Azrad
><matan@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>
>Cc: dev@dpdk.org; Asaf Penso <asafp@nvidia.com>
>Subject: Re: [PATCH 1/4] vdpa/mlx5: set polling mode default delay to zero
>
>
>
>On 12/3/20 12:36 AM, Xueming Li wrote:
>> To improve throughput and latency, this patch allows Rx polling timer
>> delay to 0us.
>>
>> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
>> Acked-by: Matan Azrad <matan@nvidia.com>
>> ---
>>  doc/guides/vdpadevs/mlx5.rst  | 3 +--  drivers/vdpa/mlx5/mlx5_vdpa.c
>> | 9 +++------
>>  2 files changed, 4 insertions(+), 8 deletions(-)
>>
>
>Series applied to dpdk-next-virtio/main.
>
>Please when multiple patches, add a cover letter to avoid me having to reply
>to every patches when applying your series.

Got it, thanks!

>
>Thanks,
>Maxime
  

Patch

diff --git a/doc/guides/vdpadevs/mlx5.rst b/doc/guides/vdpadevs/mlx5.rst
index 3a6d88362d..903fdb0e60 100644
--- a/doc/guides/vdpadevs/mlx5.rst
+++ b/doc/guides/vdpadevs/mlx5.rst
@@ -125,8 +125,7 @@  Driver options
   - 0, A nonzero value to set timer step in micro-seconds. The timer thread
     dynamic delay change steps according to this value. Default value is 1us.
 
-  - 1, A nonzero value to set fixed timer delay in micro-seconds. Default value
-    is 100us.
+  - 1, A value to set fixed timer delay in micro-seconds. Default value is 0us.
 
 - ``no_traffic_time`` parameter [int]
 
diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c
index b64f364eb7..5020a99fae 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa.c
@@ -651,12 +651,9 @@  mlx5_vdpa_config_get(struct rte_devargs *devargs, struct mlx5_vdpa_priv *priv)
 		return;
 	rte_kvargs_process(kvlist, NULL, mlx5_vdpa_args_check_handler, priv);
 	rte_kvargs_free(kvlist);
-	if (!priv->event_us) {
-		if (priv->event_mode == MLX5_VDPA_EVENT_MODE_DYNAMIC_TIMER)
-			priv->event_us = MLX5_VDPA_DEFAULT_TIMER_STEP_US;
-		else if (priv->event_mode == MLX5_VDPA_EVENT_MODE_FIXED_TIMER)
-			priv->event_us = MLX5_VDPA_DEFAULT_TIMER_DELAY_US;
-	}
+	if (!priv->event_us &&
+	    priv->event_mode == MLX5_VDPA_EVENT_MODE_DYNAMIC_TIMER)
+		priv->event_us = MLX5_VDPA_DEFAULT_TIMER_STEP_US;
 	DRV_LOG(DEBUG, "event mode is %d.", priv->event_mode);
 	DRV_LOG(DEBUG, "event_us is %u us.", priv->event_us);
 	DRV_LOG(DEBUG, "no traffic time is %u s.", priv->no_traffic_time_s);