DPDK patches and discussions
 help / color / mirror / Atom feed
From: Alexander Kozyrev <akozyrev@nvidia.com>
To: dev@dpdk.org
Cc: rasland@nvidia.com, ferruh.yigit@intel.com
Subject: [dpdk-dev] [PATCH] net/mlx5: fix 32-bit arch compilation issue
Date: Thu, 28 Jan 2021 17:10:30 +0000	[thread overview]
Message-ID: <20210128171030.17013-1-akozyrev@nvidia.com> (raw)

There is a "cast to pointer from integer of different size"
compilation failure on 32-bit machines introduced by the
RTE_FLOW_ACTION_TYPE_MODIFY_FIELD implementation in mlx5 PMD.

Cast the specified value to be used as RTE_FLOW_FIELD_POINTER
to a pointer with an appropriate size suited for underlying arch.
Please squash this patch into the original commit if possible.

Fixes: 80ec1e84a4 ("net/mlx5: support modify field flow action")

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index ec9cee8f25..a151c62c3a 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -1749,7 +1749,9 @@ mlx5_flow_field_id_to_modify_info
 	case RTE_FLOW_FIELD_POINTER:
 		for (idx = 0; idx < MLX5_ACT_MAX_MOD_FIELDS; idx++) {
 			if (mask[idx]) {
-				value[idx] = RTE_BE32(*(uint64_t *)data->value);
+				memcpy(&value[idx],
+					(void *)(uintptr_t)data->value, 32);
+				value[idx] = RTE_BE32(value[idx]);
 				break;
 			}
 		}
@@ -1757,7 +1759,7 @@ mlx5_flow_field_id_to_modify_info
 	case RTE_FLOW_FIELD_VALUE:
 		for (idx = 0; idx < MLX5_ACT_MAX_MOD_FIELDS; idx++) {
 			if (mask[idx]) {
-				value[idx] = RTE_BE32(data->value);
+				value[idx] = RTE_BE32((uint32_t)data->value);
 				break;
 			}
 		}
-- 
2.24.1


             reply	other threads:[~2021-01-28 17:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-28 17:10 Alexander Kozyrev [this message]
2021-01-28 18:22 ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210128171030.17013-1-akozyrev@nvidia.com \
    --to=akozyrev@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=rasland@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).