NOP count in flight of client generated NOP-Outs

This patch adds the abilitiy to libiscsi to count the number
of consecutive outstanding NOPs.

With this ability its fairly easy to implement a keepalive
check with NOPs in your application.

Periodically (e.g. every 5 secs) create a NOP-Out with:

iscsi_nop_out_async(iscsi, NULL, NULL, 0, NULL);

At that time check the number of consecutive missing NOP-Ins
with

iscsi_get_nops_in_flight(iscsi) > N.

Where N is the number of missing NOP-Ins you will allow.
Please note that it is legitime for the Target to ignore
a NOP if the load is very high as those packet are mark
as IMMEDIATE.

Signed-off-by: Peter Lieven <pl@kamp.de>
This commit is contained in:
Peter Lieven
2012-12-06 10:03:01 +01:00
parent d1344a666b
commit 237729545a
5 changed files with 26 additions and 1 deletions

View File

@@ -95,6 +95,7 @@ struct iscsi_context {
int is_loggedin;
int is_reconnecting;
int bind_interfaces_cnt;
int nops_in_flight;
int chap_a;
int chap_i;
@@ -122,7 +123,7 @@ struct iscsi_context {
int no_auto_reconnect;
int reconnect_deferred;
int reconnect_max_retries;
int log_level;
iscsi_log_fn log_fn;