1 From: Hannes Reinecke <hare@suse.de>
2 Date: Tue, 18 Aug 2009 10:52:27 +0200
3 Subject: iscsi_tcp: Use 'last_recv' to track xmits
5 Patch-Mainline: Not applicable
7 A successful transmit also indicates that the
8 target is alive, so can use the 'last_recv'
9 count to track that, too.
11 Signed-off-by: Hannes Reinecke <hare@suse.de>
13 drivers/scsi/iscsi_tcp.c | 15 +++++++++++++--
14 1 files changed, 13 insertions(+), 2 deletions(-)
16 diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
17 index a648919..2bbfd2b 100644
18 --- a/drivers/scsi/iscsi_tcp.c
19 +++ b/drivers/scsi/iscsi_tcp.c
20 @@ -1140,14 +1140,25 @@ iscsi_xmit(struct iscsi_conn *conn)
21 * is getting stopped. libiscsi will know so propogate err
22 * for it to do the right thing.
25 + if (rc == -EAGAIN) {
27 + conn->txdata_octets += consumed;
28 + conn->last_recv = jiffies;
34 rc = ISCSI_ERR_CONN_FAILED;
40 + * Hijack the 'last_recv' for counting xmits, too.
41 + * This avoids transport timeouts when running
42 + * write-intensive loads.
44 + conn->last_recv = jiffies;
47 if (segment->total_copied >= segment->total_size) {