Commit eb85f1d7 authored by Tyrel Datwyler's avatar Tyrel Datwyler Committed by Martin K. Petersen

scsi: ibmvfc: Add protocol field to ibmvfc_channels

There are cases in the generic code where protocol specific configuration
or actions may need to be taken. Add a protocol field to struct
ibmvfc_channels and initial IBMVFC_PROTO_[SCSI/NVME] definitions.
Signed-off-by: default avatarTyrel Datwyler <tyreld@linux.ibm.com>
Link: https://lore.kernel.org/r/20230921225435.3537728-10-tyreld@linux.ibm.comReviewed-by: default avatarBrian King <brking@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent f28f16d3
...@@ -3935,7 +3935,7 @@ static void ibmvfc_drain_sub_crq(struct ibmvfc_queue *scrq) ...@@ -3935,7 +3935,7 @@ static void ibmvfc_drain_sub_crq(struct ibmvfc_queue *scrq)
} }
} }
static irqreturn_t ibmvfc_interrupt_scsi(int irq, void *scrq_instance) static irqreturn_t ibmvfc_interrupt_mq(int irq, void *scrq_instance)
{ {
struct ibmvfc_queue *scrq = (struct ibmvfc_queue *)scrq_instance; struct ibmvfc_queue *scrq = (struct ibmvfc_queue *)scrq_instance;
...@@ -5936,9 +5936,24 @@ static int ibmvfc_register_channel(struct ibmvfc_host *vhost, ...@@ -5936,9 +5936,24 @@ static int ibmvfc_register_channel(struct ibmvfc_host *vhost,
goto irq_failed; goto irq_failed;
} }
snprintf(scrq->name, sizeof(scrq->name), "ibmvfc-%x-scsi%d", switch (channels->protocol) {
vdev->unit_address, index); case IBMVFC_PROTO_SCSI:
rc = request_irq(scrq->irq, ibmvfc_interrupt_scsi, 0, scrq->name, scrq); snprintf(scrq->name, sizeof(scrq->name), "ibmvfc-%x-scsi%d",
vdev->unit_address, index);
scrq->handler = ibmvfc_interrupt_mq;
break;
case IBMVFC_PROTO_NVME:
snprintf(scrq->name, sizeof(scrq->name), "ibmvfc-%x-nvmf%d",
vdev->unit_address, index);
scrq->handler = ibmvfc_interrupt_mq;
break;
default:
dev_err(dev, "Unknown channel protocol (%d)\n",
channels->protocol);
goto irq_failed;
}
rc = request_irq(scrq->irq, scrq->handler, 0, scrq->name, scrq);
if (rc) { if (rc) {
dev_err(dev, "Couldn't register sub-crq[%d] irq\n", index); dev_err(dev, "Couldn't register sub-crq[%d] irq\n", index);
...@@ -6317,6 +6332,7 @@ static int ibmvfc_probe(struct vio_dev *vdev, const struct vio_device_id *id) ...@@ -6317,6 +6332,7 @@ static int ibmvfc_probe(struct vio_dev *vdev, const struct vio_device_id *id)
vhost->mq_enabled = mq_enabled; vhost->mq_enabled = mq_enabled;
vhost->scsi_scrqs.desired_queues = min(shost->nr_hw_queues, nr_scsi_channels); vhost->scsi_scrqs.desired_queues = min(shost->nr_hw_queues, nr_scsi_channels);
vhost->scsi_scrqs.max_queues = shost->nr_hw_queues; vhost->scsi_scrqs.max_queues = shost->nr_hw_queues;
vhost->scsi_scrqs.protocol = IBMVFC_PROTO_SCSI;
vhost->using_channels = 0; vhost->using_channels = 0;
vhost->do_enquiry = 1; vhost->do_enquiry = 1;
vhost->scan_timeout = 0; vhost->scan_timeout = 0;
......
...@@ -813,10 +813,17 @@ struct ibmvfc_queue { ...@@ -813,10 +813,17 @@ struct ibmvfc_queue {
unsigned long irq; unsigned long irq;
unsigned long hwq_id; unsigned long hwq_id;
char name[32]; char name[32];
irq_handler_t handler;
};
enum ibmvfc_protocol {
IBMVFC_PROTO_SCSI = 0,
IBMVFC_PROTO_NVME = 1,
}; };
struct ibmvfc_channels { struct ibmvfc_channels {
struct ibmvfc_queue *scrqs; struct ibmvfc_queue *scrqs;
enum ibmvfc_protocol protocol;
unsigned int active_queues; unsigned int active_queues;
unsigned int desired_queues; unsigned int desired_queues;
unsigned int max_queues; unsigned int max_queues;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment