acl: fix build failure with gcc 5.4.0

Message ID 20201015115356.28171-1-konstantin.ananyev@intel.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series acl: fix build failure with gcc 5.4.0 |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-testing success Testing PASS
ci/travis-robot warning Travis build: failed
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Ananyev, Konstantin Oct. 15, 2020, 11:53 a.m. UTC
  gcc 5.4 fails with:
../lib/librte_acl/acl_run_avx512x8.h: In function 'match_process_avx512x8':
../lib/librte_acl/acl_run_avx512x8.h:382:31: error:
pointer targets in passing argument 1 of '_mm256_mask_i32scatter_epi32'
differ in signedness [-Werror=pointer-sign]

Later gcc versions work fine, as for them parameter type was
changed to 'void *'.
Fixed by applying explicit cast for offending argument.

Fixes: b64c2295f7fc ("acl: add 256-bit AVX512 classify method")
Fixes: 45da22e42ec3 ("acl: add 512-bit AVX512 classify method")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 lib/librte_acl/acl_run_avx512_common.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Ali Alnubani Oct. 15, 2020, 12:28 p.m. UTC | #1
Thanks Konstantin.

> -----Original Message-----
> From: Konstantin Ananyev <konstantin.ananyev@intel.com>
> Sent: Thursday, October 15, 2020 2:54 PM
> To: dev@dpdk.org
> Cc: alialnu@mellanox.com; david.marchand@redhat.com; Konstantin
> Ananyev <konstantin.ananyev@intel.com>
> Subject: [PATCH] acl: fix build failure with gcc 5.4.0
> 
> gcc 5.4 fails with:
> ../lib/librte_acl/acl_run_avx512x8.h: In function 'match_process_avx512x8':
> ../lib/librte_acl/acl_run_avx512x8.h:382:31: error:
> pointer targets in passing argument 1 of '_mm256_mask_i32scatter_epi32'
> differ in signedness [-Werror=pointer-sign]
> 
> Later gcc versions work fine, as for them parameter type was changed to
> 'void *'.
> Fixed by applying explicit cast for offending argument.
> 
> Fixes: b64c2295f7fc ("acl: add 256-bit AVX512 classify method")
> Fixes: 45da22e42ec3 ("acl: add 512-bit AVX512 classify method")
> 
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> ---

Tested-by: Ali Alnubani <alialnu@nvidia.com>

- Ali
  
David Marchand Oct. 15, 2020, 12:55 p.m. UTC | #2
On Thu, Oct 15, 2020 at 1:54 PM Konstantin Ananyev
<konstantin.ananyev@intel.com> wrote:
>
> gcc 5.4 fails with:
> ../lib/librte_acl/acl_run_avx512x8.h: In function 'match_process_avx512x8':
> ../lib/librte_acl/acl_run_avx512x8.h:382:31: error:
> pointer targets in passing argument 1 of '_mm256_mask_i32scatter_epi32'
> differ in signedness [-Werror=pointer-sign]
>
> Later gcc versions work fine, as for them parameter type was
> changed to 'void *'.
> Fixed by applying explicit cast for offending argument.
>
Bugzilla ID: 556
> Fixes: b64c2295f7fc ("acl: add 256-bit AVX512 classify method")
> Fixes: 45da22e42ec3 ("acl: add 512-bit AVX512 classify method")
>
Reported-by: Ali Alnubani <alialnu@nvidia.com>
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Ali Alnubani <alialnu@nvidia.com>


Applied, thanks.
  

Patch

diff --git a/lib/librte_acl/acl_run_avx512_common.h b/lib/librte_acl/acl_run_avx512_common.h
index 1baf79b7a..fafaf591e 100644
--- a/lib/librte_acl/acl_run_avx512_common.h
+++ b/lib/librte_acl/acl_run_avx512_common.h
@@ -246,8 +246,8 @@  _F_(match_process)(struct acl_flow_avx512 *flow, uint32_t *fmsk,
 	tr_hi[0] = _M_I_(mask_mov_epi32)(tr_hi[0], rmsk[0], _SV_(trhi_idle));
 
 	/* save found match indexes */
-	_M_I_(mask_i32scatter_epi32)(flow->matches, rmsk[0], idx[0], res,
-			sizeof(flow->matches[0]));
+	_M_I_(mask_i32scatter_epi32)((void *)flow->matches, rmsk[0], idx[0],
+			res, sizeof(flow->matches[0]));
 
 	/* update masks and start new flows for matches */
 	n = update_flow_mask(flow, fmsk, rmsk);