Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1628415

Re: [regression v4.11] 617f01211baf ("8139too: use napi_complete_done()")

From Eric Dumazet <eric.dumazet@gmail.com>
Newsgroups linux.kernel
Subject Re: [regression v4.11] 617f01211baf ("8139too: use napi_complete_done()")
Date 2017-04-21 20:20 +0200
Message-ID <tyKQV-gp-15@gated-at.bofh.it> (permalink)
References <ttGEi-2A6-7@gated-at.bofh.it> <tyFex-5iI-11@gated-at.bofh.it> <tyGNj-6jG-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, 2017-04-21 at 06:29 -0700, Eric Dumazet wrote:

> Thanks for this report.
> 
> Interesting to see how many drivers got the netpoll stuff wrong :/
> 
> Can you try :
> 
> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
> index 81f18a8335276495a59fa93219c4607c2b8a47aa..74e4c72c331d5a6cc5b653970ef4133c8ddf9999 100644
> --- a/drivers/net/ethernet/realtek/r8169.c
> +++ b/drivers/net/ethernet/realtek/r8169.c
> @@ -7668,7 +7668,7 @@ static void rtl8169_netpoll(struct net_device *dev)
>  {
>  	struct rtl8169_private *tp = netdev_priv(dev);
>  
> -	rtl8169_interrupt(tp->pci_dev->irq, dev);
> +	napi_schedule(&tp->napi);

The problem is more likely that netconsole handling can call rtl_tx()
from hard irq context, while standard NAPI poll calls it from BH

Meaning that the following sequence triggers a lockdep warning.

	u64_stats_update_begin(&tp->tx_stats.syncp);
	tp->tx_stats.packets++;
	tp->tx_stats.bytes += tx_skb->skb->len;
	u64_stats_update_end(&tp->tx_stats.syncp);

Lockdep does not know that poll_napi() ( called from netpoll_poll_dev())
uses an cmpxchg() to make sure that there is no race.

I am not sure how we can teach lockdep to not splat in this case.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [regression v4.11] 617f01211baf ("8139too: use  napi_complete_done()") Ville Syrjälä <ville.syrjala@linux.intel.com> - 2017-04-21 13:50 +0200
  Re: [regression v4.11] 617f01211baf ("8139too: use  napi_complete_done()") Eric Dumazet <eric.dumazet@gmail.com> - 2017-04-21 15:30 +0200
    Re: [regression v4.11] 617f01211baf ("8139too: use  napi_complete_done()") Eric Dumazet <eric.dumazet@gmail.com> - 2017-04-21 19:50 +0200
    Re: [regression v4.11] 617f01211baf ("8139too: use  napi_complete_done()") Eric Dumazet <eric.dumazet@gmail.com> - 2017-04-21 20:20 +0200

csiph-web