diff options
author | Sivakumar Subramani <Sivakumar.Subramani@neterion.com> | 2007-02-24 01:51:50 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-02-27 04:27:11 -0500 |
commit | fb6a825b09a2311624e9cac20e643d9d7ef602dc (patch) | |
tree | cd3d582bf9a2e7a2941e0d11ec0262780aa15777 | |
parent | ed227dcc2d998c8e0616449db06f7ef892cb17fc (diff) |
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: Sivakumar Subramani <sivakumar.subramani@neterion.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r-- | drivers/net/s2io.c | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index fd85648d98d1..7cc07c8e7076 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -6112,7 +6112,7 @@ static int s2io_add_isr(struct s2io_nic * sp) | |||
6112 | } | 6112 | } |
6113 | } | 6113 | } |
6114 | if (sp->intr_type == MSI_X) { | 6114 | if (sp->intr_type == MSI_X) { |
6115 | int i; | 6115 | int i, msix_tx_cnt=0,msix_rx_cnt=0; |
6116 | 6116 | ||
6117 | for (i=1; (sp->s2io_entries[i].in_use == MSIX_FLG); i++) { | 6117 | for (i=1; (sp->s2io_entries[i].in_use == MSIX_FLG); i++) { |
6118 | if (sp->s2io_entries[i].type == MSIX_FIFO_TYPE) { | 6118 | if (sp->s2io_entries[i].type == MSIX_FIFO_TYPE) { |
@@ -6121,16 +6121,36 @@ static int s2io_add_isr(struct s2io_nic * sp) | |||
6121 | err = request_irq(sp->entries[i].vector, | 6121 | err = request_irq(sp->entries[i].vector, |
6122 | s2io_msix_fifo_handle, 0, sp->desc[i], | 6122 | s2io_msix_fifo_handle, 0, sp->desc[i], |
6123 | sp->s2io_entries[i].arg); | 6123 | sp->s2io_entries[i].arg); |
6124 | DBG_PRINT(ERR_DBG, "%s @ 0x%llx\n", sp->desc[i], | 6124 | /* If either data or addr is zero print it */ |
6125 | (unsigned long long)sp->msix_info[i].addr); | 6125 | if(!(sp->msix_info[i].addr && |
6126 | sp->msix_info[i].data)) { | ||
6127 | DBG_PRINT(ERR_DBG, "%s @ Addr:0x%llx" | ||
6128 | "Data:0x%lx\n",sp->desc[i], | ||
6129 | (unsigned long long) | ||
6130 | sp->msix_info[i].addr, | ||
6131 | (unsigned long) | ||
6132 | ntohl(sp->msix_info[i].data)); | ||
6133 | } else { | ||
6134 | msix_tx_cnt++; | ||
6135 | } | ||
6126 | } else { | 6136 | } else { |
6127 | sprintf(sp->desc[i], "%s:MSI-X-%d-RX", | 6137 | sprintf(sp->desc[i], "%s:MSI-X-%d-RX", |
6128 | dev->name, i); | 6138 | dev->name, i); |
6129 | err = request_irq(sp->entries[i].vector, | 6139 | err = request_irq(sp->entries[i].vector, |
6130 | s2io_msix_ring_handle, 0, sp->desc[i], | 6140 | s2io_msix_ring_handle, 0, sp->desc[i], |
6131 | sp->s2io_entries[i].arg); | 6141 | sp->s2io_entries[i].arg); |
6132 | DBG_PRINT(ERR_DBG, "%s @ 0x%llx\n", sp->desc[i], | 6142 | /* If either data or addr is zero print it */ |
6133 | (unsigned long long)sp->msix_info[i].addr); | 6143 | if(!(sp->msix_info[i].addr && |
6144 | sp->msix_info[i].data)) { | ||
6145 | DBG_PRINT(ERR_DBG, "%s @ Addr:0x%llx" | ||
6146 | "Data:0x%lx\n",sp->desc[i], | ||
6147 | (unsigned long long) | ||
6148 | sp->msix_info[i].addr, | ||
6149 | (unsigned long) | ||
6150 | ntohl(sp->msix_info[i].data)); | ||
6151 | } else { | ||
6152 | msix_rx_cnt++; | ||
6153 | } | ||
6134 | } | 6154 | } |
6135 | if (err) { | 6155 | if (err) { |
6136 | DBG_PRINT(ERR_DBG,"%s:MSI-X-%d registration " | 6156 | DBG_PRINT(ERR_DBG,"%s:MSI-X-%d registration " |
@@ -6140,6 +6160,8 @@ static int s2io_add_isr(struct s2io_nic * sp) | |||
6140 | } | 6160 | } |
6141 | sp->s2io_entries[i].in_use = MSIX_REGISTERED_SUCCESS; | 6161 | sp->s2io_entries[i].in_use = MSIX_REGISTERED_SUCCESS; |
6142 | } | 6162 | } |
6163 | printk("MSI-X-TX %d entries enabled\n",msix_tx_cnt); | ||
6164 | printk("MSI-X-RX %d entries enabled\n",msix_rx_cnt); | ||
6143 | } | 6165 | } |
6144 | if (sp->intr_type == INTA) { | 6166 | if (sp->intr_type == INTA) { |
6145 | err = request_irq((int) sp->pdev->irq, s2io_isr, IRQF_SHARED, | 6167 | 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) | |||
6704 | "Defaulting to INTA\n"); | 6726 | "Defaulting to INTA\n"); |
6705 | *dev_intr_type = INTA; | 6727 | *dev_intr_type = INTA; |
6706 | } | 6728 | } |
6707 | if ( (rx_ring_num > 1) && (*dev_intr_type != INTA) ) | 6729 | |
6708 | napi = 0; | ||
6709 | if (rx_ring_mode > 3) { | 6730 | if (rx_ring_mode > 3) { |
6710 | DBG_PRINT(ERR_DBG, "s2io: Requested ring mode not supported\n"); | 6731 | DBG_PRINT(ERR_DBG, "s2io: Requested ring mode not supported\n"); |
6711 | DBG_PRINT(ERR_DBG, "s2io: Defaulting to 3-buffer mode\n"); | 6732 | DBG_PRINT(ERR_DBG, "s2io: Defaulting to 3-buffer mode\n"); |