DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: work around compilation issue
@ 2016-07-13 14:33 Adrien Mazarguil
  2016-07-15 21:00 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Adrien Mazarguil @ 2016-07-13 14:33 UTC (permalink / raw)
  To: dev; +Cc: Olga Shern

From: Olga Shern <olgas@mellanox.com>

RHEL 7.1's GCC for POWER8 reports the following error in one rte_memcpy()
macro call by mlx5:

 error: array subscript is above array bounds [-Werror=array-bounds]

It appears to be a GCC bug which can be worked around by making parentheses
more explicit.

Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 drivers/net/mlx5/mlx5_rxtx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 615de94..fce3381 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -472,8 +472,8 @@ mlx5_wqe_write_inline_vlan(struct txq *txq, volatile union mlx5_wqe *wqe,
 		   (uint8_t *)addr, 12);
 	rte_memcpy((uint8_t *)(uintptr_t)wqe->inl.eseg.inline_hdr_start + 12,
 		   &vlan, sizeof(vlan));
-	rte_memcpy((uint8_t *)(uintptr_t)wqe->inl.eseg.inline_hdr_start + 16,
-		   ((uint8_t *)addr + 12), 2);
+	rte_memcpy((uint8_t *)((uintptr_t)wqe->inl.eseg.inline_hdr_start + 16),
+		   (uint8_t *)(addr + 12), 2);
 	addr += MLX5_ETH_VLAN_INLINE_HEADER_SIZE - sizeof(vlan);
 	length -= MLX5_ETH_VLAN_INLINE_HEADER_SIZE - sizeof(vlan);
 	size = (sizeof(wqe->inl.ctrl.ctrl) +
-- 
2.1.4

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

* Re: [dpdk-dev] [PATCH] net/mlx5: work around compilation issue
  2016-07-13 14:33 [dpdk-dev] [PATCH] net/mlx5: work around compilation issue Adrien Mazarguil
@ 2016-07-15 21:00 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2016-07-15 21:00 UTC (permalink / raw)
  To: Olga Shern; +Cc: dev, Adrien Mazarguil

2016-07-13 16:33, Adrien Mazarguil:
> From: Olga Shern <olgas@mellanox.com>
> 
> RHEL 7.1's GCC for POWER8 reports the following error in one rte_memcpy()
> macro call by mlx5:
> 
>  error: array subscript is above array bounds [-Werror=array-bounds]
> 
> It appears to be a GCC bug which can be worked around by making parentheses
> more explicit.
> 
> Signed-off-by: Olga Shern <olgas@mellanox.com>
> Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

Applied, thanks

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

end of thread, other threads:[~2016-07-15 21:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-13 14:33 [dpdk-dev] [PATCH] net/mlx5: work around compilation issue Adrien Mazarguil
2016-07-15 21:00 ` Thomas Monjalon

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).