common/mlx5: fix umem buffer alignment

Message ID 7a382de5e9be260f7cadb07fd5396f48615ea911.1589191348.git.dekelp@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series common/mlx5: fix umem buffer alignment |

Checks

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

Commit Message

Dekel Peled May 11, 2020, 10:02 a.m. UTC
  The value MLX5_WQE_BUF_ALIGNMENT is defined as 512.
In some cases this alignment size is not adequate, which results in
memory registration that is not accepted by FW.
The result error can be "page_offset is not aligned to page_size/64,
bad umem_offset" (syndrome 0x357275).

This patch updates the definition to match the running system.

Fixes: 18a68e046b51 ("net/mlx5: fix DevX Rx queue memory alignment")
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/common/mlx5/mlx5_prm.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Raslan Darawsheh May 12, 2020, 11:52 a.m. UTC | #1
Hi,
> -----Original Message-----
> From: Dekel Peled <dekelp@mellanox.com>
> Sent: Monday, May 11, 2020 1:03 PM
> To: Matan Azrad <matan@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>; Raslan Darawsheh <rasland@mellanox.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH] common/mlx5: fix umem buffer alignment
> 
> The value MLX5_WQE_BUF_ALIGNMENT is defined as 512.
> In some cases this alignment size is not adequate, which results in
> memory registration that is not accepted by FW.
> The result error can be "page_offset is not aligned to page_size/64,
> bad umem_offset" (syndrome 0x357275).
> 
> This patch updates the definition to match the running system.
> 
> Fixes: 18a68e046b51 ("net/mlx5: fix DevX Rx queue memory alignment")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
> Acked-by: Matan Azrad <matan@mellanox.com>
> ---
>  drivers/common/mlx5/mlx5_prm.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/common/mlx5/mlx5_prm.h
> b/drivers/common/mlx5/mlx5_prm.h
> index 4ab1c75..b39a141 100644
> --- a/drivers/common/mlx5/mlx5_prm.h
> +++ b/drivers/common/mlx5/mlx5_prm.h
> @@ -16,6 +16,8 @@
>  #pragma GCC diagnostic error "-Wpedantic"
>  #endif
> 
> +#include <unistd.h>
> +
>  #include <rte_vect.h>
>  #include <rte_byteorder.h>
> 
> @@ -251,7 +253,7 @@
>  #define MLX5_MAX_LOG_RQ_SEGS 5u
> 
>  /* The alignment needed for WQ buffer. */
> -#define MLX5_WQE_BUF_ALIGNMENT 512
> +#define MLX5_WQE_BUF_ALIGNMENT sysconf(_SC_PAGESIZE)
> 
>  /* Completion mode. */
>  enum mlx5_completion_mode {
> --
> 1.8.3.1


Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh
  

Patch

diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h
index 4ab1c75..b39a141 100644
--- a/drivers/common/mlx5/mlx5_prm.h
+++ b/drivers/common/mlx5/mlx5_prm.h
@@ -16,6 +16,8 @@ 
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
+#include <unistd.h>
+
 #include <rte_vect.h>
 #include <rte_byteorder.h>
 
@@ -251,7 +253,7 @@ 
 #define MLX5_MAX_LOG_RQ_SEGS 5u
 
 /* The alignment needed for WQ buffer. */
-#define MLX5_WQE_BUF_ALIGNMENT 512
+#define MLX5_WQE_BUF_ALIGNMENT sysconf(_SC_PAGESIZE)
 
 /* Completion mode. */
 enum mlx5_completion_mode {