Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fb6a825b authored by Sivakumar Subramani's avatar Sivakumar Subramani Committed by Jeff Garzik
Browse files

S2IO: Fixes for MSI and MSIX



- Added debug statements to print a debug message if the MSI/MSI-X vector (or)
  data is zero.

- This patch removes the code that will enable NAPI for the case of single
  ring and MSI-X / MSI case. There are some issue in the enabling NAPI with
  MSI/MSI-X.  So we are turning off NAPI in the case of MSI/MSI-X.

Signed-off-by: default avatarSivakumar Subramani <sivakumar.subramani@neterion.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent ed227dcc
Loading
Loading
Loading
Loading
+28 −7
Original line number Original line Diff line number Diff line
@@ -6112,7 +6112,7 @@ static int s2io_add_isr(struct s2io_nic * sp)
		}
		}
	}
	}
	if (sp->intr_type == MSI_X) {
	if (sp->intr_type == MSI_X) {
		int i;
		int i, msix_tx_cnt=0,msix_rx_cnt=0;


		for (i=1; (sp->s2io_entries[i].in_use == MSIX_FLG); i++) {
		for (i=1; (sp->s2io_entries[i].in_use == MSIX_FLG); i++) {
			if (sp->s2io_entries[i].type == MSIX_FIFO_TYPE) {
			if (sp->s2io_entries[i].type == MSIX_FIFO_TYPE) {
@@ -6121,16 +6121,36 @@ static int s2io_add_isr(struct s2io_nic * sp)
				err = request_irq(sp->entries[i].vector,
				err = request_irq(sp->entries[i].vector,
					  s2io_msix_fifo_handle, 0, sp->desc[i],
					  s2io_msix_fifo_handle, 0, sp->desc[i],
						  sp->s2io_entries[i].arg);
						  sp->s2io_entries[i].arg);
				DBG_PRINT(ERR_DBG, "%s @ 0x%llx\n", sp->desc[i],
				/* If either data or addr is zero print it */
				(unsigned long long)sp->msix_info[i].addr);
				if(!(sp->msix_info[i].addr &&
					sp->msix_info[i].data)) {
					DBG_PRINT(ERR_DBG, "%s @ Addr:0x%llx"
						"Data:0x%lx\n",sp->desc[i],
						(unsigned long long)
						sp->msix_info[i].addr,
						(unsigned long)
						ntohl(sp->msix_info[i].data));
				} else {
					msix_tx_cnt++;
				}
			} else {
			} else {
				sprintf(sp->desc[i], "%s:MSI-X-%d-RX",
				sprintf(sp->desc[i], "%s:MSI-X-%d-RX",
					dev->name, i);
					dev->name, i);
				err = request_irq(sp->entries[i].vector,
				err = request_irq(sp->entries[i].vector,
					  s2io_msix_ring_handle, 0, sp->desc[i],
					  s2io_msix_ring_handle, 0, sp->desc[i],
						  sp->s2io_entries[i].arg);
						  sp->s2io_entries[i].arg);
				DBG_PRINT(ERR_DBG, "%s @ 0x%llx\n", sp->desc[i],
				/* If either data or addr is zero print it */
				(unsigned long long)sp->msix_info[i].addr);
				if(!(sp->msix_info[i].addr &&
					sp->msix_info[i].data)) {
					DBG_PRINT(ERR_DBG, "%s @ Addr:0x%llx"
						"Data:0x%lx\n",sp->desc[i],
						(unsigned long long)
						sp->msix_info[i].addr,
						(unsigned long)
						ntohl(sp->msix_info[i].data));
				} else {
					msix_rx_cnt++;
				}
			}
			}
			if (err) {
			if (err) {
				DBG_PRINT(ERR_DBG,"%s:MSI-X-%d registration "
				DBG_PRINT(ERR_DBG,"%s:MSI-X-%d registration "
@@ -6140,6 +6160,8 @@ static int s2io_add_isr(struct s2io_nic * sp)
			}
			}
			sp->s2io_entries[i].in_use = MSIX_REGISTERED_SUCCESS;
			sp->s2io_entries[i].in_use = MSIX_REGISTERED_SUCCESS;
		}
		}
		printk("MSI-X-TX %d entries enabled\n",msix_tx_cnt);
		printk("MSI-X-RX %d entries enabled\n",msix_rx_cnt);
	}
	}
	if (sp->intr_type == INTA) {
	if (sp->intr_type == INTA) {
		err = request_irq((int) sp->pdev->irq, s2io_isr, IRQF_SHARED,
		err = request_irq((int) sp->pdev->irq, s2io_isr, IRQF_SHARED,
@@ -6704,8 +6726,7 @@ static int s2io_verify_parm(struct pci_dev *pdev, u8 *dev_intr_type)
					"Defaulting to INTA\n");
					"Defaulting to INTA\n");
		*dev_intr_type = INTA;
		*dev_intr_type = INTA;
	}
	}
	if ( (rx_ring_num > 1) && (*dev_intr_type != INTA) )

		napi = 0;
	if (rx_ring_mode > 3) {
	if (rx_ring_mode > 3) {
		DBG_PRINT(ERR_DBG, "s2io: Requested ring mode not supported\n");
		DBG_PRINT(ERR_DBG, "s2io: Requested ring mode not supported\n");
		DBG_PRINT(ERR_DBG, "s2io: Defaulting to 3-buffer mode\n");
		DBG_PRINT(ERR_DBG, "s2io: Defaulting to 3-buffer mode\n");