aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/nic.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2010-09-10 02:42:33 -0400
committerDavid S. Miller <davem@davemloft.net>2010-09-10 15:27:34 -0400
commit4642610c77b345130d6b5a08c75d23ad98601fd5 (patch)
treebf6345d84e6dbd3a3d44ff4e050dc862f01a01fc /drivers/net/sfc/nic.c
parentecc910f520ba8f22848982ee816ad75c449b805d (diff)
sfc: Allow changing the DMA ring sizes dynamically via ethtool
This requires some reorganisation of channel setup and teardown to ensure that we can always roll-back a failed change. Based on work by Steve Hodgson <shodgson@solarflare.com> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/nic.c')
-rw-r--r--drivers/net/sfc/nic.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/sfc/nic.c b/drivers/net/sfc/nic.c
index 0deb5c38efff..6c5c0cefa9d8 100644
--- a/drivers/net/sfc/nic.c
+++ b/drivers/net/sfc/nic.c
@@ -1478,7 +1478,7 @@ static irqreturn_t efx_legacy_interrupt(int irq, void *dev_id)
1478 */ 1478 */
1479static irqreturn_t efx_msi_interrupt(int irq, void *dev_id) 1479static irqreturn_t efx_msi_interrupt(int irq, void *dev_id)
1480{ 1480{
1481 struct efx_channel *channel = dev_id; 1481 struct efx_channel *channel = *(struct efx_channel **)dev_id;
1482 struct efx_nic *efx = channel->efx; 1482 struct efx_nic *efx = channel->efx;
1483 efx_oword_t *int_ker = efx->irq_status.addr; 1483 efx_oword_t *int_ker = efx->irq_status.addr;
1484 int syserr; 1484 int syserr;
@@ -1553,7 +1553,8 @@ int efx_nic_init_interrupt(struct efx_nic *efx)
1553 efx_for_each_channel(channel, efx) { 1553 efx_for_each_channel(channel, efx) {
1554 rc = request_irq(channel->irq, efx_msi_interrupt, 1554 rc = request_irq(channel->irq, efx_msi_interrupt,
1555 IRQF_PROBE_SHARED, /* Not shared */ 1555 IRQF_PROBE_SHARED, /* Not shared */
1556 channel->name, channel); 1556 efx->channel_name[channel->channel],
1557 &efx->channel[channel->channel]);
1557 if (rc) { 1558 if (rc) {
1558 netif_err(efx, drv, efx->net_dev, 1559 netif_err(efx, drv, efx->net_dev,
1559 "failed to hook IRQ %d\n", channel->irq); 1560 "failed to hook IRQ %d\n", channel->irq);
@@ -1565,7 +1566,7 @@ int efx_nic_init_interrupt(struct efx_nic *efx)
1565 1566
1566 fail2: 1567 fail2:
1567 efx_for_each_channel(channel, efx) 1568 efx_for_each_channel(channel, efx)
1568 free_irq(channel->irq, channel); 1569 free_irq(channel->irq, &efx->channel[channel->channel]);
1569 fail1: 1570 fail1:
1570 return rc; 1571 return rc;
1571} 1572}
@@ -1578,7 +1579,7 @@ void efx_nic_fini_interrupt(struct efx_nic *efx)
1578 /* Disable MSI/MSI-X interrupts */ 1579 /* Disable MSI/MSI-X interrupts */
1579 efx_for_each_channel(channel, efx) { 1580 efx_for_each_channel(channel, efx) {
1580 if (channel->irq) 1581 if (channel->irq)
1581 free_irq(channel->irq, channel); 1582 free_irq(channel->irq, &efx->channel[channel->channel]);
1582 } 1583 }
1583 1584
1584 /* ACK legacy interrupt */ 1585 /* ACK legacy interrupt */