* [dpdk-dev] [PATCH] common/mlx5: fix umem buffer alignment
@ 2020-05-11 10:02 Dekel Peled
2020-05-12 11:52 ` Raslan Darawsheh
0 siblings, 1 reply; 2+ messages in thread
From: Dekel Peled @ 2020-05-11 10:02 UTC (permalink / raw)
To: matan, viacheslavo, rasland; +Cc: dev, stable
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dpdk-dev] [PATCH] common/mlx5: fix umem buffer alignment
2020-05-11 10:02 [dpdk-dev] [PATCH] common/mlx5: fix umem buffer alignment Dekel Peled
@ 2020-05-12 11:52 ` Raslan Darawsheh
0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2020-05-12 11:52 UTC (permalink / raw)
To: Dekel Peled, Matan Azrad, Slava Ovsiienko; +Cc: dev, stable
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-12 11:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-11 10:02 [dpdk-dev] [PATCH] common/mlx5: fix umem buffer alignment Dekel Peled
2020-05-12 11:52 ` Raslan Darawsheh
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).