From: David Miller <davem@davemloft.net>
To: daniel@iogearbox.net
Cc: chamaken@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH net] netlink, mmap: don't walk rx ring on poll if receive queue non-empty
Date: Wed, 09 Sep 2015 21:43:42 -0700 (PDT) [thread overview]
Message-ID: <20150909.214342.191904339315763716.davem@davemloft.net> (raw)
In-Reply-To: <5e369c9aa5889383aece50a6b5c22256b19ab334.1441839128.git.daniel@iogearbox.net>
From: Daniel Borkmann <daniel@iogearbox.net>
Date: Thu, 10 Sep 2015 01:20:46 +0200
> In case of netlink mmap, there can be situations where received frames
> have to be placed into the normal receive queue. The ring buffer indicates
> this through NL_MMAP_STATUS_COPY, so the user is asked to pick them up
> via recvmsg(2) syscall, and to put the slot back to NL_MMAP_STATUS_UNUSED.
>
> Commit 0ef707700f1c ("netlink: rx mmap: fix POLLIN condition") changed
> polling, so that we walk in the worst case the whole ring through the
> new netlink_has_valid_frame(), for example, when the ring would have no
> NL_MMAP_STATUS_VALID, but at least one NL_MMAP_STATUS_COPY frame.
>
> Since we do a datagram_poll() already earlier to pick up a mask that could
> possibly contain POLLIN | POLLRDNORM already (due to NL_MMAP_STATUS_COPY),
> we can skip checking the rx ring entirely.
>
> In case the kernel is compiled with !CONFIG_NETLINK_MMAP, then all this is
> irrelevant anyway as netlink_poll() is just defined as datagram_poll().
>
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Applied.
prev parent reply other threads:[~2015-09-10 4:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-09 23:20 [PATCH net] netlink, mmap: don't walk rx ring on poll if receive queue non-empty Daniel Borkmann
2015-09-10 4:43 ` David Miller [this message]
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=20150909.214342.191904339315763716.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=chamaken@gmail.com \
--cc=daniel@iogearbox.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).