[etherlab-users] Datagram timeout with e1000 on 2.6.24-16-rtai
Frank Heckenbach
f.heckenbach at fh-soft.de
Thu Mar 24 18:53:53 CET 2011
Hi everybody,
I'm trying to use ethercat-1.4.0 on Linux 2.6.24-16-rtai.
With an onboard e1000 network interface, I got no response from
"ethercat slaves" after starting ethercat, and in syslog I got lots
of:
EtherCAT WARNING: 125 datagrams TIMED OUT!
For comparison, I tried with an old R8139 card. I get a response (at
least a short output from "ethercat slaves" -- I'll have to deal
with higher level communication later) and no syslog warnings. I
also tried with the userspace tool SOEM1.2.4, and its "slaveinfo"
program recognizes the slave with both network interfaces.
So I suspected the problem in the ec_e1000 driver. I tried to do
some debugging by inserting some printk statements and found that in
non-ethercat operations e1000_clean_rx_irq gets called to receive
data, while in ethercat mode, e1000_clean_rx_irq and
e1000_clean_rx_irq_ps are not called.
I could trace it to line 3939 in e1000_main-2.6.24-ethercat.c.
AFAIUI, the original code checks if a hardware interrupt happened
and exits if not. Since ethercat works interrupt-less, this fails.
So I just added a check for adapter->ecdev, and now I get a response
from the slave like the one I got with the R8139.
Of course, I'll have to do more tests to see if any other problems
appear, but is this fix so far correct?
Regards,
Frank
--- ethercat-1.4.0/devices/e1000/e1000_main-2.6.24-ethercat.c.orig 2008-12-29 13:58:48.000000000 +0100
+++ ethercat-1.4.0/devices/e1000/e1000_main-2.6.24-ethercat.c 2011-03-24 18:27:40.000000000 +0100
@@ -3936,7 +3936,7 @@
#ifdef CONFIG_E1000_NAPI
/* IMS will not auto-mask if INT_ASSERTED is not set, and if it is
* not set, then the adapter didn't send an interrupt */
- if (unlikely(hw->mac_type >= e1000_82571 &&
+ if (!adapter->ecdev && unlikely(hw->mac_type >= e1000_82571 &&
!(icr & E1000_ICR_INT_ASSERTED)))
return IRQ_NONE;
--
Dipl.-Math. Frank Heckenbach <f.heckenbach at fh-soft.de>
Systemprogrammierung, EDV-Beratung
Stubenlohstr. 6, 91052 Erlangen, Deutschland
Tel.: +49-9131-21359
More information about the Etherlab-users
mailing list