From: Ronnie Sahlberg <ronniesahlberg@gmail.com>
To: qemu-devel@nongnu.org, kwolf@redhat.com, pbonzini@redhat.com
Subject: [Qemu-devel] [PATCH 0/1] ISCSI: Dont call libiscsi for POLLIN if there are no bytes readable from the socket
Date: Sat, 12 May 2012 08:04:36 +1000 [thread overview]
Message-ID: <1336773877-20725-1-git-send-email-ronniesahlberg@gmail.com> (raw)
Kevin, List, Paolo
Updated patch based on Paolo's suggestion to do these checks in iscsi_process_read instead.
Additionally, since this means we can no remain setting a fd-is-readable event unconditionally we can handle target initiated NOPs better.
For example the case when the initiator is idle for a long time and has no i/o in flight a target may at this situation send NOPs to the initiator to ping that it is still alive, as an alternative to TCP-Keepalives.
Unconditionally setting fd-is-readable event means that we will trigger on such target driven NOPs and can respond to them even if the initiator itself is idle.
When iscsi_process_read is invoked we check if there is a socket error.
If there is we pass POLLIN down to libiscsi and let it handle it, and possibly also try to reconnect and recover.
If not, we check if there are any available bytes to read using ioctl(...FIONREAD...) and if there were no bytes avaialble, we assume that this was probably just a false invocation of the read event so we do nothing and just return.
If there were bytes available to read from the socket, we pass POLLIN down into libiscsi as usual and let it read and process them.
regards
ronnie sahlberg
next reply other threads:[~2012-05-11 22:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-11 22:04 Ronnie Sahlberg [this message]
2012-05-11 22:04 ` [Qemu-devel] [PATCH] ISCSI: iscsi_process_read callback for when the iscsi socket becomes readable may be invoked by qemu after the fd-is-readable event has cleared Ronnie Sahlberg
2012-05-14 15:30 ` Paolo Bonzini
2012-05-15 10:44 ` ronnie sahlberg
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=1336773877-20725-1-git-send-email-ronniesahlberg@gmail.com \
--to=ronniesahlberg@gmail.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.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).