aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/r8169.c
diff options
context:
space:
mode:
authorFrancois Romieu <romieu@fr.zoreil.com>2011-03-15 12:29:31 -0400
committerFrancois romieu <romieu@fr.zoreil.com>2011-05-09 15:03:06 -0400
commit56de414c0c7333f1e1adedc23057e131ce84233e (patch)
treebba00e8cfca8932133a1645c00089c04ea0915c7 /drivers/net/r8169.c
parent4876cc1e49efac03827a51a2422cfbbb7f6335de (diff)
r8169: remove non-NAPI context invocation of rtl8169_rx_interrupt.
Invocation of rtl8169_rx_interrupt from rtl8169_reset_task was originally intended to retrieve as much packets as possible from the rx ring when a reset was needed. Nowadays rtl8169_reset_task is only scheduled, with some delay a. from the tx timeout watchdog b. when resuming c. from rtl8169_rx_interrupt itself It's dubious that the loss of outdated packets will matter much for a) and b). c) does not need to call itself again. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>
Diffstat (limited to 'drivers/net/r8169.c')
-rw-r--r--drivers/net/r8169.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index b3cf1d20ba2c..81906bc919a4 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -4564,6 +4564,7 @@ static void rtl8169_reset_task(struct work_struct *work)
4564 struct rtl8169_private *tp = 4564 struct rtl8169_private *tp =
4565 container_of(work, struct rtl8169_private, task.work); 4565 container_of(work, struct rtl8169_private, task.work);
4566 struct net_device *dev = tp->dev; 4566 struct net_device *dev = tp->dev;
4567 int i;
4567 4568
4568 rtnl_lock(); 4569 rtnl_lock();
4569 4570
@@ -4572,19 +4573,15 @@ static void rtl8169_reset_task(struct work_struct *work)
4572 4573
4573 rtl8169_wait_for_quiescence(dev); 4574 rtl8169_wait_for_quiescence(dev);
4574 4575
4575 rtl8169_rx_interrupt(dev, tp, tp->mmio_addr, ~(u32)0); 4576 for (i = 0; i < NUM_RX_DESC; i++)
4577 rtl8169_mark_to_asic(tp->RxDescArray + i, rx_buf_sz);
4578
4576 rtl8169_tx_clear(tp); 4579 rtl8169_tx_clear(tp);
4577 4580
4578 if (tp->dirty_rx == tp->cur_rx) { 4581 rtl8169_init_ring_indexes(tp);
4579 rtl8169_init_ring_indexes(tp); 4582 rtl_hw_start(dev);
4580 rtl_hw_start(dev); 4583 netif_wake_queue(dev);
4581 netif_wake_queue(dev); 4584 rtl8169_check_link_status(dev, tp, tp->mmio_addr);
4582 rtl8169_check_link_status(dev, tp, tp->mmio_addr);
4583 } else {
4584 if (net_ratelimit())
4585 netif_emerg(tp, intr, dev, "Rx buffers shortage\n");
4586 rtl8169_schedule_work(dev, rtl8169_reset_task);
4587 }
4588 4585
4589out_unlock: 4586out_unlock:
4590 rtnl_unlock(); 4587 rtnl_unlock();
@@ -4889,20 +4886,12 @@ static struct sk_buff *rtl8169_try_rx_copy(void *data,
4889 return skb; 4886 return skb;
4890} 4887}
4891 4888
4892/*
4893 * Warning : rtl8169_rx_interrupt() might be called :
4894 * 1) from NAPI (softirq) context
4895 * (polling = 1 : we should call netif_receive_skb())
4896 * 2) from process context (rtl8169_reset_task())
4897 * (polling = 0 : we must call netif_rx() instead)
4898 */
4899static int rtl8169_rx_interrupt(struct net_device *dev, 4889static int rtl8169_rx_interrupt(struct net_device *dev,
4900 struct rtl8169_private *tp, 4890 struct rtl8169_private *tp,
4901 void __iomem *ioaddr, u32 budget) 4891 void __iomem *ioaddr, u32 budget)
4902{ 4892{
4903 unsigned int cur_rx, rx_left; 4893 unsigned int cur_rx, rx_left;
4904 unsigned int count; 4894 unsigned int count;
4905 int polling = (budget != ~(u32)0) ? 1 : 0;
4906 4895
4907 cur_rx = tp->cur_rx; 4896 cur_rx = tp->cur_rx;
4908 rx_left = NUM_RX_DESC + tp->dirty_rx - cur_rx; 4897 rx_left = NUM_RX_DESC + tp->dirty_rx - cur_rx;
@@ -4962,10 +4951,7 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
4962 4951
4963 rtl8169_rx_vlan_tag(desc, skb); 4952 rtl8169_rx_vlan_tag(desc, skb);
4964 4953
4965 if (likely(polling)) 4954 napi_gro_receive(&tp->napi, skb);
4966 napi_gro_receive(&tp->napi, skb);
4967 else
4968 netif_rx(skb);
4969 4955
4970 dev->stats.rx_bytes += pkt_size; 4956 dev->stats.rx_bytes += pkt_size;
4971 dev->stats.rx_packets++; 4957 dev->stats.rx_packets++;