[etherlab-users] Unmatched/Skipped Datagrams
Gavin Lambert
gavin.lambert at tomra.com
Sun Dec 15 22:55:41 CET 2019
1kHz cycle is typically too fast for the generic driver. Try using the ec_igb driver instead, or reduce your cycle to 250 Hz or less.
Otherwise, there may be some other issue with your network wiring, or your hardware. Have you tried it on other hardware?
Gavin Lambert
Senior Software Developer
COMPAC SORTING EQUIPMENT LTD | 4 Henderson Pl | Onehunga | Auckland 1061 | New Zealand
Switchboard: +49 2630 96520 | https://www.tomra.com
The information contained in this communication and any attachment is confidential and may be legally privileged. It should only be read by the person(s) to whom it is addressed. If you have received this communication in error, please notify the sender and delete the communication.
-----Original Message-----
From: Gary Grobe
Sent: Saturday, 14 December 2019 11:19
To: etherlab-users at etherlab.org
Subject: [etherlab-users] Unmatched/Skipped Datagrams
My configuration is:
- Linux 4.19.82-rt30 #1 SMP PREEMPT RT x86_64 GNU/Linux
- IgH EtherCAT master 1.5.2 6258f7d85afb+
- Intel(R) Celeron(R) CPU J1900 @ 1.99GHz
- ec_generic based on the following NIC:
03:00.0 Ethernet controller [0200]: Intel Corporation I211 Gigabit Network Connection [8086:1539] (rev 03)
Subsystem: Intel Corporation I211 Gigabit Network Connection [8086:0000]
Kernel driver in use: igb
The app is a user-space client. The following is the cyclic task cut down to a minimum, and yet still shows the issue.
{
// ...
struct sched_param param = { };
param.sched_priority = sched_get_priority_max(SCHED_FIFO);
if (mlockall(MCL_CURRENT | MCL_FUTURE) == -1) {
std::cout << "Warning: Failed to lock memory: " <<
strerror(errno) <<
std::endl;
}
stack_prefault();
clock_gettime(CLOCK_MONOTONIC, &wakeup_time);
wakeup_time.tv_sec += 1;
wakeup_time.tv_nsec = 0;
while (running) {
ret = clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &wakeup_time,
NULL);
if (ret) {
std::cerr << "clock_nanosleep(): " << strerror(ret) << std::endl;
break;
}
task_cycle();
wakeup_time.tv_nsec += PERIOD_NS;
while (wakeup_time.tv_nsec >= NSEC_PER_SEC) {
wakeup_time.tv_nsec -= NSEC_PER_SEC;
wakeup_time.tv_sec++;
}
}
}
inline void TestChain::task_cycle()
{
ecrt_master_receive(master);
ecrt_domain_process(domain);
ecrt_master_application_time(master, TIMESPEC2NS(wakeup_time));
ecrt_master_sync_reference_clock(master);
ecrt_master_sync_slave_clocks(master);
if (counter) {
counter--;
}
else {
counter = FREQUENCY;
}
ecrt_domain_queue(domain);
ecrt_master_send(master);
}
The following messages from dmesg were taken at 1kHz. Doesn't matter if it's doing 10Hz or 1kHz, the UNMATCHED and SKIPPED numbers are quite large. I've only seen 1Hz work w/o issue.
[ 4132.457210] EtherCAT 0: Domain 0: 268 working counter changes - now 1/2.
[ 4133.373743] EtherCAT WARNING 0: 657 datagrams UNMATCHED!
[ 4133.461587] EtherCAT WARNING: Datagram 000000002f1447da
(domain0-0-main) was SKIPPED 736 times.
[ 4133.461593] EtherCAT 0: Domain 0: 395 working counter changes - now 0/2.
[ 4134.374131] EtherCAT WARNING 0: 643 datagrams UNMATCHED!
[ 4134.465961] EtherCAT WARNING: Datagram 000000002f1447da
(domain0-0-main) was SKIPPED 776 times.
[ 4134.465968] EtherCAT 0: Domain 0: 232 working counter changes - now 0/2.
[ 4135.374332] EtherCAT WARNING 0: 850 datagrams UNMATCHED!
[ 4135.470468] EtherCAT WARNING: Datagram 000000002f1447da
(domain0-0-main) was SKIPPED 722 times.
[ 4135.470476] EtherCAT 0: Domain 0: 331 working counter changes - now 1/2.
[ 4136.374860] EtherCAT WARNING 0: 649 datagrams UNMATCHED!
[ 4136.475180] EtherCAT WARNING: Datagram 000000002f1447da
(domain0-0-main) was SKIPPED 858 times.
[ 4136.475187] EtherCAT 0: Domain 0: 282 working counter changes - now 1/2.
[ 4137.375178] EtherCAT WARNING 0: 757 datagrams UNMATCHED!
[ 4138.319869] EtherCAT WARNING: Datagram 000000002f1447da
(domain0-0-main) was SKIPPED 745 times.
[ 4138.319877] EtherCAT 0: Domain 0: 208 working counter changes - now 1/2.
[ 4138.375593] EtherCAT WARNING 0: 972 datagrams UNMATCHED!
[ 4139.324269] EtherCAT WARNING: Datagram 000000002f1447da
(domain0-0-main) was SKIPPED 911 times.
More information about the Etherlab-users
mailing list