DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix 32-bit arch compilation issue
@ 2021-01-28 17:10 Alexander Kozyrev
  2021-01-28 18:22 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Kozyrev @ 2021-01-28 17:10 UTC (permalink / raw)
  To: dev; +Cc: rasland, ferruh.yigit

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/mlx5: fix 32-bit arch compilation issue
  2021-01-28 17:10 [dpdk-dev] [PATCH] net/mlx5: fix 32-bit arch compilation issue Alexander Kozyrev
@ 2021-01-28 18:22 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2021-01-28 18:22 UTC (permalink / raw)
  To: Alexander Kozyrev, dev; +Cc: rasland

On 1/28/2021 5:10 PM, Alexander Kozyrev wrote:
> 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>

Squashed into relevant commit in next-net, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-28 18:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-28 17:10 [dpdk-dev] [PATCH] net/mlx5: fix 32-bit arch compilation issue Alexander Kozyrev
2021-01-28 18:22 ` Ferruh Yigit

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git