From: Sokolov Evgeny <[email protected]>

The return value of ulp_regfile_write() is not checked in this path,
but failures may indicate issues when updating the EM insertion
status in the regfile.

Add a debug log to help diagnose potential failures during flow
processing.

Found by InfoTeCS on behalf of Linux Verification Center (linuxtesting.org) 
with SVACE.

Fixes: dd0191d5e70 ("net/bnxt/tf_ulp: support Thor2 ULP layer")
Cc: [email protected]

Signed-off-by: Sokolov Evgeny <[email protected]>
---
 drivers/net/bnxt/tf_ulp/ulp_mapper_tfc.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper_tfc.c 
b/drivers/net/bnxt/tf_ulp/ulp_mapper_tfc.c
index 2d89f10d5e..ec6ddaf6d6 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_mapper_tfc.c
+++ b/drivers/net/bnxt/tf_ulp/ulp_mapper_tfc.c
@@ -603,8 +603,11 @@ ulp_mapper_tfc_em_tbl_process(struct bnxt_ulp_mapper_parms 
*parms,
                                BNXT_DRV_DBG(DEBUG,
                                             "Fail to insert EM, shall add to 
wc\n");
                        }
-                       ulp_regfile_write(parms->regfile, tbl->tbl_operand,
-                                         rte_cpu_to_be_64(val));
+                       if (unlikely(ulp_regfile_write(parms->regfile, 
tbl->tbl_operand,
+                                                      rte_cpu_to_be_64(val)))) 
{
+                               BNXT_DRV_DBG(DEBUG, "Regfile[%d] write 
failed.\n",
+                                            tbl->tbl_operand);
+                       }
                }
 
                if (rc && rc != -E2BIG)
-- 
2.30.2

Reply via email to