@@ -19,10 +19,6 @@ static void qla2x00_status_entry(scsi_qla_host_t *, struct rsp_que *, void *);
19
19
static void qla2x00_status_cont_entry (struct rsp_que * , sts_cont_entry_t * );
20
20
static void qla2x00_error_entry (scsi_qla_host_t * , struct rsp_que * ,
21
21
sts_entry_t * );
22
- static void qla_irq_affinity_notify (struct irq_affinity_notify * ,
23
- const cpumask_t * );
24
- static void qla_irq_affinity_release (struct kref * );
25
-
26
22
27
23
/**
28
24
* qla2100_intr_handler() - Process interrupts for the ISP2100 and ISP2200.
@@ -2572,14 +2568,6 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
2572
2568
if (!vha -> flags .online )
2573
2569
return ;
2574
2570
2575
- if (rsp -> msix && rsp -> msix -> cpuid != smp_processor_id ()) {
2576
- /* if kernel does not notify qla of IRQ's CPU change,
2577
- * then set it here.
2578
- */
2579
- rsp -> msix -> cpuid = smp_processor_id ();
2580
- ha -> tgt .rspq_vector_cpuid = rsp -> msix -> cpuid ;
2581
- }
2582
-
2583
2571
while (rsp -> ring_ptr -> signature != RESPONSE_PROCESSED ) {
2584
2572
pkt = (struct sts_entry_24xx * )rsp -> ring_ptr ;
2585
2573
@@ -3018,13 +3006,20 @@ static struct qla_init_msix_entry qla82xx_msix_entries[] = {
3018
3006
static int
3019
3007
qla24xx_enable_msix (struct qla_hw_data * ha , struct rsp_que * rsp )
3020
3008
{
3021
- #define MIN_MSIX_COUNT 2
3022
3009
int i , ret ;
3023
3010
struct qla_msix_entry * qentry ;
3024
3011
scsi_qla_host_t * vha = pci_get_drvdata (ha -> pdev );
3012
+ struct irq_affinity desc = {
3013
+ .pre_vectors = QLA_BASE_VECTORS ,
3014
+ };
3015
+
3016
+ if (QLA_TGT_MODE_ENABLED () && IS_ATIO_MSIX_CAPABLE (ha ))
3017
+ desc .pre_vectors ++ ;
3018
+
3019
+ ret = pci_alloc_irq_vectors_affinity (ha -> pdev , QLA_BASE_VECTORS ,
3020
+ ha -> msix_count , PCI_IRQ_MSIX | PCI_IRQ_AFFINITY ,
3021
+ & desc );
3025
3022
3026
- ret = pci_alloc_irq_vectors (ha -> pdev , MIN_MSIX_COUNT , ha -> msix_count ,
3027
- PCI_IRQ_MSIX | PCI_IRQ_AFFINITY );
3028
3023
if (ret < 0 ) {
3029
3024
ql_log (ql_log_fatal , vha , 0x00c7 ,
3030
3025
"MSI-X: Failed to enable support, "
@@ -3069,13 +3064,10 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
3069
3064
qentry -> have_irq = 0 ;
3070
3065
qentry -> in_use = 0 ;
3071
3066
qentry -> handle = NULL ;
3072
- qentry -> irq_notify .notify = qla_irq_affinity_notify ;
3073
- qentry -> irq_notify .release = qla_irq_affinity_release ;
3074
- qentry -> cpuid = -1 ;
3075
3067
}
3076
3068
3077
3069
/* Enable MSI-X vectors for the base queue */
3078
- for (i = 0 ; i < ( QLA_MSIX_RSP_Q + 1 ) ; i ++ ) {
3070
+ for (i = 0 ; i < QLA_BASE_VECTORS ; i ++ ) {
3079
3071
qentry = & ha -> msix_entries [i ];
3080
3072
qentry -> handle = rsp ;
3081
3073
rsp -> msix = qentry ;
@@ -3093,18 +3085,6 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
3093
3085
goto msix_register_fail ;
3094
3086
qentry -> have_irq = 1 ;
3095
3087
qentry -> in_use = 1 ;
3096
-
3097
- /* Register for CPU affinity notification. */
3098
- irq_set_affinity_notifier (qentry -> vector , & qentry -> irq_notify );
3099
-
3100
- /* Schedule work (ie. trigger a notification) to read cpu
3101
- * mask for this specific irq.
3102
- * kref_get is required because
3103
- * irq_affinity_notify() will do
3104
- * kref_put().
3105
- */
3106
- kref_get (& qentry -> irq_notify .kref );
3107
- schedule_work (& qentry -> irq_notify .work );
3108
3088
}
3109
3089
3110
3090
/*
@@ -3301,49 +3281,3 @@ int qla25xx_request_irq(struct qla_hw_data *ha, struct qla_qpair *qpair,
3301
3281
msix -> handle = qpair ;
3302
3282
return ret ;
3303
3283
}
3304
-
3305
-
3306
- /* irq_set_affinity/irqbalance will trigger notification of cpu mask update */
3307
- static void qla_irq_affinity_notify (struct irq_affinity_notify * notify ,
3308
- const cpumask_t * mask )
3309
- {
3310
- struct qla_msix_entry * e =
3311
- container_of (notify , struct qla_msix_entry , irq_notify );
3312
- struct qla_hw_data * ha ;
3313
- struct scsi_qla_host * base_vha ;
3314
- struct rsp_que * rsp = e -> handle ;
3315
-
3316
- /* user is recommended to set mask to just 1 cpu */
3317
- e -> cpuid = cpumask_first (mask );
3318
-
3319
- ha = rsp -> hw ;
3320
- base_vha = pci_get_drvdata (ha -> pdev );
3321
-
3322
- ql_dbg (ql_dbg_init , base_vha , 0xffff ,
3323
- "%s: host %ld : vector %d cpu %d \n" , __func__ ,
3324
- base_vha -> host_no , e -> vector , e -> cpuid );
3325
-
3326
- if (e -> have_irq ) {
3327
- if ((IS_QLA83XX (ha ) || IS_QLA27XX (ha )) &&
3328
- (e -> entry == QLA83XX_RSPQ_MSIX_ENTRY_NUMBER )) {
3329
- ha -> tgt .rspq_vector_cpuid = e -> cpuid ;
3330
- ql_dbg (ql_dbg_init , base_vha , 0xffff ,
3331
- "%s: host%ld: rspq vector %d cpu %d runtime change\n" ,
3332
- __func__ , base_vha -> host_no , e -> vector , e -> cpuid );
3333
- }
3334
- }
3335
- }
3336
-
3337
- static void qla_irq_affinity_release (struct kref * ref )
3338
- {
3339
- struct irq_affinity_notify * notify =
3340
- container_of (ref , struct irq_affinity_notify , kref );
3341
- struct qla_msix_entry * e =
3342
- container_of (notify , struct qla_msix_entry , irq_notify );
3343
- struct rsp_que * rsp = e -> handle ;
3344
- struct scsi_qla_host * base_vha = pci_get_drvdata (rsp -> hw -> pdev );
3345
-
3346
- ql_dbg (ql_dbg_init , base_vha , 0xffff ,
3347
- "%s: host%ld: vector %d cpu %d\n" , __func__ ,
3348
- base_vha -> host_no , e -> vector , e -> cpuid );
3349
- }
0 commit comments