From patchwork Mon Oct 15 08:23:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shahaf Shuler X-Patchwork-Id: 46814 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 37C3023D; Mon, 15 Oct 2018 10:24:11 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id E05FB239 for ; Mon, 15 Oct 2018 10:24:09 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from shahafs@mellanox.com) with ESMTPS (AES256-SHA encrypted); 15 Oct 2018 10:29:04 +0200 Received: from unicorn01.mtl.labs.mlnx. (unicorn01.mtl.labs.mlnx [10.7.12.62]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id w9F8O7xV024544; Mon, 15 Oct 2018 11:24:07 +0300 From: Shahaf Shuler To: yskoh@mellanox.com Cc: dev@dpdk.org, orika@mellanox.com, xuemingl@mellanox.com Date: Mon, 15 Oct 2018 11:23:52 +0300 Message-Id: <20181015082352.81673-1-shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 Subject: [dpdk-dev] [PATCH] net/mlx5: fix compilation issue on ARM SOC X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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") Cc: orika@mellanox.com Cc: xuemingl@mellanox.com Signed-off-by: Shahaf Shuler --- drivers/net/mlx5/mlx5_flow_dv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index a013201eab..05df8d51a4 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -780,6 +780,7 @@ 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_v = (const char *)&nvgre_v->tni; char *gre_key_m; char *gre_key_v; int size; @@ -794,7 +795,7 @@ flow_dv_translate_item_nvgre(void *matcher, void *key, gre_key_v = MLX5_ADDR_OF(fte_match_set_misc, misc_v, gre_key_h); memcpy(gre_key_m, nvgre_m->tni, 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_v[i]; flow_dv_translate_item_gre(matcher, key, item, inner); }