@@ -2317,6 +2317,7 @@ static int bnxt_alloc_rx_rings(struct bnxt *bp)
2317
2317
if (rc )
2318
2318
return rc ;
2319
2319
2320
+ ring -> grp_idx = i ;
2320
2321
rxr -> rx_agg_bmap_size = bp -> rx_agg_ring_mask + 1 ;
2321
2322
mem_size = rxr -> rx_agg_bmap_size / 8 ;
2322
2323
rxr -> rx_agg_bmap = kzalloc (mem_size , GFP_KERNEL );
@@ -2389,6 +2390,7 @@ static int bnxt_alloc_tx_rings(struct bnxt *bp)
2389
2390
if (rc )
2390
2391
return rc ;
2391
2392
2393
+ ring -> grp_idx = txr -> bnapi -> index ;
2392
2394
if (bp -> tx_push_size ) {
2393
2395
dma_addr_t mapping ;
2394
2396
@@ -2458,6 +2460,7 @@ static int bnxt_alloc_cp_rings(struct bnxt *bp)
2458
2460
rc = bnxt_alloc_ring (bp , ring );
2459
2461
if (rc )
2460
2462
return rc ;
2463
+ ring -> map_idx = i ;
2461
2464
}
2462
2465
return 0 ;
2463
2466
}
@@ -4253,12 +4256,12 @@ static int bnxt_hwrm_ring_grp_free(struct bnxt *bp)
4253
4256
4254
4257
static int hwrm_ring_alloc_send_msg (struct bnxt * bp ,
4255
4258
struct bnxt_ring_struct * ring ,
4256
- u32 ring_type , u32 map_index ,
4257
- u32 stats_ctx_id )
4259
+ u32 ring_type , u32 map_index )
4258
4260
{
4259
4261
int rc = 0 , err = 0 ;
4260
4262
struct hwrm_ring_alloc_input req = {0 };
4261
4263
struct hwrm_ring_alloc_output * resp = bp -> hwrm_cmd_resp_addr ;
4264
+ struct bnxt_ring_grp_info * grp_info ;
4262
4265
u16 ring_id ;
4263
4266
4264
4267
bnxt_hwrm_cmd_hdr_init (bp , & req , HWRM_RING_ALLOC , -1 , -1 );
@@ -4280,10 +4283,10 @@ static int hwrm_ring_alloc_send_msg(struct bnxt *bp,
4280
4283
case HWRM_RING_ALLOC_TX :
4281
4284
req .ring_type = RING_ALLOC_REQ_RING_TYPE_TX ;
4282
4285
/* Association of transmit ring with completion ring */
4283
- req . cmpl_ring_id =
4284
- cpu_to_le16 (bp -> grp_info [ map_index ]. cp_fw_ring_id );
4286
+ grp_info = & bp -> grp_info [ ring -> grp_idx ];
4287
+ req . cmpl_ring_id = cpu_to_le16 (grp_info -> cp_fw_ring_id );
4285
4288
req .length = cpu_to_le32 (bp -> tx_ring_mask + 1 );
4286
- req .stat_ctx_id = cpu_to_le32 (stats_ctx_id );
4289
+ req .stat_ctx_id = cpu_to_le32 (grp_info -> fw_stats_ctx );
4287
4290
req .queue_id = cpu_to_le16 (ring -> queue_id );
4288
4291
break ;
4289
4292
case HWRM_RING_ALLOC_RX :
@@ -4370,10 +4373,11 @@ static int bnxt_hwrm_ring_alloc(struct bnxt *bp)
4370
4373
struct bnxt_napi * bnapi = bp -> bnapi [i ];
4371
4374
struct bnxt_cp_ring_info * cpr = & bnapi -> cp_ring ;
4372
4375
struct bnxt_ring_struct * ring = & cpr -> cp_ring_struct ;
4376
+ u32 map_idx = ring -> map_idx ;
4373
4377
4374
- cpr -> cp_doorbell = bp -> bar1 + i * 0x80 ;
4375
- rc = hwrm_ring_alloc_send_msg (bp , ring , HWRM_RING_ALLOC_CMPL , i ,
4376
- INVALID_STATS_CTX_ID );
4378
+ cpr -> cp_doorbell = bp -> bar1 + map_idx * 0x80 ;
4379
+ rc = hwrm_ring_alloc_send_msg (bp , ring , HWRM_RING_ALLOC_CMPL ,
4380
+ map_idx );
4377
4381
if (rc )
4378
4382
goto err_out ;
4379
4383
BNXT_CP_DB (cpr -> cp_doorbell , cpr -> cp_raw_cons );
@@ -4389,11 +4393,10 @@ static int bnxt_hwrm_ring_alloc(struct bnxt *bp)
4389
4393
for (i = 0 ; i < bp -> tx_nr_rings ; i ++ ) {
4390
4394
struct bnxt_tx_ring_info * txr = & bp -> tx_ring [i ];
4391
4395
struct bnxt_ring_struct * ring = & txr -> tx_ring_struct ;
4392
- u32 map_idx = txr -> bnapi -> index ;
4393
- u16 fw_stats_ctx = bp -> grp_info [map_idx ].fw_stats_ctx ;
4396
+ u32 map_idx = i ;
4394
4397
4395
4398
rc = hwrm_ring_alloc_send_msg (bp , ring , HWRM_RING_ALLOC_TX ,
4396
- map_idx , fw_stats_ctx );
4399
+ map_idx );
4397
4400
if (rc )
4398
4401
goto err_out ;
4399
4402
txr -> tx_doorbell = bp -> bar1 + map_idx * 0x80 ;
@@ -4405,7 +4408,7 @@ static int bnxt_hwrm_ring_alloc(struct bnxt *bp)
4405
4408
u32 map_idx = rxr -> bnapi -> index ;
4406
4409
4407
4410
rc = hwrm_ring_alloc_send_msg (bp , ring , HWRM_RING_ALLOC_RX ,
4408
- map_idx , INVALID_STATS_CTX_ID );
4411
+ map_idx );
4409
4412
if (rc )
4410
4413
goto err_out ;
4411
4414
rxr -> rx_doorbell = bp -> bar1 + map_idx * 0x80 ;
@@ -4418,13 +4421,12 @@ static int bnxt_hwrm_ring_alloc(struct bnxt *bp)
4418
4421
struct bnxt_rx_ring_info * rxr = & bp -> rx_ring [i ];
4419
4422
struct bnxt_ring_struct * ring =
4420
4423
& rxr -> rx_agg_ring_struct ;
4421
- u32 grp_idx = rxr -> bnapi -> index ;
4424
+ u32 grp_idx = ring -> grp_idx ;
4422
4425
u32 map_idx = grp_idx + bp -> rx_nr_rings ;
4423
4426
4424
4427
rc = hwrm_ring_alloc_send_msg (bp , ring ,
4425
4428
HWRM_RING_ALLOC_AGG ,
4426
- map_idx ,
4427
- INVALID_STATS_CTX_ID );
4429
+ map_idx );
4428
4430
if (rc )
4429
4431
goto err_out ;
4430
4432
0 commit comments