Date: Sat, 26 Jul 2014 10:00:05 +0200 From: Harm Weites <harm@weites.com> To: Adrian Chadd <adrian@freebsd.org> Cc: "freebsd-mips@freebsd.org" <freebsd-mips@freebsd.org> Subject: Re: interrupt storm arge0, tplink 1043nd Message-ID: <53D36005.1010200@weites.com> In-Reply-To: <CAJ-VmomG7ZfJMdnU8DM5qiodR-BtPbjCXtVp2jXo9K6aAKzuPg@mail.gmail.com> References: <53CEB6B1.9050301@weites.com> <CAJ-VmomG7ZfJMdnU8DM5qiodR-BtPbjCXtVp2jXo9K6aAKzuPg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------000907010203020001090407 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Adrian, Thanks for your pointers, I've attached a patch to enable counting the interrupts. Also attached is a log with the interrupt counters in there pristine state, just after boot and another from right after the storm. Though It looks like none of the counters got incremented, so I most probably wrote bad code. Another thing I noticed, every interrupt (/group of 32) got printed 4 times. Printf also only sent the result to my serial console, even when I ran /sbin/sysctl using ssh so that still deserves a little attention. About vmstat, yes, it regards arge0: # vmstat -ia interrupt total rate sint0: 0 0 sint1: 0 0 int0 ath0 2938765 80 int1: 0 0 int2 arge0 335493 9 int3 arge1 0 0 int4 apb0 1936 0 int5 clock0 1129353 30 apb intr3: uart0 1936 0 apb intr2: gpio0 0 0 apb irq5: pmc 0 0 Total 4407483 120 Regards, Harm op 22-07-14 21:26, Adrian Chadd schreef: > Hi! > > So, ignore the ath0 stuff for now. int2 should be arge0, right? > > what's vmstat -ia say? > > Assuming it's actually arge0, we need to add some debugging counters > to the interrupt path to count how many of each interrupt are > occuring. The stuff i stuck behind ARGEDEBUG() is useful for debugging > some silly bugs but not at the rate that you're getting interrupts. > > So I'd add something like this to the arge softc struct: > > uint32_t intr_status[32]; > > .. then in the interrupt routine, something like this: > > temp_status = status; > for (i = 0; i < 32; i++) { > if (temp_status & 1) { > intr_status[i]++; > } > temp_status = temp_status >> 1; > } > > That'll count the number of interrupts that are firing for each > interrupt status bit. > > Then, you'll want to write a sysctl for it. Have a look at > if_ath_sysctl.c for the SYSCTL_PROC() entries. Just write one that > when called will just printf() the intr_status array: > > for (i = 0; i < 32; i++) { > printf("interrupt %d count %u\n", i, intr_status[i]); > } > > Just make sure you do a complete kernel recompile as changing the > headers doesn't always force the source files to recompile. > > > -a > > > On 22 July 2014 12:08, Harm Weites <harm@weites.com> wrote: >> Hi, >> >> My 1043nd is complaining about interrupt storms, presumably only when >> wifi is beeing used. When this occurs, networking is gone. >> >> The exact message thats flooding me: >> interrupt storm detected on "int2"; throttling interrupt source >> >> The device associated with int2 is arge0. >> >> Some possibly related logs, though these messages start at boot: >> >> # /sbin/dmesg | tail >> ath0: stuck beacon; resetting (bmiss count 4) >> ar5416StopDmaReceive: dma failed to stop in 10ms >> AR_CR=0x00000024 >> AR_DIAG_SW=0x42000020 >> MBSSID Set bit 22 of AR_STA_ID 0xb8c16866 >> ath0: stuck beacon; resetting (bmiss count 4) >> ar5416StopDmaReceive: dma failed to stop in 10ms >> AR_CR=0x00000024 >> AR_DIAG_SW=0x42000020 >> MBSSID Set bit 22 of AR_STA_ID 0xb8c16866 >> >> This unit is configured with (arge0) port0 bound to device vlan1, port4 >> to vlan2 and ports 1,2,3 make up vlan3. There is wlan0, bound to ath0 >> and a bridge device that connects wlan0 to vlan3. There is a dhcp server >> running in vlan3 to answer to wifi clients, internet is routed through >> vlan1. This initially works but after a little while the storm begins >> and the wifi client is left to die. >> >> Adrian@ suggested to start with reading which interrupt(s) occur(s), but >> that is perhaps a little to hard for me to code :) Looking at if_arge.c, >> it seems there is some debug code already in place (ARGEDEBUG()) though >> I'm not sure on how to use that. Reading from the AR71XX_DMA_INTR >> register and mapping its content to AR71XX_DMA_INTR_STATUS would be >> something I'd like to do with a separate program (instead of boldly >> taking a deepdive in to if_arge.c and recompiling/flashing untill >> something works). >> >> One of my other units is configured with just a vlan device per switch >> port, no wifi and no bridge. A third unit is configured with a wlan0, >> vlan1 (port0) and vlan2 (ports 1,2,3,4). Both not showing any issues in >> the past months. The only difference would be this problem-unit has a >> bridge. >> >> Any thoughts on how to approach or 'just' fix this? >> >> Regards, >> Harm >> _______________________________________________ >> freebsd-mips@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-mips >> To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" --------------000907010203020001090407 Content-Type: text/plain; charset=UTF-8; name="interrupts.txt" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="interrupts.txt" IyBzeXNjdGwgLWF8Z3JlcCBpbnRlcnJ1cHQKaW50ZXJydXB0IDAgY291bnQgMjE1NDQwMDc2 OAppbnRlcnJ1cHQgMSBjb3VudCAyMTUzOTQzMDQwCmludGVycnVwdCAyIGNvdW50IDAKaW50 ZXJydXB0IDMgY291bnQgMAppbnRlcnJ1cHQgNCBjb3VudCAyMTUzODkzNzI4CmludGVycnVw dCA1IGNvdW50IDIxNTM4OTM3MjgKaW50ZXJydXB0IDYgY291bnQgMjE1MTI5NjE0MAppbnRl cnJ1cHQgNyBjb3VudCAyMTUxMjk2MTA0CmludGVycnVwdCA4IGNvdW50IDE2CmludGVycnVw dCA5IGNvdW50IDEwNDg1NzYKaW50ZXJydXB0IDEwIGNvdW50IDAKaW50ZXJydXB0IDExIGNv dW50IDI0MzIwNjIwMDMKaW50ZXJydXB0IDEyIGNvdW50IDEzNjY1NTY2NzIKaW50ZXJydXB0 IDEzIGNvdW50IDIxNTQ0NDI0OTYKaW50ZXJydXB0IDE0IGNvdW50IDAKaW50ZXJydXB0IDE1 IGNvdW50IDIxNTQ0NDIzNjgKaW50ZXJydXB0IDE2IGNvdW50IDIxNTQ0NDEyODAKaW50ZXJy dXB0IDE3IGNvdW50IDAKaW50ZXJydXB0IDE4IGNvdW50IDAKaW50ZXJydXB0IDE5IGNvdW50 IDAKaW50ZXJydXB0IDIwIGNvdW50IDAKaW50ZXJydXB0IDIxIGNvdW50IDAKaW50ZXJydXB0 IDIyIGNvdW50IDAKaW50ZXJydXB0IDIzIGNvdW50IDAKaW50ZXJydXB0IDI0IGNvdW50IDAK aW50ZXJydXB0IDI1IGNvdW50IDIxNTM4OTY2NTYKaW50ZXJydXB0IDI2IGNvdW50IDE2OTcz ODI0CmludGVycnVwdCAyNyBjb3VudCAwCmludGVycnVwdCAyOCBjb3VudCAwCmludGVycnVw dCAyOSBjb3VudCA0CmludGVycnVwdCAzMCBjb3VudCAwCmludGVycnVwdCAzMSBjb3VudCAw CmludGVycnVwdCAwIGNvdW50IDIxNTQ0MDA3NjgKaW50ZXJydXB0IDEgY291bnQgMjE1Mzk0 MzA0MAppbnRlcnJ1cHQgMiBjb3VudCAwCmludGVycnVwdCAzIGNvdW50IDAKaW50ZXJydXB0 IDQgY291bnQgMjE1Mzg5MzcyOAppbnRlcnJ1cHQgNSBjb3VudCAyMTUzODkzNzI4CmludGVy cnVwdCA2IGNvdW50IDIxNTEyOTYxNDAKaW50ZXJydXB0IDcgY291bnQgMjE1MTI5NjEwNApp bnRlcnJ1cHQgOCBjb3VudCAxNgppbnRlcnJ1cHQgOSBjb3VudCAxMDQ4NTc2CmludGVycnVw dCAxMCBjb3VudCAwCmludGVycnVwdCAxMSBjb3VudCAyNDMyMDYyMDAzCmludGVycnVwdCAx MiBjb3VudCAxMzY2NTU2NjcyCmludGVycnVwdCAxMyBjb3VudCAyMTU0NDQyNDk2CmludGVy cnVwdCAxNCBjb3VudCAwCmludGVycnVwdCAxNSBjb3VudCAyMTU0NDQyMzY4CmludGVycnVw dCAxNiBjb3VudCAyMTU0NDQxMjgwCmludGVycnVwdCAxNyBjb3VudCAwCmludGVycnVwdCAx OCBjb3VudCAwCmludGVycnVwdCAxOSBjb3VudCAwCmludGVycnVwdCAyMCBjb3VudCAwCmlu dGVycnVwdCAyMSBjb3VudCAwCmludGVycnVwdCAyMiBjb3VudCAwCmludGVycnVwdCAyMyBj b3VudCAwCmludGVycnVwdCAyNCBjb3VudCAwCmludGVycnVwdCAyNSBjb3VudCAyMTUzODk2 NjU2CmludGVycnVwdCAyNiBjb3VudCAxNjk3MzgyNAppbnRlcnJ1cHQgMjcgY291bnQgMApp bnRlcnJ1cHQgMjggY291bnQgMAppbnRlcnJ1cHQgMjkgY291bnQgNAppbnRlcnJ1cHQgMzAg Y291bnQgMAppbnRlcnJ1cHQgMzEgY291bnQgMAppbnRlcnJ1cHQgMCBjb3VudCAyMTU0NDI0 MzIwCmludGVycnVwdCAxIGNvdW50IDIxNTM5NDI3ODQKaW50ZXJydXB0IDIgY291bnQgMApp bnRlcnJ1cHQgMyBjb3VudCAwCmludGVycnVwdCA0IGNvdW50IDIxNTM4OTMzNDQKaW50ZXJy dXB0IDUgY291bnQgMjE1Mzg5MzM0NAppbnRlcnJ1cHQgNiBjb3VudCAyMTUxMjk2MTQwCmlu dGVycnVwdCA3IGNvdW50IDIxNTEyOTYxMDQKaW50ZXJydXB0IDggY291bnQgNgppbnRlcnJ1 cHQgOSBjb3VudCAxMDQ4NTc2CmludGVycnVwdCAxMCBjb3VudCAwCmludGVycnVwdCAxMSBj b3VudCAyNDMyMDYyMDAzCmludGVycnVwdCAxMiBjb3VudCAxMzY2NjIyMjA4CmludGVycnVw dCAxMyBjb3VudCAyMTU0NDQwMzIwCmludGVycnVwdCAxNCBjb3VudCAwCmludGVycnVwdCAx NSBjb3VudCAyMTU0NDQyMzA0CmludGVycnVwdCAxNiBjb3VudCAyMTU0NDM5OTM2CmludGVy cnVwdCAxNyBjb3VudCAwCmludGVycnVwdCAxOCBjb3VudCAwCmludGVycnVwdCAxOSBjb3Vu dCAwCmludGVycnVwdCAyMCBjb3VudCAwCmludGVycnVwdCAyMSBjb3VudCAwCmludGVycnVw dCAyMiBjb3VudCAwCmludGVycnVwdCAyMyBjb3VudCAwCmludGVycnVwdCAyNCBjb3VudCAw CmludGVycnVwdCAyNSBjb3VudCAyMTUzODk2NjA4CmludGVycnVwdCAyNiBjb3VudCAxNjk3 MzgyNAppbnRlcnJ1cHQgMjcgY291bnQgMAppbnRlcnJ1cHQgMjggY291bnQgMAppbnRlcnJ1 cHQgMjkgY291bnQgNAppbnRlcnJ1cHQgMzAgY291bnQgMAppbnRlcnJ1cHQgMzEgY291bnQg MAppbnRlcnJ1cHQgMCBjb3VudCAyMTU0NDI0MzIwCmludGVycnVwdCAxIGNvdW50IDIxNTM5 NDI3ODQKaW50ZXJydXB0IDIgY291bnQgMAppbnRlcnJ1cHQgMyBjb3VudCAwCmludGVycnVw dCA0IGNvdW50IDIxNTM4OTMzNDQKaW50ZXJydXB0IDUgY291bnQgMjE1Mzg5MzM0NAppbnRl cnJ1cHQgNiBjb3VudCAyMTUxMjk2MTQwCmludGVycnVwdCA3IGNvdW50IDIxNTEyOTYxMDQK aW50ZXJydXB0IDggY291bnQgNgppbnRlcnJ1cHQgOSBjb3VudCAxMDQ4NTc2CmludGVycnVw dCAxMCBjb3VudCAwCmludGVycnVwdCAxMSBjb3VudCAyNDMyMDYyMDAzCmludGVycnVwdCAx MiBjb3VudCAxMzY2NjIyMjA4CmludGVycnVwdCAxMyBjb3VudCAyMTU0NDQwMzIwCmludGVy cnVwdCAxNCBjb3VudCAwCmludGVycnVwdCAxNSBjb3VudCAyMTU0NDQyMzA0CmludGVycnVw dCAxNiBjb3VudCAyMTU0NDM5OTM2CmludGVycnVwdCAxNyBjb3VudCAwCmludGVycnVwdCAx OCBjb3VudCAwCmludGVycnVwdCAxOSBjb3VudCAwCmludGVycnVwdCAyMCBjb3VudCAwCmlu dGVycnVwdCAyMSBjb3VudCAwCmludGVycnVwdCAyMiBjb3VudCAwCmludGVycnVwdCAyMyBj b3VudCAwCmludGVycnVwdCAyNCBjb3VudCAwCmludGVycnVwdCAyNSBjb3VudCAyMTUzODk2 NjA4CmludGVycnVwdCAyNiBjb3VudCAxNjk3MzgyNAppbnRlcnJ1cHQgMjcgY291bnQgMApp bnRlcnJ1cHQgMjggY291bnQgMAppbnRlcnJ1cHQgMjkgY291bnQgNAppbnRlcnJ1c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XJydXB0IDIyIGNvdW50IDAKaW50ZXJydXB0IDIzIGNv dW50IDAKaW50ZXJydXB0IDI0IGNvdW50IDAKaW50ZXJydXB0IDI1IGNvdW50IDIxNTM4OTY2 MDgKaW50ZXJydXB0IDI2IGNvdW50IDE2OTczODI0CmludGVycnVwdCAyNyBjb3VudCAwCmlu dGVycnVwdCAyOCBjb3VudCAwCmludGVycnVwdCAyOSBjb3VudCA0CmludGVycnVwdCAzMCBj b3VudCAwCmludGVycnVwdCAzMSBjb3VudCAwCgppbnRlcnJ1cHQgc3Rvcm0gZGV0ZWN0ZWQg b24gImludDIiOyB0aHJvdHRsaW5nIGludGVycnVwdCBzb3VyY2UKaW50ZXJydXB0IHN0b3Jt IGRldGVjdGVkIG9uICJpbnQyIjsgdGhyb3R0bGluZyBpbnRlcnJ1cHQgc291cmNlCmludGVy cnVwdCBzdG9ybSBkZXRlY3RlZCBvbiAiaW50MiI7IHRocm90dGxpbmcgaW50ZXJydXB0IHNv dXJjZQppbnRlcnJ1cHQgc3Rvcm0gZGV0ZWN0ZWQgb24gImludDIiOyB0aHJvdHRsaW5nIGlu dGVycnVwdCBzb3VyY2UKCiMgaWZjb25maWcgYXJnZTAgZG93bgojIHZtc3RhdCAtaWEKaW50 ZXJydXB0ICAgICAgICAgICAgICAgICAgICAgICAgICB0b3RhbCAgICAgICByYXRlCnNpbnQw OiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAgMApzaW50MTog ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgIDAKaW50MCBhdGgw ICAgICAgICAgICAgICAgICAgICAgICAgMjkzODc2NSAgICAgICAgIDgwCmludDE6ICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAgMAppbnQyIGFyZ2UwICAg ICAgICAgICAgICAgICAgICAgICAgMzM1NDkzICAgICAgICAgIDkKaW50MyBhcmdlMSAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgICAwCmludDQgYXBiMCAgICAgICAg ICAgICAgICAgICAgICAgICAgIDE5MzYgICAgICAgICAgMAppbnQ1IGNsb2NrMCAgICAgICAg ICAgICAgICAgICAgICAxMTI5MzUzICAgICAgICAgMzAKYXBiIGludHIzOiB1YXJ0MCAgICAg ICAgICAgICAgICAgICAgMTkzNiAgICAgICAgICAwCmFwYiBpbnRyMjogZ3BpbzAgICAgICAg ICAgICAgICAgICAgICAgIDAgICAgICAgICAgMAphcGIgaXJxNTogcG1jICAgICAgICAgICAg ICAgICAgICAgICAgICAwICAgICAgICAgIDAKVG90YWwgICAgICAgICAgICAgICAgICAgICAg ICAgICAgNDQwNzQ4MyAgICAgICAgMTIwCgo= --------------000907010203020001090407 Content-Type: text/x-patch; name="if_arge-interrupt_counters.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="if_arge-interrupt_counters.patch" Index: sys/mips/atheros/if_arge.c =================================================================== --- sys/mips/atheros/if_arge.c (revision 268881) +++ sys/mips/atheros/if_arge.c (working copy) @@ -265,6 +265,21 @@ return (BUS_PROBE_NOWILDCARD); } +/* + * Print a list of all interrupts with there associated count. + */ +static int +sysctl_interrupt_status(SYSCTL_HANDLER_ARGS) +{ + uint32_t *intr_status = arg1; + int i; + + for (i = 0; i < 32; i++) { + printf("interrupt %d count %u\n", i, intr_status[i]); + } + return (0); +} + static void arge_attach_sysctl(device_t dev) { @@ -293,6 +308,8 @@ CTLFLAG_RW, &sc->arge_cdata.arge_tx_cons, 0, ""); SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "tx_cnt", CTLFLAG_RW, &sc->arge_cdata.arge_tx_cnt, 0, ""); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "interrupt_status", + CTLTYPE_INT | CTLFLAG_RW, sc, 0, sysctl_interrupt_status, "I", "Detailed interrupt counters"); #endif } @@ -2272,6 +2289,8 @@ struct arge_softc *sc = arg; uint32_t status; struct ifnet *ifp = sc->arge_ifp; + uint32_t temp_status; + int i; status = ARGE_READ(sc, AR71XX_DMA_INTR_STATUS); status |= sc->arge_intr_status; @@ -2286,6 +2305,17 @@ if (status == 0) return; + /* + * Count interrupts. + */ + temp_status = status; + for (i = 0; i < 32; i++) { + if (temp_status & 1) { + sc->intr_status[i]++; + } + temp_status = temp_status >> 1; + } + if (status & DMA_INTR_RX_BUS_ERROR) { ARGE_WRITE(sc, AR71XX_DMA_RX_STATUS, DMA_RX_STATUS_BUS_ERROR); device_printf(sc->arge_dev, "RX bus error"); Index: sys/mips/atheros/if_argevar.h =================================================================== --- sys/mips/atheros/if_argevar.h (revision 268114) +++ sys/mips/atheros/if_argevar.h (working copy) @@ -176,6 +176,7 @@ uint32_t rx_overflow; uint32_t tx_underflow; } stats; + uint32_t intr_status[32]; }; #endif /* __IF_ARGEVAR_H__ */ --------------000907010203020001090407--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53D36005.1010200>