@@ -7218,6 +7218,20 @@ static int bnxt_hwrm_cp_ring_alloc_p5(struct bnxt *bp,
7218
7218
return 0 ;
7219
7219
}
7220
7220
7221
+ static int bnxt_hwrm_tx_ring_alloc (struct bnxt * bp ,
7222
+ struct bnxt_tx_ring_info * txr , u32 tx_idx )
7223
+ {
7224
+ struct bnxt_ring_struct * ring = & txr -> tx_ring_struct ;
7225
+ const u32 type = HWRM_RING_ALLOC_TX ;
7226
+ int rc ;
7227
+
7228
+ rc = hwrm_ring_alloc_send_msg (bp , ring , type , tx_idx );
7229
+ if (rc )
7230
+ return rc ;
7231
+ bnxt_set_db (bp , & txr -> tx_db , type , tx_idx , ring -> fw_ring_id );
7232
+ return 0 ;
7233
+ }
7234
+
7221
7235
static int bnxt_hwrm_ring_alloc (struct bnxt * bp )
7222
7236
{
7223
7237
bool agg_rings = !!(bp -> flags & BNXT_FLAG_AGG_RINGS );
@@ -7254,23 +7268,17 @@ static int bnxt_hwrm_ring_alloc(struct bnxt *bp)
7254
7268
}
7255
7269
}
7256
7270
7257
- type = HWRM_RING_ALLOC_TX ;
7258
7271
for (i = 0 ; i < bp -> tx_nr_rings ; i ++ ) {
7259
7272
struct bnxt_tx_ring_info * txr = & bp -> tx_ring [i ];
7260
- struct bnxt_ring_struct * ring ;
7261
- u32 map_idx ;
7262
7273
7263
7274
if (bp -> flags & BNXT_FLAG_CHIP_P5_PLUS ) {
7264
7275
rc = bnxt_hwrm_cp_ring_alloc_p5 (bp , txr -> tx_cpr );
7265
7276
if (rc )
7266
7277
goto err_out ;
7267
7278
}
7268
- ring = & txr -> tx_ring_struct ;
7269
- map_idx = i ;
7270
- rc = hwrm_ring_alloc_send_msg (bp , ring , type , map_idx );
7279
+ rc = bnxt_hwrm_tx_ring_alloc (bp , txr , i );
7271
7280
if (rc )
7272
7281
goto err_out ;
7273
- bnxt_set_db (bp , & txr -> tx_db , type , map_idx , ring -> fw_ring_id );
7274
7282
}
7275
7283
7276
7284
for (i = 0 ; i < bp -> rx_nr_rings ; i ++ ) {
0 commit comments