All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Florian Westphal <fw@strlen.de>
Cc: David Miller <davem@davemloft.net>,
	kaber@trash.net, netdev@vger.kernel.org
Subject: Re: [WTF?] random test in netlink_sendmsg()
Date: Fri, 12 Dec 2014 22:14:10 +0000	[thread overview]
Message-ID: <20141212221410.GF22149@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20141212215017.GB3624@breakpoint.cc>

On Fri, Dec 12, 2014 at 10:50:17PM +0100, Florian Westphal wrote:

> > What do we want sendmsg(fd, &msg, 0) to do when fd is AF_NETLINK socket
> > that had setsockopt(fd, SOL_NETLINK, NETLINK_TX_RING, ...) successfully done
> > to it and msg.msg_iovlen is 0?  Userland ABI question
> 
> IIRC userland, after filling txring with at least one new netlink
> message, needs to call this to tell kernel to start processing the
> messages in the tx ring.

AFAICS, the suggested way to initiate transmission is sendto(fd, NULL, 0, ...),
not sendmsg(2).  _That_ is equivalent to msg.msg_iovlen = 1, msg.msg_iov =
&(struct iovec){NULL, 0} (and that explains the origin of the odd check,
I suppose).  The case where it goes random is different - msg.msg_iovlen = 0,
msg.msg_iov - anything, will be ignored by sys_sendmsg().

  reply	other threads:[~2014-12-12 22:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-28  6:23 [WTF?] random test in netlink_sendmsg() Al Viro
2014-12-12 20:34 ` David Miller
2014-12-12 21:32   ` Al Viro
2014-12-12 21:50     ` Florian Westphal
2014-12-12 22:14       ` Al Viro [this message]
2014-12-12 22:20         ` Florian Westphal
2014-12-13  1:07     ` David Miller
2014-12-13  1:54       ` Al Viro
2014-12-13  2:33         ` David Miller
2014-12-13  3:25           ` Al Viro
2014-12-13  4:51             ` Al Viro
2014-12-14  4:38               ` David Miller

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=20141212221410.GF22149@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=davem@davemloft.net \
    --cc=fw@strlen.de \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.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.