Skip to contentSkip to conversation

node: fix arm64 build issue for older gcc

PATCH Superseded Nithin Dabilpuram 4 participants 6 messages May 13, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 node: fix arm64 build issue for older gcc

Older GCC(~4) complains about uninitialized 'dip' var though all the lanes of the vec register are set. Hence this patch explicitly initializes vec register to fix the issue.

Fixes 16df6a2c6671 ("node: add IPv4 lookup for arm64")
---
 lib/librte_node/ip4_lookup_neon.h | 1 +
 1 file changed, 1 insertion(+)
lib/librte_node/ip4_lookup_neon.h +1 -0
index bb3150f..dd21cb2 100644
@@ -45,6 +45,7 @@ ip4_lookup_node_process(struct rte_graph *graph, struct rte_node *node,
 		rte_prefetch0(rte_pktmbuf_mtod_offset(pkts[i], void *,
 						sizeof(struct rte_ether_hdr)));
 
+	dip = vdupq_n_s32(0);
 	/* Get stream for the speculated next node */
 	to_next = rte_node_next_stream_get(graph, node, next_index, nb_objs);
 	while (n_left_from >= 4) {
Signature · 1 line
2.8.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Nithin Dabilpuram
Sent: Wednesday, May 13, 2020 1:48 PM
To: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>; Pavan Nikhilesh <[email protected]>
Cc: [email protected]
Subject: [dpdk-dev] [PATCH] node: fix arm64 build issue for older gcc

Quoted 2 lines

Older GCC(~4) complains about uninitialized 'dip' var though all the lanes of the vec register are set.

Better to add compiler output here.
Otherwise looks good to me.

Quoted 27 lines

Hence this patch explicitly initializes vec register to fix the issue.

Fixes 16df6a2c6671 ("node: add IPv4 lookup for arm64")
---
 lib/librte_node/ip4_lookup_neon.h | 1 +
 1 file changed, 1 insertion(+)
lib/librte_node/ip4_lookup_neon.h +1 -0
index bb3150f..dd21cb2 100644
@@ -45,6 +45,7 @@ ip4_lookup_node_process(struct rte_graph *graph,
 struct rte_node *node,
 		rte_prefetch0(rte_pktmbuf_mtod_offset(pkts[i], void *,
 						sizeof(struct
 rte_ether_hdr)));
 
+	dip = vdupq_n_s32(0);
 	/* Get stream for the speculated next node */

to_next = rte_node_next_stream_get(graph, node, next_index,
nb_objs);
while (n_left_from >= 4) {
--
2.8.4

#2 lore raw
Quoted 13 lines · Ruifeng Wang

External Email

----------------------------------------------------------------------

Quoted 9 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Nithin Dabilpuram
Sent: Wednesday, May 13, 2020 1:48 PM
To: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>; Pavan Nikhilesh <[email protected]>
Cc: [email protected]
Subject: [dpdk-dev] [PATCH] node: fix arm64 build issue for older gcc

Quoted 6 lines
Quoted 2 lines

Older GCC(~4) complains about uninitialized 'dip' var though all the lanes of the vec register are set.

Better to add compiler output here.
Otherwise looks good to me.

Ack. Will send a v2.

Quoted 29 lines
Quoted 28 lines

Hence this patch explicitly initializes vec register to fix the issue.

Fixes 16df6a2c6671 ("node: add IPv4 lookup for arm64")
---
 lib/librte_node/ip4_lookup_neon.h | 1 +
 1 file changed, 1 insertion(+)
lib/librte_node/ip4_lookup_neon.h +1 -0
index bb3150f..dd21cb2 100644
@@ -45,6 +45,7 @@ ip4_lookup_node_process(struct rte_graph *graph,
 struct rte_node *node,
 		rte_prefetch0(rte_pktmbuf_mtod_offset(pkts[i], void *,
 						sizeof(struct
 rte_ether_hdr)));
 
+	dip = vdupq_n_s32(0);
 	/* Get stream for the speculated next node */

to_next = rte_node_next_stream_get(graph, node, next_index,
nb_objs);
while (n_left_from >= 4) {
--
2.8.4

#3 lore raw

PATCH v2 1/1 node: fix arm64 build issue for older gcc

In reply to Nithin Dabilpuram

Older GCC(~4) complains about uninitialized 'dip' var though all the lanes of the vec register are set. Hence this patch explicitly initializes vec register to fix the issue.

In file included from ip4_lookup.c:34:0:
ip4_lookup_neon.h: n function ‘ip4_lookup_node_process’: \
ip4_lookup_neon.h:25:12: error: ‘dip’ may be used uninitialized in \
this function [-Werror=maybe-uninitialized]

  int32x4_t dip;
            ^
Fixes 16df6a2c6671 ("node: add IPv4 lookup for arm64")

---
v2:
- Add error in commit msg.

 lib/librte_node/ip4_lookup_neon.h | 1 +
 1 file changed, 1 insertion(+)
lib/librte_node/ip4_lookup_neon.h +1 -0
index bb3150f..dd21cb2 100644
@@ -45,6 +45,7 @@ ip4_lookup_node_process(struct rte_graph *graph, struct rte_node *node,
 		rte_prefetch0(rte_pktmbuf_mtod_offset(pkts[i], void *,
 						sizeof(struct rte_ether_hdr)));
 
+	dip = vdupq_n_s32(0);
 	/* Get stream for the speculated next node */
 	to_next = rte_node_next_stream_get(graph, node, next_index, nb_objs);
 	while (n_left_from >= 4) {
Signature · 1 line
2.8.4
Reviewed-by on v2 1/1
#4 lore raw
Quoted 6 lines · Nithin Dabilpuram

Older GCC(~4) complains about uninitialized 'dip' var though all the lanes of the vec register are set. Hence this patch explicitly initializes vec register to fix the issue.

Quoted 9 lines

In file included from ip4_lookup.c:34:0:
ip4_lookup_neon.h: n function ‘ip4_lookup_node_process’: \
ip4_lookup_neon.h:25:12: error: ‘dip’ may be used uninitialized in \
this function [-Werror=maybe-uninitialized]

  int32x4_t dip;
            ^
Fixes 16df6a2c6671 ("node: add IPv4 lookup for arm64")
Quoted 2 lines

It is a false positive, all the lines are updated by the c code. Just to make the old compiler to happy we need to add unnecessary additional instruction.
Looks like there is no other clean way to suppress the warning.

Quoted 22 lines

---
v2:
- Add error in commit msg.

 lib/librte_node/ip4_lookup_neon.h | 1 +
 1 file changed, 1 insertion(+)
lib/librte_node/ip4_lookup_neon.h +1 -1
index bb3150f..dd21cb2 100644
@@ -45,6 +45,7 @@ ip4_lookup_node_process(struct rte_graph *graph, struct rte_node *node,
                rte_prefetch0(rte_pktmbuf_mtod_offset(pkts[i], void *,
                                                sizeof(struct rte_ether_hdr)));
 
+       dip = vdupq_n_s32(0);
        /* Get stream for the speculated next node */
        to_next = rte_node_next_stream_get(graph, node, next_index, nb_objs);
        while (n_left_from >= 4) {
--

2.8.4

#5 lore raw
Quoted 16 lines · Jerin Jacob
Quoted 13 lines · Nithin Dabilpuram

Older GCC(~4) complains about uninitialized 'dip' var though all the lanes of the vec register are set. Hence this patch explicitly initializes vec register to fix the issue.

In file included from ip4_lookup.c:34:0:
ip4_lookup_neon.h: n function ‘ip4_lookup_node_process’: \
ip4_lookup_neon.h:25:12: error: ‘dip’ may be used uninitialized in \
this function [-Werror=maybe-uninitialized]

  int32x4_t dip;
            ^
Quoted 6 lines
Quoted 1 line
Fixes 16df6a2c6671 ("node: add IPv4 lookup for arm64")
Quoted 2 lines

Applied, thanks.

Signature · 1 line
David Marchand