Skip to contentSkip to conversation

megaraid_sas: unique names for MSIx vectors

PATCH Applied Chandrakanth Patil 2 participants 2 messages Oct 7, 2019 – Oct 10, 2019

Subsystems (2)
lore
Share & tools
lore

Chandrakanth Patil

author maintainer
#0 lore raw

PATCH v2 1/1 megaraid_sas: unique names for MSIx vectors

Currently, MSIx vectors name appears in /proc/interrupts is "megasas" which is same for all the vectors. This patch provides the unique name to all megaraid_sas controllers and its associated MSIx interrupts.

v2:

- MEGASAS_MSIX_NAME_LEN macro changed from 16 to 32.
- Format spectifier for scsi host_no changed from %d to %u.

---
 drivers/scsi/megaraid/megaraid_sas.h      | 3 +++
 drivers/scsi/megaraid/megaraid_sas_base.c | 8 ++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/scsi/megaraid/megaraid_sas.h +3 -0
index a6e788c..bd81840 100644
@@ -24,6 +24,8 @@
 #define MEGASAS_VERSION				"07.710.50.00-rc1"
 #define MEGASAS_RELDATE				"June 28, 2019"
 
+#define MEGASAS_MSIX_NAME_LEN			32
+
 /*
  * Device IDs
  */
@@ -2203,6 +2205,7 @@ struct megasas_aen_event {
 };
 
 struct megasas_irq_context {
+	char name[MEGASAS_MSIX_NAME_LEN];
 	struct megasas_instance *instance;
 	u32 MSIxIndex;
 	u32 os_irq;
drivers/scsi/megaraid/megaraid_sas_base.c +6 -2
index 42cf38c..713d04e 100644
@@ -5546,9 +5546,11 @@ megasas_setup_irqs_ioapic(struct megasas_instance *instance)
 	pdev = instance->pdev;
 	instance->irq_context[0].instance = instance;
 	instance->irq_context[0].MSIxIndex = 0;
+	snprintf(instance->irq_context->name, MEGASAS_MSIX_NAME_LEN, "%s%u",
+		"megasas", instance->host->host_no);
 	if (request_irq(pci_irq_vector(pdev, 0),
 			instance->instancet->service_isr, IRQF_SHARED,
-			"megasas", &instance->irq_context[0])) {
+			instance->irq_context->name, &instance->irq_context[0])) {
 		dev_err(&instance->pdev->dev,
 				"Failed to register IRQ from %s %d\n",
 				__func__, __LINE__);
@@ -5580,8 +5582,10 @@ megasas_setup_irqs_msix(struct megasas_instance *instance, u8 is_probe)
 	for (i = 0; i < instance->msix_vectors; i++) {
 		instance->irq_context[i].instance = instance;
 		instance->irq_context[i].MSIxIndex = i;
+		snprintf(instance->irq_context[i].name, MEGASAS_MSIX_NAME_LEN, "%s%u-msix%d",
+			"megasas", instance->host->host_no, i);
 		if (request_irq(pci_irq_vector(pdev, i),
-			instance->instancet->service_isr, 0, "megasas",
+			instance->instancet->service_isr, 0, instance->irq_context[i].name,
 			&instance->irq_context[i])) {
 			dev_err(&instance->pdev->dev,
 				"Failed to register IRQ for vector %d.\n", i);
Signature · 1 line
2.9.5
#1 lore raw

Chandrakanth,

Quoted 7 lines

Currently, MSIx vectors name appears in /proc/interrupts is "megasas" which is same for all the vectors. This patch provides the unique name to all megaraid_sas controllers and its associated MSIx interrupts.

Next time, please make sure you put a "---" separator before the patch changelog.

Quoted 1 line

v2:

[...]

Applied to 5.5/scsi-queue, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering