@@ -57,13 +57,20 @@ static void bnxt_qplib_service_creq(struct tasklet_struct *t);
57
57
* bnxt_qplib_map_rc - map return type based on opcode
58
58
* @opcode - roce slow path opcode
59
59
*
60
- * In some cases like firmware halt is detected, the driver is supposed to
61
- * remap the error code of the timed out command.
60
+ * case #1
61
+ * Firmware initiated error recovery is a safe state machine and
62
+ * driver can consider all the underlying rdma resources are free.
63
+ * In this state, it is safe to return success for opcodes related to
64
+ * destroying rdma resources (like destroy qp, destroy cq etc.).
62
65
*
63
- * It is not safe to assume hardware is really inactive so certain opcodes
64
- * like destroy qp etc are not safe to be returned success, but this function
65
- * will be called when FW already reports a timeout. This would be possible
66
- * only when FW crashes and resets. This will clear all the HW resources.
66
+ * case #2
67
+ * If driver detect potential firmware stall, it is not safe state machine
68
+ * and the driver can not consider all the underlying rdma resources are
69
+ * freed.
70
+ * In this state, it is not safe to return success for opcodes related to
71
+ * destroying rdma resources (like destroy qp, destroy cq etc.).
72
+ *
73
+ * Scope of this helper function is only for case #1.
67
74
*
68
75
* Returns:
69
76
* 0 to communicate success to caller.
@@ -417,7 +424,7 @@ static int __send_message_basic_sanity(struct bnxt_qplib_rcfw *rcfw,
417
424
418
425
/* Prevent posting if f/w is not in a state to process */
419
426
if (test_bit (ERR_DEVICE_DETACHED , & rcfw -> cmdq .flags ))
420
- return - ENXIO ;
427
+ return bnxt_qplib_map_rc ( opcode ) ;
421
428
if (test_bit (FIRMWARE_STALL_DETECTED , & cmdq -> flags ))
422
429
return - ETIMEDOUT ;
423
430
@@ -487,7 +494,7 @@ static int __bnxt_qplib_rcfw_send_message(struct bnxt_qplib_rcfw *rcfw,
487
494
488
495
rc = __send_message_basic_sanity (rcfw , msg , opcode );
489
496
if (rc )
490
- return rc == - ENXIO ? bnxt_qplib_map_rc ( opcode ) : rc ;
497
+ return rc ;
491
498
492
499
rc = __send_message (rcfw , msg , opcode );
493
500
if (rc )
0 commit comments