@@ -2444,8 +2444,10 @@ static void bnxt_free_cp_rings(struct bnxt *bp)
2444
2444
2445
2445
static int bnxt_alloc_cp_rings (struct bnxt * bp )
2446
2446
{
2447
- int i , rc ;
2447
+ int i , rc , ulp_base_vec , ulp_msix ;
2448
2448
2449
+ ulp_msix = bnxt_get_ulp_msix_num (bp );
2450
+ ulp_base_vec = bnxt_get_ulp_msix_base (bp );
2449
2451
for (i = 0 ; i < bp -> cp_nr_rings ; i ++ ) {
2450
2452
struct bnxt_napi * bnapi = bp -> bnapi [i ];
2451
2453
struct bnxt_cp_ring_info * cpr ;
@@ -2460,7 +2462,11 @@ static int bnxt_alloc_cp_rings(struct bnxt *bp)
2460
2462
rc = bnxt_alloc_ring (bp , ring );
2461
2463
if (rc )
2462
2464
return rc ;
2463
- ring -> map_idx = i ;
2465
+
2466
+ if (ulp_msix && i >= ulp_base_vec )
2467
+ ring -> map_idx = i + ulp_msix ;
2468
+ else
2469
+ ring -> map_idx = i ;
2464
2470
}
2465
2471
return 0 ;
2466
2472
}
@@ -3384,15 +3390,27 @@ static void bnxt_disable_int(struct bnxt *bp)
3384
3390
}
3385
3391
}
3386
3392
3393
+ static int bnxt_cp_num_to_irq_num (struct bnxt * bp , int n )
3394
+ {
3395
+ struct bnxt_napi * bnapi = bp -> bnapi [n ];
3396
+ struct bnxt_cp_ring_info * cpr ;
3397
+
3398
+ cpr = & bnapi -> cp_ring ;
3399
+ return cpr -> cp_ring_struct .map_idx ;
3400
+ }
3401
+
3387
3402
static void bnxt_disable_int_sync (struct bnxt * bp )
3388
3403
{
3389
3404
int i ;
3390
3405
3391
3406
atomic_inc (& bp -> intr_sem );
3392
3407
3393
3408
bnxt_disable_int (bp );
3394
- for (i = 0 ; i < bp -> cp_nr_rings ; i ++ )
3395
- synchronize_irq (bp -> irq_tbl [i ].vector );
3409
+ for (i = 0 ; i < bp -> cp_nr_rings ; i ++ ) {
3410
+ int map_idx = bnxt_cp_num_to_irq_num (bp , i );
3411
+
3412
+ synchronize_irq (bp -> irq_tbl [map_idx ].vector );
3413
+ }
3396
3414
}
3397
3415
3398
3416
static void bnxt_enable_int (struct bnxt * bp )
@@ -5824,6 +5842,7 @@ static void bnxt_setup_msix(struct bnxt *bp)
5824
5842
}
5825
5843
5826
5844
for (i = 0 ; i < bp -> cp_nr_rings ; i ++ ) {
5845
+ int map_idx = bnxt_cp_num_to_irq_num (bp , i );
5827
5846
char * attr ;
5828
5847
5829
5848
if (bp -> flags & BNXT_FLAG_SHARED_RINGS )
@@ -5833,9 +5852,9 @@ static void bnxt_setup_msix(struct bnxt *bp)
5833
5852
else
5834
5853
attr = "tx" ;
5835
5854
5836
- snprintf (bp -> irq_tbl [i ].name , len , "%s-%s-%d" , dev -> name , attr ,
5837
- i );
5838
- bp -> irq_tbl [i ].handler = bnxt_msix ;
5855
+ snprintf (bp -> irq_tbl [map_idx ].name , len , "%s-%s-%d" , dev -> name ,
5856
+ attr , i );
5857
+ bp -> irq_tbl [map_idx ].handler = bnxt_msix ;
5839
5858
}
5840
5859
}
5841
5860
@@ -6059,7 +6078,9 @@ static void bnxt_free_irq(struct bnxt *bp)
6059
6078
return ;
6060
6079
6061
6080
for (i = 0 ; i < bp -> cp_nr_rings ; i ++ ) {
6062
- irq = & bp -> irq_tbl [i ];
6081
+ int map_idx = bnxt_cp_num_to_irq_num (bp , i );
6082
+
6083
+ irq = & bp -> irq_tbl [map_idx ];
6063
6084
if (irq -> requested ) {
6064
6085
if (irq -> have_cpumask ) {
6065
6086
irq_set_affinity_hint (irq -> vector , NULL );
@@ -6078,14 +6099,25 @@ static int bnxt_request_irq(struct bnxt *bp)
6078
6099
int i , j , rc = 0 ;
6079
6100
unsigned long flags = 0 ;
6080
6101
#ifdef CONFIG_RFS_ACCEL
6081
- struct cpu_rmap * rmap = bp -> dev -> rx_cpu_rmap ;
6102
+ struct cpu_rmap * rmap ;
6082
6103
#endif
6083
6104
6105
+ rc = bnxt_setup_int_mode (bp );
6106
+ if (rc ) {
6107
+ netdev_err (bp -> dev , "bnxt_setup_int_mode err: %x\n" ,
6108
+ rc );
6109
+ return rc ;
6110
+ }
6111
+ #ifdef CONFIG_RFS_ACCEL
6112
+ rmap = bp -> dev -> rx_cpu_rmap ;
6113
+ #endif
6084
6114
if (!(bp -> flags & BNXT_FLAG_USING_MSIX ))
6085
6115
flags = IRQF_SHARED ;
6086
6116
6087
6117
for (i = 0 , j = 0 ; i < bp -> cp_nr_rings ; i ++ ) {
6088
- struct bnxt_irq * irq = & bp -> irq_tbl [i ];
6118
+ int map_idx = bnxt_cp_num_to_irq_num (bp , i );
6119
+ struct bnxt_irq * irq = & bp -> irq_tbl [map_idx ];
6120
+
6089
6121
#ifdef CONFIG_RFS_ACCEL
6090
6122
if (rmap && bp -> bnapi [i ]-> rx_ring ) {
6091
6123
rc = irq_cpu_rmap_add (rmap , irq -> vector );
@@ -6805,13 +6837,6 @@ static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
6805
6837
rc = bnxt_reserve_rings (bp );
6806
6838
if (rc )
6807
6839
return rc ;
6808
-
6809
- rc = bnxt_setup_int_mode (bp );
6810
- if (rc ) {
6811
- netdev_err (bp -> dev , "bnxt_setup_int_mode err: %x\n" ,
6812
- rc );
6813
- return rc ;
6814
- }
6815
6840
}
6816
6841
if ((bp -> flags & BNXT_FLAG_RFS ) &&
6817
6842
!(bp -> flags & BNXT_FLAG_USING_MSIX )) {
0 commit comments