Re: Interrupt storms with wm(4)

2021-10-21 Thread Emmanuel Dreyfus
On Fri, Oct 15, 2021 at 08:04:22PM +0200, Joerg Sonnenberger wrote:
> Is it the only device using that pin? If so, can you add an event
> counter or so to wm_intr to check what percentage of calls to wm_intr
> return handled == 0?

I did not have the opportunity to investigate the software. I 
tried moving the network interface to a PCI board that works
fine in another machine, the interrupt storms remained.

I swaped the machine itself and the interrupt storms disapeared
with the same software, hence the culprit was the machine's
motherboard.

-- 
Emmanuel Dreyfus
m...@netbsd.org


Re: Interrupt storms with wm(4)

2021-10-15 Thread Joerg Sonnenberger
On Fri, Oct 15, 2021 at 02:10:32AM +, Emmanuel Dreyfus wrote:
> The wm0 interface gets a lot of interrupts. On low usage, CPU
> is spent around 10% in interrupts. It can rise to more than 80%.
> See below what systat vm says when the machine is quiet. 
> ioapic0 pin 16 is the wm0 interface.

Is it the only device using that pin? If so, can you add an event
counter or so to wm_intr to check what percentage of calls to wm_intr
return handled == 0?

Joerg


Re: Interrupt storms with wm(4)

2021-10-14 Thread Mouse
> The wm0 interface gets a lot of interrupts.  On low usage, CPU is
> spent around 10% in interrupts.  It can rise to more than 80%.

!!

> Any idea of what could I try to improve the situation?

As a possible data point, I have a machine with six wm interfaces in it
(ifconfig -l reports wm0 wm1 wm2 wm3 wm4 wm5 bge0 lo0 bridge0 tap1
bridge1 tap2 bridge2 tap3 bridge3 tun0 tun1 tun2 srt0 tap0 tap4 tap5)
and it doesn't exhibit anything like that.

It is, however, running much older NetBSD (my 5.2 derivative), and it's
amd64, not i386.  They also are not 82801s:

wm0 at pci1 dev 0 function 0: 82580 1000BaseT Ethernet, rev. 1
wm1 at pci1 dev 0 function 1: 82580 1000BaseT Ethernet, rev. 1
wm2 at pci1 dev 0 function 2: 82580 1000BaseT Ethernet, rev. 1
wm3 at pci1 dev 0 function 3: 82580 1000BaseT Ethernet, rev. 1
wm4 at pci3 dev 1 function 0: Intel i82546GB 1000BASE-T Ethernet, rev. 3
wm5 at pci3 dev 1 function 1: Intel i82546GB 1000BASE-T Ethernet, rev. 3

I mention it in case there _is_ something of use in knowing that older
NetBSD doesn't necessarily do that.  Maybe it's worth trying something
older, maybe even as old as 5.2, just to see if it helps with the
interrupt storms on your hardware?  The 5.2 wm driver does appear to be
prepared to recognize 82801I interfaces.

/~\ The ASCII Mouse
\ / Ribbon Campaign
 X  Against HTMLmo...@rodents-montreal.org
/ \ Email!   7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Interrupt storms with wm(4)

2021-10-14 Thread Emmanuel Dreyfus
Hello

After batteling with a Xen virtulalized IPfilter machine that froze
(see http://mail-index.netbsd.org/port-xen/2021/10/07/msg010185.html),
I tried to unvirtualize it and moved it to real hardware. It now 
exhibits interrupts storms that sometimes lead to a freeze. 

The wm0 interface gets a lot of interrupts. On low usage, CPU
is spent around 10% in interrupts. It can rise to more than 80%.
See below what systat vm says when the machine is quiet. 
ioapic0 pin 16 is the wm0 interface.

I tried NetBSD 9.2/i386 with options  NO_PCI_MSI_MSIX, 
WM_DISABLE_MSI=1 and WM_DISABLE_MSIX=1 without improvement. 
I also tried NetBSD-current/i386 GENERIC, same behavior.

Any idea of what could I try to improve the situation?

Here is what dmesg said about wm0:
wm0 at pci0 dev 25 function 0: 82801I (AMT) LAN Controller (rev. 0x02)
wm0: interrupting at ioapic0 pin 16
wm0: PCI-Express bus
wm0: 2048 words FLASH, version 1.1.0
wm0: Ethernet address 00:30:48:de:cc:4c
wm0: 0x2a4480

And here is an idle vmstat:
3 usersLoad  0.21  0.18  0.09  Fri Oct 15 04:02:42

Proc:r  d  sCsw  Traps SysCal  Intr   Soft  Fault PAGING   SWAPPING
   9 20   211  1315   1399in  out   in  out
ops
   0.0% Sy   0.0% Us   0.0% Ni  12.0% In  88.0% Idpages
|||||||||||
%%forks
  fkppw
Anon   109976   3%   zero  2744312  1415 Interrupts   fksvm
Exec30116%   wired   11104   TLB shootdownpwait
File75312   2%   inact   100 cpu0 timer   relck
Meta 9293%   bufs  646   ioapic0 pin 9rlkok
 (kB)real   swaponly  free  1147 ioapic0 pin 16   noram
Active 204300  2797228   msi1 vec 0   ndcpy
Namei Sys-cache Proc-cache   168 ioapic0 pin 4fltcp
Calls hits% hits %zfod
66  100   cow
  512 fmin
  Disks: wd0 wd1 cd0   raid0  682 ftarg
 seeksitarg
 xfersflnan
 bytespdfre





-- 
Emmanuel Dreyfus
m...@netbsd.org