net/mlx5: fix doorbell register offset type

Message ID 1578925357-7088-1-git-send-email-viacheslavo@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: fix doorbell register offset type |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-testing success Testing PASS
ci/travis-robot success Travis build: passed

Commit Message

Slava Ovsiienko Jan. 13, 2020, 2:22 p.m. UTC
  The doorbell register is mapped using mmap() and offset
must have off_t instead of unsigned int. Bug is not critical
due to only least significant bits of offset are currently
tested to determine mapping mode.

Fixes: 8409a28573d3 ("net/mlx5: control transmit doorbell register mapping")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
---
 drivers/net/mlx5/mlx5_txq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Matan Azrad Jan. 13, 2020, 2:29 p.m. UTC | #1
From: Viacheslav Ovsiienko
> The doorbell register is mapped using mmap() and offset must have off_t
> instead of unsigned int. Bug is not critical due to only least significant bits of
> offset are currently tested to determine mapping mode.
> 
> Fixes: 8409a28573d3 ("net/mlx5: control transmit doorbell register mapping")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
  
Raslan Darawsheh Jan. 15, 2020, 10:09 a.m. UTC | #2
Hi,


> -----Original Message-----
> From: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> Sent: Monday, January 13, 2020 4:23 PM
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@mellanox.com>; Raslan Darawsheh
> <rasland@mellanox.com>; Ori Kam <orika@mellanox.com>; Shahaf Shuler
> <shahafs@mellanox.com>; stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix doorbell register offset type
> 
> The doorbell register is mapped using mmap() and offset must have off_t
> instead of unsigned int. Bug is not critical due to only least significant bits of
> offset are currently tested to determine mapping mode.
> 
> Fixes: 8409a28573d3 ("net/mlx5: control transmit doorbell register mapping")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_txq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
> index c750082..1a76f6e 100644
> --- a/drivers/net/mlx5/mlx5_txq.c
> +++ b/drivers/net/mlx5/mlx5_txq.c
> @@ -314,7 +314,7 @@
>  txq_uar_ncattr_init(struct mlx5_txq_ctrl *txq_ctrl, size_t page_size)  {
>  	struct mlx5_priv *priv = txq_ctrl->priv;
> -	unsigned int cmd;
> +	off_t cmd;
> 
>  	txq_ctrl->txq.db_heu = priv->config.dbnc ==
> MLX5_TXDB_HEURISTIC;
>  	txq_ctrl->txq.db_nc = 0;
> --
> 1.8.3.1


Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh
  

Patch

diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index c750082..1a76f6e 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -314,7 +314,7 @@ 
 txq_uar_ncattr_init(struct mlx5_txq_ctrl *txq_ctrl, size_t page_size)
 {
 	struct mlx5_priv *priv = txq_ctrl->priv;
-	unsigned int cmd;
+	off_t cmd;
 
 	txq_ctrl->txq.db_heu = priv->config.dbnc == MLX5_TXDB_HEURISTIC;
 	txq_ctrl->txq.db_nc = 0;