Skip to content

Commit

Permalink
node: remove useless return code assignment
Browse files Browse the repository at this point in the history
No need to store the return code of rte_lpm6_lookup_bulk_func()
as it returns error only if parameters are NULL.
In the function ip6_lookup_node_process_scalar(),
these variables will never be NULL.

Not checking the return code will avoid check in datapath.
Storing of the return code is useless and removed.

Coverity issue: 385595
Fixes: 20365d7 ("node: add IPv6 lookup node")

Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>
  • Loading branch information
Amit Prakash Shukla authored and tmonjalo committed Jun 27, 2023
1 parent 1ec0a44 commit 4a53ece
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/node/ip6_lookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ ip6_lookup_node_process_scalar(struct rte_graph *graph, struct rte_node *node,
node_mbuf_priv1(mbuf3, dyn)->ttl = ipv6_hdr->hop_limits;
rte_memcpy(ip_batch[3], ipv6_hdr->dst_addr, 16);

rc = rte_lpm6_lookup_bulk_func(lpm6, ip_batch, next_hop, 4);
rte_lpm6_lookup_bulk_func(lpm6, ip_batch, next_hop, 4);

next_hop[0] = (next_hop[0] < 0) ? (int32_t)drop_nh : next_hop[0];
node_mbuf_priv1(mbuf0, dyn)->nh = (uint16_t)next_hop[0];
Expand Down

0 comments on commit 4a53ece

Please sign in to comment.