From: Zerun Fu <zerun...@corigine.com> The 'nfp_ct_offload_add()' return 0 means the result is right while return negative number means the wrong result.
The caller assigns the 'int' variable to the 'bool' variable. So the negative number will be transform to 'true'. This will cause an error because 'true' will be regard as no problem. Fixes: b4ae16eae01c ("net/nfp: support to add and delete flows to firmware") Cc: chaoyong...@corigine.com Cc: sta...@dpdk.org Signed-off-by: Zerun Fu <zerun...@corigine.com> Reviewed-by: Chaoyong He <chaoyong...@corigine.com> Reviewed-by: Long Wu <long...@corigine.com> Reviewed-by: Peng Zhang <peng.zh...@corigine.com> --- drivers/net/nfp/flower/nfp_conntrack.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_conntrack.c b/drivers/net/nfp/flower/nfp_conntrack.c index 0b21e4ee5b..439a1a1b0e 100644 --- a/drivers/net/nfp/flower/nfp_conntrack.c +++ b/drivers/net/nfp/flower/nfp_conntrack.c @@ -1440,6 +1440,7 @@ nfp_ct_do_flow_merge(struct nfp_ct_zone_entry *ze, struct nfp_ct_flow_entry *pre_ct_entry, struct nfp_ct_flow_entry *post_ct_entry) { + int err; bool ret; uint64_t new_cookie[2]; uint8_t cnt_same_item = 0; @@ -1508,9 +1509,10 @@ nfp_ct_do_flow_merge(struct nfp_ct_zone_entry *ze, } /* Send to firmware */ - ret = nfp_ct_offload_add(pre_ct_entry->dev, merge_entry); - if (ret != 0) { + err = nfp_ct_offload_add(pre_ct_entry->dev, merge_entry); + if (err != 0) { PMD_DRV_LOG(ERR, "Send the merged flow to firmware failed."); + ret = false; goto merge_table_del; } -- 2.43.5