qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/1] ISCSI: Dont call libiscsi for POLLIN if there are no bytes readable from the socket
@ 2012-05-11 22:04 Ronnie Sahlberg
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Ronnie Sahlberg @ 2012-05-11 22:04 UTC (permalink / raw)
  To: qemu-devel, kwolf, pbonzini


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-05-15 10:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-11 22:04 [Qemu-devel] [PATCH 0/1] ISCSI: Dont call libiscsi for POLLIN if there are no bytes readable from the socket Ronnie Sahlberg
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

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).