aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/myri10ge/myri10ge.c
diff options
context:
space:
mode:
authorBrice Goglin <brice@myri.com>2008-05-08 20:20:47 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-05-13 01:30:31 -0400
commit014377a1df693ff30a9e8b69f0bbb0a38e601f75 (patch)
tree6390e803ed6200bba31b892819c1022eb828304b /drivers/net/myri10ge/myri10ge.c
parentfa0a90d96b08856203435b051dd1c155b58ccd0f (diff)
myri10ge: fix the number of interrupt slots
Fix a long-standing bug/misunderstanding between the driver and the firmware. The size of the interrupt queue must be set to the number of rx slots (big + small), and it should never have been a tunable. Setting it too small results in chaos. Signed-off-by: Brice Goglin <brice@myri.com> Signed-off-by: Andrew Gallatin <gallatin@myri.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/myri10ge/myri10ge.c')
-rw-r--r--drivers/net/myri10ge/myri10ge.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index 054168faf292..c91b12ea26ad 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -253,10 +253,6 @@ static int myri10ge_ecrc_enable = 1;
253module_param(myri10ge_ecrc_enable, int, S_IRUGO); 253module_param(myri10ge_ecrc_enable, int, S_IRUGO);
254MODULE_PARM_DESC(myri10ge_ecrc_enable, "Enable Extended CRC on PCI-E"); 254MODULE_PARM_DESC(myri10ge_ecrc_enable, "Enable Extended CRC on PCI-E");
255 255
256static int myri10ge_max_intr_slots = 1024;
257module_param(myri10ge_max_intr_slots, int, S_IRUGO);
258MODULE_PARM_DESC(myri10ge_max_intr_slots, "Interrupt queue slots");
259
260static int myri10ge_small_bytes = -1; /* -1 == auto */ 256static int myri10ge_small_bytes = -1; /* -1 == auto */
261module_param(myri10ge_small_bytes, int, S_IRUGO | S_IWUSR); 257module_param(myri10ge_small_bytes, int, S_IRUGO | S_IWUSR);
262MODULE_PARM_DESC(myri10ge_small_bytes, "Threshold of small packets"); 258MODULE_PARM_DESC(myri10ge_small_bytes, "Threshold of small packets");
@@ -879,7 +875,7 @@ static int myri10ge_reset(struct myri10ge_priv *mgp)
879 875
880 /* Now exchange information about interrupts */ 876 /* Now exchange information about interrupts */
881 877
882 bytes = myri10ge_max_intr_slots * sizeof(*mgp->ss.rx_done.entry); 878 bytes = mgp->max_intr_slots * sizeof(*mgp->ss.rx_done.entry);
883 memset(mgp->ss.rx_done.entry, 0, bytes); 879 memset(mgp->ss.rx_done.entry, 0, bytes);
884 cmd.data0 = (u32) bytes; 880 cmd.data0 = (u32) bytes;
885 status = myri10ge_send_cmd(mgp, MXGEFW_CMD_SET_INTRQ_SIZE, &cmd, 0); 881 status = myri10ge_send_cmd(mgp, MXGEFW_CMD_SET_INTRQ_SIZE, &cmd, 0);
@@ -1217,7 +1213,7 @@ myri10ge_clean_rx_done(struct myri10ge_slice_state *ss, int budget)
1217 rx_packets += rx_ok; 1213 rx_packets += rx_ok;
1218 rx_bytes += rx_ok * (unsigned long)length; 1214 rx_bytes += rx_ok * (unsigned long)length;
1219 cnt++; 1215 cnt++;
1220 idx = cnt & (myri10ge_max_intr_slots - 1); 1216 idx = cnt & (mgp->max_intr_slots - 1);
1221 work_done++; 1217 work_done++;
1222 } 1218 }
1223 rx_done->idx = idx; 1219 rx_done->idx = idx;
@@ -3218,7 +3214,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3218 netdev->dev_addr[i] = mgp->mac_addr[i]; 3214 netdev->dev_addr[i] = mgp->mac_addr[i];
3219 3215
3220 /* allocate rx done ring */ 3216 /* allocate rx done ring */
3221 bytes = myri10ge_max_intr_slots * sizeof(*mgp->ss.rx_done.entry); 3217 bytes = mgp->max_intr_slots * sizeof(*mgp->ss.rx_done.entry);
3222 mgp->ss.rx_done.entry = dma_alloc_coherent(&pdev->dev, bytes, 3218 mgp->ss.rx_done.entry = dma_alloc_coherent(&pdev->dev, bytes,
3223 &mgp->ss.rx_done.bus, GFP_KERNEL); 3219 &mgp->ss.rx_done.bus, GFP_KERNEL);
3224 if (mgp->ss.rx_done.entry == NULL) 3220 if (mgp->ss.rx_done.entry == NULL)
@@ -3295,7 +3291,7 @@ abort_with_firmware:
3295 myri10ge_dummy_rdma(mgp, 0); 3291 myri10ge_dummy_rdma(mgp, 0);
3296 3292
3297abort_with_rx_done: 3293abort_with_rx_done:
3298 bytes = myri10ge_max_intr_slots * sizeof(*mgp->ss.rx_done.entry); 3294 bytes = mgp->max_intr_slots * sizeof(*mgp->ss.rx_done.entry);
3299 dma_free_coherent(&pdev->dev, bytes, 3295 dma_free_coherent(&pdev->dev, bytes,
3300 mgp->ss.rx_done.entry, mgp->ss.rx_done.bus); 3296 mgp->ss.rx_done.entry, mgp->ss.rx_done.bus);
3301 3297
@@ -3346,7 +3342,7 @@ static void myri10ge_remove(struct pci_dev *pdev)
3346 /* avoid a memory leak */ 3342 /* avoid a memory leak */
3347 pci_restore_state(pdev); 3343 pci_restore_state(pdev);
3348 3344
3349 bytes = myri10ge_max_intr_slots * sizeof(*mgp->ss.rx_done.entry); 3345 bytes = mgp->max_intr_slots * sizeof(*mgp->ss.rx_done.entry);
3350 dma_free_coherent(&pdev->dev, bytes, 3346 dma_free_coherent(&pdev->dev, bytes,
3351 mgp->ss.rx_done.entry, mgp->ss.rx_done.bus); 3347 mgp->ss.rx_done.entry, mgp->ss.rx_done.bus);
3352 3348