summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_flow_dv.c
diff options
context:
space:
mode:
authorShahaf Shuler <shahafs@mellanox.com>2018-10-16 09:05:17 +0300
committerFerruh Yigit <ferruh.yigit@intel.com>2018-10-18 10:24:39 +0200
commitcd18e1b72f73b9694e23b639f6d84c8ea71c5af4 (patch)
tree2ec11c719ad07bcdd79937921cd7ff4d7e1140ab /drivers/net/mlx5/mlx5_flow_dv.c
parentaa18d98bcade59d1b808f1074f1dbe9890586e65 (diff)
downloaddpdk-next-eventdev-cd18e1b72f73b9694e23b639f6d84c8ea71c5af4.zip
dpdk-next-eventdev-cd18e1b72f73b9694e23b639f6d84c8ea71c5af4.tar.gz
dpdk-next-eventdev-cd18e1b72f73b9694e23b639f6d84c8ea71c5af4.tar.xz
net/mlx5: fix build on Arm
On some ARM environment, the below compilation error will be seen dpdk/drivers/net/mlx5/mlx5_flow_dv.c: In function 'flow_dv_translate_item_nvgre': /tmp/dpdk/drivers/net/mlx5/mlx5_flow_dv.c:785:22: error: pointer targets in initialization differ in signedness [-Werror=pointer-sign] const char *tni_v = nvgre_v->tni; The reason for this error is that nvgre_v->tni is defined as byte array in size of 3B. However the code in the function iterate till the 4B in order to copy/set also the subsequent field after it (flow_id) Fixing by pointing to this struct from a different pointer. Fixes: fc2c498ccb94 ("net/mlx5: add Direct Verbs translate items") Signed-off-by: Shahaf Shuler <shahafs@mellanox.com> Acked-by: Ori Kam <orika@mellanox.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_flow_dv.c')
-rw-r--r--drivers/net/mlx5/mlx5_flow_dv.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index a013201..becbc57 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -780,6 +780,8 @@ flow_dv_translate_item_nvgre(void *matcher, void *key,
const struct rte_flow_item_nvgre *nvgre_v = item->spec;
void *misc_m = MLX5_ADDR_OF(fte_match_param, matcher, misc_parameters);
void *misc_v = MLX5_ADDR_OF(fte_match_param, key, misc_parameters);
+ const char *tni_flow_id_m = (const char *)nvgre_m->tni;
+ const char *tni_flow_id_v = (const char *)nvgre_v->tni;
char *gre_key_m;
char *gre_key_v;
int size;
@@ -792,9 +794,9 @@ flow_dv_translate_item_nvgre(void *matcher, void *key,
size = sizeof(nvgre_m->tni) + sizeof(nvgre_m->flow_id);
gre_key_m = MLX5_ADDR_OF(fte_match_set_misc, misc_m, gre_key_h);
gre_key_v = MLX5_ADDR_OF(fte_match_set_misc, misc_v, gre_key_h);
- memcpy(gre_key_m, nvgre_m->tni, size);
+ memcpy(gre_key_m, tni_flow_id_m, size);
for (i = 0; i < size; ++i)
- gre_key_v[i] = gre_key_m[i] & ((const char *)(nvgre_v->tni))[i];
+ gre_key_v[i] = gre_key_m[i] & tni_flow_id_v[i];
flow_dv_translate_item_gre(matcher, key, item, inner);
}