aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSreenivasa Honnur <Sreenivasa.Honnur@neterion.com>2009-07-01 17:16:37 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-05 22:16:34 -0400
commita5d165b571fcf347e82af6292074d2f0c07de3a6 (patch)
tree5bd6bf9a4af55d01e62a216c222f2a864df163ee
parent6052ae1676b705c67133542e663ec3380f032e2c (diff)
vxge: Fixes in isr routine
- Fixes in isr routine Fixed crash with INTA mode during driver unload. Pass hldev to request_irq instead of vdev. Fixed Traffic failure with GRO in INTA mode. Pass the correct napi context to gro functions. Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com> Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/vxge/vxge-main.c22
-rw-r--r--drivers/net/vxge/vxge-main.h1
2 files changed, 13 insertions, 10 deletions
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
index cda18f815c3a..060549a75586 100644
--- a/drivers/net/vxge/vxge-main.c
+++ b/drivers/net/vxge/vxge-main.c
@@ -374,10 +374,10 @@ vxge_rx_complete(struct vxge_ring *ring, struct sk_buff *skb, u16 vlan,
374 if (ring->vlgrp && ext_info->vlan && 374 if (ring->vlgrp && ext_info->vlan &&
375 (ring->vlan_tag_strip == 375 (ring->vlan_tag_strip ==
376 VXGE_HW_VPATH_RPA_STRIP_VLAN_TAG_ENABLE)) 376 VXGE_HW_VPATH_RPA_STRIP_VLAN_TAG_ENABLE))
377 vlan_gro_receive(&ring->napi, ring->vlgrp, 377 vlan_gro_receive(ring->napi_p, ring->vlgrp,
378 ext_info->vlan, skb); 378 ext_info->vlan, skb);
379 else 379 else
380 napi_gro_receive(&ring->napi, skb); 380 napi_gro_receive(ring->napi_p, skb);
381 } else { 381 } else {
382 if (ring->vlgrp && vlan && 382 if (ring->vlgrp && vlan &&
383 (ring->vlan_tag_strip == 383 (ring->vlan_tag_strip ==
@@ -2132,16 +2132,16 @@ int vxge_open_vpaths(struct vxgedev *vdev)
2132 */ 2132 */
2133static irqreturn_t vxge_isr_napi(int irq, void *dev_id) 2133static irqreturn_t vxge_isr_napi(int irq, void *dev_id)
2134{ 2134{
2135 struct __vxge_hw_device *hldev = (struct __vxge_hw_device *)dev_id;
2136 struct vxgedev *vdev;
2137 struct net_device *dev; 2135 struct net_device *dev;
2136 struct __vxge_hw_device *hldev;
2138 u64 reason; 2137 u64 reason;
2139 enum vxge_hw_status status; 2138 enum vxge_hw_status status;
2139 struct vxgedev *vdev = (struct vxgedev *) dev_id;;
2140 2140
2141 vxge_debug_intr(VXGE_TRACE, "%s:%d", __func__, __LINE__); 2141 vxge_debug_intr(VXGE_TRACE, "%s:%d", __func__, __LINE__);
2142 2142
2143 dev = hldev->ndev; 2143 dev = vdev->ndev;
2144 vdev = netdev_priv(dev); 2144 hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);
2145 2145
2146 if (pci_channel_offline(vdev->pdev)) 2146 if (pci_channel_offline(vdev->pdev))
2147 return IRQ_NONE; 2147 return IRQ_NONE;
@@ -2412,15 +2412,13 @@ static void vxge_rem_isr(struct vxgedev *vdev)
2412#endif 2412#endif
2413 if (vdev->config.intr_type == INTA) { 2413 if (vdev->config.intr_type == INTA) {
2414 synchronize_irq(vdev->pdev->irq); 2414 synchronize_irq(vdev->pdev->irq);
2415 free_irq(vdev->pdev->irq, hldev); 2415 free_irq(vdev->pdev->irq, vdev);
2416 } 2416 }
2417} 2417}
2418 2418
2419static int vxge_add_isr(struct vxgedev *vdev) 2419static int vxge_add_isr(struct vxgedev *vdev)
2420{ 2420{
2421 int ret = 0; 2421 int ret = 0;
2422 struct __vxge_hw_device *hldev =
2423 (struct __vxge_hw_device *) pci_get_drvdata(vdev->pdev);
2424#ifdef CONFIG_PCI_MSI 2422#ifdef CONFIG_PCI_MSI
2425 int vp_idx = 0, intr_idx = 0, intr_cnt = 0, msix_idx = 0, irq_req = 0; 2423 int vp_idx = 0, intr_idx = 0, intr_cnt = 0, msix_idx = 0, irq_req = 0;
2426 u64 function_mode = vdev->config.device_hw_info.function_mode; 2424 u64 function_mode = vdev->config.device_hw_info.function_mode;
@@ -2574,7 +2572,7 @@ INTA_MODE:
2574 if (vdev->config.intr_type == INTA) { 2572 if (vdev->config.intr_type == INTA) {
2575 ret = request_irq((int) vdev->pdev->irq, 2573 ret = request_irq((int) vdev->pdev->irq,
2576 vxge_isr_napi, 2574 vxge_isr_napi,
2577 IRQF_SHARED, vdev->desc[0], hldev); 2575 IRQF_SHARED, vdev->desc[0], vdev);
2578 if (ret) { 2576 if (ret) {
2579 vxge_debug_init(VXGE_ERR, 2577 vxge_debug_init(VXGE_ERR,
2580 "%s %s-%d: ISR registration failed", 2578 "%s %s-%d: ISR registration failed",
@@ -2707,11 +2705,15 @@ vxge_open(struct net_device *dev)
2707 netif_napi_add(dev, &vdev->napi, vxge_poll_inta, 2705 netif_napi_add(dev, &vdev->napi, vxge_poll_inta,
2708 vdev->config.napi_weight); 2706 vdev->config.napi_weight);
2709 napi_enable(&vdev->napi); 2707 napi_enable(&vdev->napi);
2708 for (i = 0; i < vdev->no_of_vpath; i++)
2709 vdev->vpaths[i].ring.napi_p = &vdev->napi;
2710 } else { 2710 } else {
2711 for (i = 0; i < vdev->no_of_vpath; i++) { 2711 for (i = 0; i < vdev->no_of_vpath; i++) {
2712 netif_napi_add(dev, &vdev->vpaths[i].ring.napi, 2712 netif_napi_add(dev, &vdev->vpaths[i].ring.napi,
2713 vxge_poll_msix, vdev->config.napi_weight); 2713 vxge_poll_msix, vdev->config.napi_weight);
2714 napi_enable(&vdev->vpaths[i].ring.napi); 2714 napi_enable(&vdev->vpaths[i].ring.napi);
2715 vdev->vpaths[i].ring.napi_p =
2716 &vdev->vpaths[i].ring.napi;
2715 } 2717 }
2716 } 2718 }
2717 2719
diff --git a/drivers/net/vxge/vxge-main.h b/drivers/net/vxge/vxge-main.h
index 3386970b7efc..a46f7fe938d2 100644
--- a/drivers/net/vxge/vxge-main.h
+++ b/drivers/net/vxge/vxge-main.h
@@ -260,6 +260,7 @@ struct vxge_ring {
260 int gro_enable; 260 int gro_enable;
261 261
262 struct napi_struct napi; 262 struct napi_struct napi;
263 struct napi_struct *napi_p;
263 264
264#define VXGE_MAX_MAC_ADDR_COUNT 30 265#define VXGE_MAX_MAC_ADDR_COUNT 30
265 266