@@ -7368,6 +7368,23 @@ static int hwrm_ring_free_send_msg(struct bnxt *bp,
7368
7368
return 0 ;
7369
7369
}
7370
7370
7371
+ static void bnxt_hwrm_tx_ring_free (struct bnxt * bp ,
7372
+ struct bnxt_tx_ring_info * txr ,
7373
+ bool close_path )
7374
+ {
7375
+ struct bnxt_ring_struct * ring = & txr -> tx_ring_struct ;
7376
+ u32 cmpl_ring_id ;
7377
+
7378
+ if (ring -> fw_ring_id == INVALID_HW_RING_ID )
7379
+ return ;
7380
+
7381
+ cmpl_ring_id = close_path ? bnxt_cp_ring_for_tx (bp , txr ) :
7382
+ INVALID_HW_RING_ID ;
7383
+ hwrm_ring_free_send_msg (bp , ring , RING_FREE_REQ_RING_TYPE_TX ,
7384
+ cmpl_ring_id );
7385
+ ring -> fw_ring_id = INVALID_HW_RING_ID ;
7386
+ }
7387
+
7371
7388
static void bnxt_hwrm_rx_ring_free (struct bnxt * bp ,
7372
7389
struct bnxt_rx_ring_info * rxr ,
7373
7390
bool close_path )
@@ -7447,20 +7464,8 @@ static void bnxt_hwrm_ring_free(struct bnxt *bp, bool close_path)
7447
7464
if (!bp -> bnapi )
7448
7465
return ;
7449
7466
7450
- for (i = 0 ; i < bp -> tx_nr_rings ; i ++ ) {
7451
- struct bnxt_tx_ring_info * txr = & bp -> tx_ring [i ];
7452
- struct bnxt_ring_struct * ring = & txr -> tx_ring_struct ;
7453
-
7454
- if (ring -> fw_ring_id != INVALID_HW_RING_ID ) {
7455
- u32 cmpl_ring_id = bnxt_cp_ring_for_tx (bp , txr );
7456
-
7457
- hwrm_ring_free_send_msg (bp , ring ,
7458
- RING_FREE_REQ_RING_TYPE_TX ,
7459
- close_path ? cmpl_ring_id :
7460
- INVALID_HW_RING_ID );
7461
- ring -> fw_ring_id = INVALID_HW_RING_ID ;
7462
- }
7463
- }
7467
+ for (i = 0 ; i < bp -> tx_nr_rings ; i ++ )
7468
+ bnxt_hwrm_tx_ring_free (bp , & bp -> tx_ring [i ], close_path );
7464
7469
7465
7470
bnxt_cancel_dim (bp );
7466
7471
for (i = 0 ; i < bp -> rx_nr_rings ; i ++ ) {
0 commit comments