netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* r8169 doing more work than napi weight
@ 2013-01-21 15:12 Timo Teras
  2013-01-21 23:42 ` Francois Romieu
  0 siblings, 1 reply; 9+ messages in thread
From: Timo Teras @ 2013-01-21 15:12 UTC (permalink / raw)
  To: Francois Romieu, netdev

Hi,

I'm getting:

WARNING: at linux-grsec/src/linux-3.4/net/core/dev.c:3875 net_rx_action+0xab/0x153()

on one of my r8169 boxes.

This would be the:
	WARN_ON_ONCE(work > weight); 

Now the only way this seems to be possible to happen is that the AMD
workaround triggers:
        if ((desc->opts2 & cpu_to_le32(0xfffe000)) &&
            (tp->mac_version == RTL_GIGA_MAC_VER_05)) {
                 desc->opts2 = 0;
                 cur_rx++;
        }

And yes, the hardware where the WARN_ON_ONCE triggers is indeed
RTL_GIGA_MAC_VER_05.

This would cause cur_rx to be incremented twice in the loop, but
rx_left not decremented accordingly.

As the work done is counted finally based on cur_rx, we might end up
returning more work done than what was our quota.

This has also the unwanted consequence of messing NAPI state as if more
work than quota was done then polling is stopped as the work == weight
does not trigger and the polling is not rescheduled.

Git log says that this workaround was copied from Realtek's r8168
driver, but I don't see anything like this there anymore.

I'm wondering if we should just delete the
	cur_rx++;
Or add:
	rx_left--;

Or just delete the whole block as obsolete. 'git log' says the problem
should have gone away by always using hardware Rx VLAN. See commit
05af214 "r8169: fix Ethernet Hangup for RTL8110SC rev d".

Thanks,
 Timo

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-01-24  6:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-21 15:12 r8169 doing more work than napi weight Timo Teras
2013-01-21 23:42 ` Francois Romieu
2013-01-22  8:30   ` [PATCH net] r8169: remove the obsolete and incorrect AMD workaround Timo Teräs
2013-01-23  0:05     ` Francois Romieu
2013-01-23  0:42       ` David Miller
2013-01-23  6:14       ` Timo Teras
2013-01-23 22:38         ` Francois Romieu
2013-01-24  6:09           ` Timo Teras
2013-01-23 18:52       ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).