All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manuel Huber <manuel.h87@gmail.com>
To: xenomai@xenomai.org
Subject: [Xenomai] rtdm: minimal patch for sys_rtdm_recvmsg
Date: Sun, 16 Jun 2013 23:04:25 +0200	[thread overview]
Message-ID: <51BE2859.8000307@gmail.com> (raw)

Hello!

I plan to add a minor change to RTnet which allows to get reception
timestamps through recvmsg:

SO_TIMESTAMPNS patch:
http://sourceforge.net/mailarchive/forum.php?thread_name=51BAB330.70500%40web.de&forum_name=rtnet-developers 
<http://sourceforge.net/mailarchive/forum.php?thread_name=51BAB330.70500%40web.de&forum_name=rtnet-developers>

Current implementation (of RTDM) in RTAI and Xenomai doesn't fix the
msg_control and msg_controllen field in struct msghdr. I believe, it
should be done similar to the linux kernel:

1. User specifies how much space has been allocated for control messages
    - msg_control is set to starting address of buffer
    - msg_controllen is set to the size of the buffer
2. User calls recvmsg
3. Control messages are tried to be inserted by some kernel code
4. msg_control is set to the next free byte, msg_controllen is updated to
    the actual space left in the buffer.
5. Before copying the struct to the user, msg_control has to be reset to
    the actual starting address and msg_controllen has to be set to the
    number of bytes written to the control message buffer rather than the
    space left.
6. Back to user space.

Current implementation could cause problems: Control messages are
currently not used but the msg_controllen field inidicates that control
messages have been written to the buffer; I'm not sure that this is a
violation of some standard, but at least it's different from the linux
kernel implementation!

The patch has been tested on 3.5.7 kernel and is based on SHA
69f6cb5ec287afff5ab197528d9eb1177f6de6d6
(http://git.xenomai.org/xenomai-jki.git) and should work as expected.


Best Regards

Manuel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Xenomai-0001-rtdm-Fix-msghdr-struct-cmsg-in-sys_rtdm_recvmsg.patch
Type: text/x-patch
Size: 1722 bytes
Desc: not available
URL: <http://www.xenomai.org/pipermail/xenomai/attachments/20130616/18f43ac0/attachment.bin>

             reply	other threads:[~2013-06-16 21:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-16 21:04 Manuel Huber [this message]
2013-06-17  5:27 ` [Xenomai] rtdm: minimal patch for sys_rtdm_recvmsg Jan Kiszka
2013-06-17  9:53   ` Manuel Huber
2013-06-17 10:04     ` [Xenomai] Fwd: " Manuel Huber
2013-06-22  6:56     ` [Xenomai] " Jan Kiszka
     [not found]       ` <51C5F102.8010803@gmail.com>
2013-06-22 21:35         ` [Xenomai] Problem accessing msg_name in rt_udp_recvmsg Manuel Huber
2013-06-23 12:23           ` Jan Kiszka

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=51BE2859.8000307@gmail.com \
    --to=manuel.h87@gmail.com \
    --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.