Thread (12 messages) 12 messages, 4 authors, 2016-10-12

Re: [PATCH v2] net/mlx5: return RSS hash result in mbuf

From: Ferruh Yigit <hidden>
Date: 2016-09-27 17:03:53

On 9/27/2016 3:53 PM, Nelio Laranjeiro wrote:
Signed-off-by: Nelio Laranjeiro <redacted>
<...>
quoted hunk ↗ jump to hunk
@@ -1286,12 +1291,13 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 		&(*rxq->cqes)[rxq->cq_ci & cqe_cnt].cqe64;
 	unsigned int i = 0;
 	unsigned int rq_ci = rxq->rq_ci << sges_n;
-	int len;
 
 	while (pkts_n) {
 		unsigned int idx = rq_ci & wqe_cnt;
 		volatile struct mlx5_wqe_data_seg *wqe = &(*rxq->wqes)[idx];
 		struct rte_mbuf *rep = (*rxq->elts)[idx];
+		int len;
clang generates following warning, -it is quite detailed compiler message:

.../drivers/net/mlx5/mlx5_rxtx.c:1327:7: error: variable 'len' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
                if (!pkt) {
                    ^~~~
.../drivers/net/mlx5/mlx5_rxtx.c:1384:7: note: uninitialized use occurs here
                if (len > DATA_LEN(seg)) {
                    ^~~
.../drivers/net/mlx5/mlx5_rxtx.c:1327:3: note: remove the 'if' if its
condition is always true
                if (!pkt) {
                ^~~~~~~~~~
.../drivers/net/mlx5/mlx5_rxtx.c:1299:10: note: initialize the variable
'len' to silence this warning
                int len;
                       ^
                        = 0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help