From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Umair Ali <ali.umair@tut.fi>
Cc: "Xenomai list [xenomai@xenomai.org]" <xenomai@xenomai.org>
Subject: Re: [Xenomai] Possible sync problem with timerfd and application
Date: Sun, 20 Dec 2015 16:03:33 +0100 [thread overview]
Message-ID: <20151220150333.GA25662@hermes.click-hack.org> (raw)
In-Reply-To: <2396B4D2166B62479FBBE370D4A7C1F30A716241@mb2010-1.intra.tut.fi>
On Thu, Dec 17, 2015 at 02:07:20PM +0000, Umair Ali wrote:
> Hello there,
>
> I am using the timerfd to produce the required sleep function for
> sending the raw ethernet packets using rtnet driver periodically.
> I read the file using the mmap() function and
> mlockall(MCL_CURRENT|MCL_FUTURE). My code is attached with this
> email. Gilles have already explained me with the jitter problem
> with timerfd but it is acceptable so far with me. Now the problem
> is that the code runs ok for more or less 30 secs. For this period
> of running of code the jitter is acceptable. But after some time
> the jitter increases very much and causes problem. I thought that
> this may be because the timerfd has lost the synchronization with
> application.
The "read" call on a timerfd reads the number of timer ticks since
the last read, so you can know whether an overrun occurred by
checking the variable named "exp" in your program.
> Or timerfd is not working fine. I tried to use the
> poll() and epoll() also but the problem persist. Can you guide me
poll() is not a wrapped call, so causes a switch to secondary mode.
Did not you see that with slackspot? Xenomai only wraps the "select"
call.
Also note that by using the AF_INET family, you are no longer
sending raw packets but UDP packets.
And finally I do not know what your ugly memcpy with hardcoded
lengths do exactly, but the check (j < size) looks insufficient,
as the memcpys are accessing data beyond j. If you receive a signal doing
this, this would certainly cause a switch to secondary mode.
--
Gilles.
https://click-hack.org
next prev parent reply other threads:[~2015-12-20 15:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-17 14:07 [Xenomai] Possible sync problem with timerfd and application Umair Ali
2015-12-18 9:22 ` Philippe Gerum
2015-12-18 11:52 ` Umair Ali
2015-12-20 15:03 ` Gilles Chanteperdrix [this message]
2015-12-21 12:06 ` Umair Ali
2015-12-21 12:40 ` Gilles Chanteperdrix
2015-12-21 14:29 ` Umair Ali
2015-12-21 20:07 ` Gilles Chanteperdrix
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151220150333.GA25662@hermes.click-hack.org \
--to=gilles.chanteperdrix@xenomai.org \
--cc=ali.umair@tut.fi \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.