Skip to content

Commit 7ce103b

Browse files
Roman Yeryomindavem330
authored andcommitted
net: korina: don't use overflow and underflow interrupts
When such interrupts occur there is not much we can do. Dropping the whole ring doesn't help and only produces high packet loss. If we just ignore the interrupt the mac will drop one or few packets instead of the whole ring. Also this will lower the irq handling load and increase performance. Signed-off-by: Roman Yeryomin <roman@advem.lv> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ca44407 commit 7ce103b

File tree

1 file changed

+1
-82
lines changed

1 file changed

+1
-82
lines changed

drivers/net/ethernet/korina.c

Lines changed: 1 addition & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ struct korina_private {
122122

123123
int rx_irq;
124124
int tx_irq;
125-
int ovr_irq;
126-
int und_irq;
127125

128126
spinlock_t lock; /* NIC xmit lock */
129127

@@ -891,8 +889,6 @@ static void korina_restart_task(struct work_struct *work)
891889
*/
892890
disable_irq(lp->rx_irq);
893891
disable_irq(lp->tx_irq);
894-
disable_irq(lp->ovr_irq);
895-
disable_irq(lp->und_irq);
896892

897893
writel(readl(&lp->tx_dma_regs->dmasm) |
898894
DMA_STAT_FINI | DMA_STAT_ERR,
@@ -911,66 +907,17 @@ static void korina_restart_task(struct work_struct *work)
911907
}
912908
korina_multicast_list(dev);
913909

914-
enable_irq(lp->und_irq);
915-
enable_irq(lp->ovr_irq);
916910
enable_irq(lp->tx_irq);
917911
enable_irq(lp->rx_irq);
918912
}
919913

920-
static void korina_clear_and_restart(struct net_device *dev, u32 value)
921-
{
922-
struct korina_private *lp = netdev_priv(dev);
923-
924-
netif_stop_queue(dev);
925-
writel(value, &lp->eth_regs->ethintfc);
926-
schedule_work(&lp->restart_task);
927-
}
928-
929-
/* Ethernet Tx Underflow interrupt */
930-
static irqreturn_t korina_und_interrupt(int irq, void *dev_id)
931-
{
932-
struct net_device *dev = dev_id;
933-
struct korina_private *lp = netdev_priv(dev);
934-
unsigned int und;
935-
936-
spin_lock(&lp->lock);
937-
938-
und = readl(&lp->eth_regs->ethintfc);
939-
940-
if (und & ETH_INT_FC_UND)
941-
korina_clear_and_restart(dev, und & ~ETH_INT_FC_UND);
942-
943-
spin_unlock(&lp->lock);
944-
945-
return IRQ_HANDLED;
946-
}
947-
948914
static void korina_tx_timeout(struct net_device *dev)
949915
{
950916
struct korina_private *lp = netdev_priv(dev);
951917

952918
schedule_work(&lp->restart_task);
953919
}
954920

955-
/* Ethernet Rx Overflow interrupt */
956-
static irqreturn_t
957-
korina_ovr_interrupt(int irq, void *dev_id)
958-
{
959-
struct net_device *dev = dev_id;
960-
struct korina_private *lp = netdev_priv(dev);
961-
unsigned int ovr;
962-
963-
spin_lock(&lp->lock);
964-
ovr = readl(&lp->eth_regs->ethintfc);
965-
966-
if (ovr & ETH_INT_FC_OVR)
967-
korina_clear_and_restart(dev, ovr & ~ETH_INT_FC_OVR);
968-
969-
spin_unlock(&lp->lock);
970-
971-
return IRQ_HANDLED;
972-
}
973-
974921
#ifdef CONFIG_NET_POLL_CONTROLLER
975922
static void korina_poll_controller(struct net_device *dev)
976923
{
@@ -993,8 +940,7 @@ static int korina_open(struct net_device *dev)
993940
}
994941

995942
/* Install the interrupt handler
996-
* that handles the Done Finished
997-
* Ovr and Und Events */
943+
* that handles the Done Finished */
998944
ret = request_irq(lp->rx_irq, korina_rx_dma_interrupt,
999945
0, "Korina ethernet Rx", dev);
1000946
if (ret < 0) {
@@ -1010,31 +956,10 @@ static int korina_open(struct net_device *dev)
1010956
goto err_free_rx_irq;
1011957
}
1012958

1013-
/* Install handler for overrun error. */
1014-
ret = request_irq(lp->ovr_irq, korina_ovr_interrupt,
1015-
0, "Ethernet Overflow", dev);
1016-
if (ret < 0) {
1017-
printk(KERN_ERR "%s: unable to get OVR IRQ %d\n",
1018-
dev->name, lp->ovr_irq);
1019-
goto err_free_tx_irq;
1020-
}
1021-
1022-
/* Install handler for underflow error. */
1023-
ret = request_irq(lp->und_irq, korina_und_interrupt,
1024-
0, "Ethernet Underflow", dev);
1025-
if (ret < 0) {
1026-
printk(KERN_ERR "%s: unable to get UND IRQ %d\n",
1027-
dev->name, lp->und_irq);
1028-
goto err_free_ovr_irq;
1029-
}
1030959
mod_timer(&lp->media_check_timer, jiffies + 1);
1031960
out:
1032961
return ret;
1033962

1034-
err_free_ovr_irq:
1035-
free_irq(lp->ovr_irq, dev);
1036-
err_free_tx_irq:
1037-
free_irq(lp->tx_irq, dev);
1038963
err_free_rx_irq:
1039964
free_irq(lp->rx_irq, dev);
1040965
err_release:
@@ -1052,8 +977,6 @@ static int korina_close(struct net_device *dev)
1052977
/* Disable interrupts */
1053978
disable_irq(lp->rx_irq);
1054979
disable_irq(lp->tx_irq);
1055-
disable_irq(lp->ovr_irq);
1056-
disable_irq(lp->und_irq);
1057980

1058981
korina_abort_tx(dev);
1059982
tmp = readl(&lp->tx_dma_regs->dmasm);
@@ -1073,8 +996,6 @@ static int korina_close(struct net_device *dev)
1073996

1074997
free_irq(lp->rx_irq, dev);
1075998
free_irq(lp->tx_irq, dev);
1076-
free_irq(lp->ovr_irq, dev);
1077-
free_irq(lp->und_irq, dev);
1078999

10791000
return 0;
10801001
}
@@ -1113,8 +1034,6 @@ static int korina_probe(struct platform_device *pdev)
11131034

11141035
lp->rx_irq = platform_get_irq_byname(pdev, "korina_rx");
11151036
lp->tx_irq = platform_get_irq_byname(pdev, "korina_tx");
1116-
lp->ovr_irq = platform_get_irq_byname(pdev, "korina_ovr");
1117-
lp->und_irq = platform_get_irq_byname(pdev, "korina_und");
11181037

11191038
r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "korina_regs");
11201039
dev->base_addr = r->start;

0 commit comments

Comments
 (0)