From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 32440 invoked from network); 15 May 1998 19:20:25 -0000 Received: from softdnserror (HELO altatech.com) (198.60.83.58) by mail2.redhat.com with SMTP; 15 May 1998 19:20:25 -0000 Received: from altatech.com (oldjewel [198.60.83.206]) by altatech.com (8.8.3/8.8.3) with ESMTP id NAA22255; Fri, 15 May 1998 13:20:21 -0600 Sender: cworley@altatech.com Message-ID: <355C978F.7D43D458@altatech.com> Date: Fri, 15 May 1998 13:29:19 -0600 From: Christian Worley Organization: Alta Technology X-Mailer: Mozilla 4.04 [en] (X11; I; OSF1 V3.2 alpha) MIME-Version: 1.0 To: "axp-list@redhat.com" CC: Donald Becker , maddog@li.org Subject: Random floating point exceptions and interrupt handler re-entry Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I'm trying to port the Packet Engines "Gigabit Ethernet" card to AXP/Linux, using Donald Becker's "yellowfin" driver for this card. The problems I'm having don't seem to be related to the driver, I've been up and down it's code which looks good (but I don't know the assumptions of the board itself): 1) Programs with lots of floating point code die randomly with floating point exceptions when the network is at peak load (running netperfs and such). 2) The interrupt handlers, in general, seem to be getting re-entered, even though interrupts are disabled. 3) The yellowfin drivers stops responding, and needs to be rmmod/insmod to get it going again. So, starting off with an explanation of "1)", above: I can transmit UDP packets (using netperf as a test) all night long from an Alpha to an Intel (both with yellowfin boards), without any problems. If I run TCP tests, or receive UDP packets (via netperf) on an Alpha, then this will run all night long too... as long as I don't start up other programs. With other programs running, they die randomly (at many places within their code) with floating point exceptions. Without a yellowfin card, these programs run without error. I saw something similar once, running VxWorks on an Axp, where you had to set a mask of the register sets to be swapped with a thread you were invoking. If the thread had FP calculations, and you didn't set the flag that indicated "swap the FP registers", then under high load, the task would swap out in the middle of an FP operation, the FP regs wouldn't be swapped out, when the task was swapped back in, the FP unit had to deal with whatever junk was in the FP registers in the middle of an operation, and the thread would often throw a FP exception from a random (different every time) program location. Then again, we are dealing with a bus-mastering device, which could write to any memory location without getting trapped, and it could just be randomly bombing memory. Any ideas on what is causing this? Anybody know how the kernel swaps FP regs with a task? On to "2)", above: I see this with or without the yellowfin card. I've instrumented the kernel in linux/arch/alpha/kernel/irq.c, the routine "cabriolet_and_eb66p_device_interrupt" such that it has the basic structure: struct pt_regs * regs) { unsigned long flags; static int reentry=0; save_flags(flags); cli(); if (reentry) { printk("Reentry detected\n"); } reentry = 1; /* the body of the code */ reentry = 0; restore_flags(flags); } The "reentry" flag should never be found to be set. But it is. I've found drivers erroneously using "sti()" (which raises the IPL to user level) in the middle of an interrupt routine. Replacing their "sti" with the flag save and restore has removed problems with these drivers. But, when I look thru the kernel source, there's probably about 50 files still using "sti" (mostly disk and net drivers). In the network core code, I modified about 20 files to "do it right". Of these, "route.c" and "af_inet.c" had some pretty strange "sti's" in them, and I had to leave them the way they were for the machine to boot properly (there was one "sti" with no corresponding "cli"). Anyway, these changes didn't make any difference. I still see "Reentry detected" occasionally, mostly when X is starting and when I reload the yellowfin driver. When is it appropriate to call "sti" on an Alpha? When is it appropriate to re-enter the above routine? On to point "3)", above: When I'm running Netperf's "netserver", receiving UDP packets from an Intel host across a yellowfin driver, when I increase the system load (i.e. start running many continuously calculating FFT's, that occasionally have random FP exceptions), the netperf transfers stop and don't restart. The sender eventually times out saying it lost contact with the receiver. At this point, I can't ping into or out of the AXP system. If I remove the yellowfin module, then reinstall it, the communications start back up (without restarting Netperf's "netserver" or the sender on the Intel side). The Yellowfin driver is supposed to timeout and restart itself if it goes too long without receiving a packet. This timeout code is not getting called. Either the yellowfin thinks it's OK, or the timeout mechanism isn't working. Any ideas on how to debug this? I'm running RedHat 5.0 (Kernel rev 2.0.30), using the egcs 1.0 compiler, on a Digital PC164, 500MHZ, 128MB RAM. Thanks, Chris -- When I die, please cast my ashes upon Bill Gates --for once, let him clean up after me!