linux/drivers/scsi/iscsi_tcp.c
<<
>>
Prefs
   1/*
   2 * iSCSI Initiator over TCP/IP Data-Path
   3 *
   4 * Copyright (C) 2004 Dmitry Yusupov
   5 * Copyright (C) 2004 Alex Aizman
   6 * Copyright (C) 2005 - 2006 Mike Christie
   7 * Copyright (C) 2006 Red Hat, Inc.  All rights reserved.
   8 * maintained by open-iscsi@googlegroups.com
   9 *
  10 * This program is free software; you can redistribute it and/or modify
  11 * it under the terms of the GNU General Public License as published
  12 * by the Free Software Foundation; either version 2 of the License, or
  13 * (at your option) any later version.
  14 *
  15 * This program is distributed in the hope that it will be useful, but
  16 * WITHOUT ANY WARRANTY; without even the implied warranty of
  17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18 * General Public License for more details.
  19 *
  20 * See the file COPYING included with this distribution for more details.
  21 *
  22 * Credits:
  23 *      Christoph Hellwig
  24 *      FUJITA Tomonori
  25 *      Arne Redlich
  26 *      Zhenyu Wang
  27 */
  28
  29#include <linux/types.h>
  30#include <linux/inet.h>
  31#include <linux/slab.h>
  32#include <linux/file.h>
  33#include <linux/blkdev.h>
  34#include <linux/crypto.h>
  35#include <linux/delay.h>
  36#include <linux/kfifo.h>
  37#include <linux/scatterlist.h>
  38#include <linux/module.h>
  39#include <net/tcp.h>
  40#include <scsi/scsi_cmnd.h>
  41#include <scsi/scsi_device.h>
  42#include <scsi/scsi_host.h>
  43#include <scsi/scsi.h>
  44#include <scsi/scsi_transport_iscsi.h>
  45
  46#include "iscsi_tcp.h"
  47
  48MODULE_AUTHOR("Mike Christie <michaelc@cs.wisc.edu>, "
  49              "Dmitry Yusupov <dmitry_yus@yahoo.com>, "
  50              "Alex Aizman <itn780@yahoo.com>");
  51MODULE_DESCRIPTION("iSCSI/TCP data-path");
  52MODULE_LICENSE("GPL");
  53
  54static struct scsi_transport_template *iscsi_sw_tcp_scsi_transport;
  55static struct scsi_host_template iscsi_sw_tcp_sht;
  56static struct iscsi_transport iscsi_sw_tcp_transport;
  57
  58static unsigned int iscsi_max_lun = ~0;
  59module_param_named(max_lun, iscsi_max_lun, uint, S_IRUGO);
  60
  61static int iscsi_sw_tcp_dbg;
  62module_param_named(debug_iscsi_tcp, iscsi_sw_tcp_dbg, int,
  63                   S_IRUGO | S_IWUSR);
  64MODULE_PARM_DESC(debug_iscsi_tcp, "Turn on debugging for iscsi_tcp module "
  65                 "Set to 1 to turn on, and zero to turn off. Default is off.");
  66
  67#define ISCSI_SW_TCP_DBG(_conn, dbg_fmt, arg...)                \
  68        do {                                                    \
  69                if (iscsi_sw_tcp_dbg)                           \
  70                        iscsi_conn_printk(KERN_INFO, _conn,     \
  71                                             "%s " dbg_fmt,     \
  72                                             __func__, ##arg);  \
  73        } while (0);
  74
  75
  76/**
  77 * iscsi_sw_tcp_recv - TCP receive in sendfile fashion
  78 * @rd_desc: read descriptor
  79 * @skb: socket buffer
  80 * @offset: offset in skb
  81 * @len: skb->len - offset
  82 */
  83static int iscsi_sw_tcp_recv(read_descriptor_t *rd_desc, struct sk_buff *skb,
  84                             unsigned int offset, size_t len)
  85{
  86        struct iscsi_conn *conn = rd_desc->arg.data;
  87        unsigned int consumed, total_consumed = 0;
  88        int status;
  89
  90        ISCSI_SW_TCP_DBG(conn, "in %d bytes\n", skb->len - offset);
  91
  92        do {
  93                status = 0;
  94                consumed = iscsi_tcp_recv_skb(conn, skb, offset, 0, &status);
  95                offset += consumed;
  96                total_consumed += consumed;
  97        } while (consumed != 0 && status != ISCSI_TCP_SKB_DONE);
  98
  99        ISCSI_SW_TCP_DBG(conn, "read %d bytes status %d\n",
 100                         skb->len - offset, status);
 101        return total_consumed;
 102}
 103
 104/**
 105 * iscsi_sw_sk_state_check - check socket state
 106 * @sk: socket
 107 *
 108 * If the socket is in CLOSE or CLOSE_WAIT we should
 109 * not close the connection if there is still some
 110 * data pending.
 111 *
 112 * Must be called with sk_callback_lock.
 113 */
 114static inline int iscsi_sw_sk_state_check(struct sock *sk)
 115{
 116        struct iscsi_conn *conn = sk->sk_user_data;
 117
 118        if ((sk->sk_state == TCP_CLOSE_WAIT || sk->sk_state == TCP_CLOSE) &&
 119            !atomic_read(&sk->sk_rmem_alloc)) {
 120                ISCSI_SW_TCP_DBG(conn, "TCP_CLOSE|TCP_CLOSE_WAIT\n");
 121                iscsi_conn_failure(conn, ISCSI_ERR_TCP_CONN_CLOSE);
 122                return -ECONNRESET;
 123        }
 124        return 0;
 125}
 126
 127static void iscsi_sw_tcp_data_ready(struct sock *sk, int flag)
 128{
 129        struct iscsi_conn *conn;
 130        struct iscsi_tcp_conn *tcp_conn;
 131        read_descriptor_t rd_desc;
 132
 133        read_lock(&sk->sk_callback_lock);
 134        conn = sk->sk_user_data;
 135        if (!conn) {
 136                read_unlock(&sk->sk_callback_lock);
 137                return;
 138        }
 139        tcp_conn = conn->dd_data;
 140
 141        /*
 142         * Use rd_desc to pass 'conn' to iscsi_tcp_recv.
 143         * We set count to 1 because we want the network layer to
 144         * hand us all the skbs that are available. iscsi_tcp_recv
 145         * handled pdus that cross buffers or pdus that still need data.
 146         */
 147        rd_desc.arg.data = conn;
 148        rd_desc.count = 1;
 149        tcp_read_sock(sk, &rd_desc, iscsi_sw_tcp_recv);
 150
 151        iscsi_sw_sk_state_check(sk);
 152
 153        /* If we had to (atomically) map a highmem page,
 154         * unmap it now. */
 155        iscsi_tcp_segment_unmap(&tcp_conn->in.segment);
 156        read_unlock(&sk->sk_callback_lock);
 157}
 158
 159static void iscsi_sw_tcp_state_change(struct sock *sk)
 160{
 161        struct iscsi_tcp_conn *tcp_conn;
 162        struct iscsi_sw_tcp_conn *tcp_sw_conn;
 163        struct iscsi_conn *conn;
 164        struct iscsi_session *session;
 165        void (*old_state_change)(struct sock *);
 166
 167        read_lock(&sk->sk_callback_lock);
 168        conn = sk->sk_user_data;
 169        if (!conn) {
 170                read_unlock(&sk->sk_callback_lock);
 171                return;
 172        }
 173        session = conn->session;
 174
 175        iscsi_sw_sk_state_check(sk);
 176
 177        tcp_conn = conn->dd_data;
 178        tcp_sw_conn = tcp_conn->dd_data;
 179        old_state_change = tcp_sw_conn->old_state_change;
 180
 181        read_unlock(&sk->sk_callback_lock);
 182
 183        old_state_change(sk);
 184}
 185
 186/**
 187 * iscsi_write_space - Called when more output buffer space is available
 188 * @sk: socket space is available for
 189 **/
 190static void iscsi_sw_tcp_write_space(struct sock *sk)
 191{
 192        struct iscsi_conn *conn;
 193        struct iscsi_tcp_conn *tcp_conn;
 194        struct iscsi_sw_tcp_conn *tcp_sw_conn;
 195        void (*old_write_space)(struct sock *);
 196
 197        read_lock_bh(&sk->sk_callback_lock);
 198        conn = sk->sk_user_data;
 199        if (!conn) {
 200                read_unlock_bh(&sk->sk_callback_lock);
 201                return;
 202        }
 203
 204        tcp_conn = conn->dd_data;
 205        tcp_sw_conn = tcp_conn->dd_data;
 206        old_write_space = tcp_sw_conn->old_write_space;
 207        read_unlock_bh(&sk->sk_callback_lock);
 208
 209        old_write_space(sk);
 210
 211        ISCSI_SW_TCP_DBG(conn, "iscsi_write_space\n");
 212        iscsi_conn_queue_work(conn);
 213}
 214
 215static void iscsi_sw_tcp_conn_set_callbacks(struct iscsi_conn *conn)
 216{
 217        struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
 218        struct iscsi_sw_tcp_conn *tcp_sw_conn = tcp_conn->dd_data;
 219        struct sock *sk = tcp_sw_conn->sock->sk;
 220
 221        /* assign new callbacks */
 222        write_lock_bh(&sk->sk_callback_lock);
 223        sk->sk_user_data = conn;
 224        tcp_sw_conn->old_data_ready = sk->sk_data_ready;
 225        tcp_sw_conn->old_state_change = sk->sk_state_change;
 226        tcp_sw_conn->old_write_space = sk->sk_write_space;
 227        sk->sk_data_ready = iscsi_sw_tcp_data_ready;
 228        sk->sk_state_change = iscsi_sw_tcp_state_change;
 229        sk->sk_write_space = iscsi_sw_tcp_write_space;
 230        write_unlock_bh(&sk->sk_callback_lock);
 231}
 232
 233static void
 234iscsi_sw_tcp_conn_restore_callbacks(struct iscsi_conn *conn)
 235{
 236        struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
 237        struct iscsi_sw_tcp_conn *tcp_sw_conn = tcp_conn->dd_data;
 238        struct sock *sk = tcp_sw_conn->sock->sk;
 239
 240        /* restore socket callbacks, see also: iscsi_conn_set_callbacks() */
 241        write_lock_bh(&sk->sk_callback_lock);
 242        sk->sk_user_data    = NULL;
 243        sk->sk_data_ready   = tcp_sw_conn->old_data_ready;
 244        sk->sk_state_change = tcp_sw_conn->old_state_change;
 245        sk->sk_write_space  = tcp_sw_conn->old_write_space;
 246        sk->sk_no_check  = 0;
 247        write_unlock_bh(&sk->sk_callback_lock);
 248}
 249
 250/**
 251 * iscsi_sw_tcp_xmit_segment - transmit segment
 252 * @tcp_conn: the iSCSI TCP connection
 253 * @segment: the buffer to transmnit
 254 *
 255 * This function transmits as much of the buffer as
 256 * the network layer will accept, and returns the number of
 257 * bytes transmitted.
 258 *
 259 * If CRC hashing is enabled, the function will compute the
 260 * hash as it goes. When the entire segment has been transmitted,
 261 * it will retrieve the hash value and send it as well.
 262 */
 263static int iscsi_sw_tcp_xmit_segment(struct iscsi_tcp_conn *tcp_conn,
 264                                     struct iscsi_segment *segment)
 265{
 266        struct iscsi_sw_tcp_conn *tcp_sw_conn = tcp_conn->dd_data;
 267        struct socket *sk = tcp_sw_conn->sock;
 268        unsigned int copied = 0;
 269        int r = 0;
 270
 271        while (!iscsi_tcp_segment_done(tcp_conn, segment, 0, r)) {
 272                struct scatterlist *sg;
 273                unsigned int offset, copy;
 274                int flags = 0;
 275
 276                r = 0;
 277                offset = segment->copied;
 278                copy = segment->size - offset;
 279
 280                if (segment->total_copied + segment->size < segment->total_size)
 281                        flags |= MSG_MORE;
 282
 283                /* Use sendpage if we can; else fall back to sendmsg */
 284                if (!segment->data) {
 285                        sg = segment->sg;
 286                        offset += segment->sg_offset + sg->offset;
 287                        r = tcp_sw_conn->sendpage(sk, sg_page(sg), offset,
 288                                                  copy, flags);
 289                } else {
 290                        struct msghdr msg = { .msg_flags = flags };
 291                        struct kvec iov = {
 292                                .iov_base = segment->data + offset,
 293                                .iov_len = copy
 294                        };
 295
 296                        r = kernel_sendmsg(sk, &msg, &iov, 1, copy);
 297                }
 298
 299                if (r < 0) {
 300                        iscsi_tcp_segment_unmap(segment);
 301                        return r;
 302                }
 303                copied += r;
 304        }
 305        return copied;
 306}
 307
 308/**
 309 * iscsi_sw_tcp_xmit - TCP transmit
 310 **/
 311static int iscsi_sw_tcp_xmit(struct iscsi_conn *conn)
 312{
 313        struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
 314        struct iscsi_sw_tcp_conn *tcp_sw_conn = tcp_conn->dd_data;
 315        struct iscsi_segment *segment = &tcp_sw_conn->out.segment;
 316        unsigned int consumed = 0;
 317        int rc = 0;
 318
 319        while (1) {
 320                rc = iscsi_sw_tcp_xmit_segment(tcp_conn, segment);
 321                /*
 322                 * We may not have been able to send data because the conn
 323                 * is getting stopped. libiscsi will know so propagate err
 324                 * for it to do the right thing.
 325                 */
 326                if (rc == -EAGAIN)
 327                        return rc;
 328                else if (rc < 0) {
 329                        rc = ISCSI_ERR_XMIT_FAILED;
 330                        goto error;
 331                } else if (rc == 0)
 332                        break;
 333
 334                consumed += rc;
 335
 336                if (segment->total_copied >= segment->total_size) {
 337                        if (segment->done != NULL) {
 338                                rc = segment->done(tcp_conn, segment);
 339                                if (rc != 0)
 340                                        goto error;
 341                        }
 342                }
 343        }
 344
 345        ISCSI_SW_TCP_DBG(conn, "xmit %d bytes\n", consumed);
 346
 347        conn->txdata_octets += consumed;
 348        return consumed;
 349
 350error:
 351        /* Transmit error. We could initiate error recovery
 352         * here. */
 353        ISCSI_SW_TCP_DBG(conn, "Error sending PDU, errno=%d\n", rc);
 354        iscsi_conn_failure(conn, rc);
 355        return -EIO;
 356}
 357
 358/**
 359 * iscsi_tcp_xmit_qlen - return the number of bytes queued for xmit
 360 */
 361static inline int iscsi_sw_tcp_xmit_qlen(struct iscsi_conn *conn)
 362{
 363        struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
 364        struct iscsi_sw_tcp_conn *tcp_sw_conn = tcp_conn->dd_data;
 365        struct iscsi_segment *segment = &tcp_sw_conn->out.segment;
 366
 367        return segment->total_copied - segment->total_size;
 368}
 369
 370static int iscsi_sw_tcp_pdu_xmit(struct iscsi_task *task)
 371{
 372        struct iscsi_conn *conn = task->conn;
 373        unsigned long pflags = current->flags;
 374        int rc = 0;
 375
 376        current->flags |= PF_MEMALLOC;
 377
 378        while (iscsi_sw_tcp_xmit_qlen(conn)) {
 379                rc = iscsi_sw_tcp_xmit(conn);
 380                if (rc == 0) {
 381                        rc = -EAGAIN;
 382                        break;
 383                }
 384                if (rc < 0)
 385                        break;
 386                rc = 0;
 387        }
 388
 389        tsk_restore_flags(current, pflags, PF_MEMALLOC);
 390        return rc;
 391}
 392
 393/*
 394 * This is called when we're done sending the header.
 395 * Simply copy the data_segment to the send segment, and return.
 396 */
 397static int iscsi_sw_tcp_send_hdr_done(struct iscsi_tcp_conn *tcp_conn,
 398                                      struct iscsi_segment *segment)
 399{
 400        struct iscsi_sw_tcp_conn *tcp_sw_conn = tcp_conn->dd_data;
 401
 402        tcp_sw_conn->out.segment = tcp_sw_conn->out.data_segment;
;
copi40="line" name="L383"> /a>               ISCSI_SW_TCP_DBl403inadata_segment;
 * This is 4id="L40a href="+code=rc" class="srefclass="line" name="L401"> 401
 402         402  f="+code=total_copied" claBl403inadata_segment;
 * Simply copy the4turn 40" id="L295" class="line" nameclass="line" name="L401"> 401
 402         402 +code=total_copied" class="sref">total_cref">tcp_sw_conn->}
total_size 368<4e" name="4309"> 309 */

inline int iscsi_sw, voidpcsi_sw_tcp_xmit_"drivers/scsi/iscscp.c#L2Bl403inadata_segment;
to_ iscsi_4onn *conn)
 312{
 313        struct iscsi_tcp_conn *tcp_connconn/scsi/isc" class="sref">conn-4gt;dd_data;
 314        struct iscsi_sw_tcp_conn *tcs="sref">tcp_connconn5scsi/iscass="sref">tcp_conn-4gt;rc 4href="+co4e=out" class="sref">out<4a>.
 353        ISCSI_SW_TCP_DBGode=iscsi_tcp_conn" class="sref">iscsi_tcp_c"drdgst_drivers/scsi/iscs"drdgst_dr id="?href="+code=rc" class="sref">rc 4h7scsi/isc>        unsigned int t53         :53        cref">tcp_sw_conn-> 317  4     4nt rc 4 0;
errClearpan>
in by59" id="L259" class="line" name="L259"> 2594s/scsi/is4si_tcp.c#L319" id="L319"4class42rn the number of bytes queueeeeeeeee**


tcp_conniscsi_tcp_cmeme = iscsi_segment *segment  =  34142 href="+code=EAGAIN"t>toofef="+code=inline" class="srefsi_tcp.c#L398" id="L398" class="line" n)cref">tcp_sw_conn->   4             * We may no4 have42"L332"> 332                        br4ment">   4             * is gettin4 stop424 id="L318" ce=error" class="sref">errIfp.c#L39 digesta
 and return.
  4     4        * for it to do the right thin* plac259" ndigesta
ners/scsint"iscsi_t.
 2594sref="+co4s="line" name="L325"> 324<42gment to the send segment, aght thin* sur259"at both>
 2594s7scsi/isce=rc" class="sref">rc 3954327                 4     42 class="comment"> * bytes trght thin*d return.
            /a>ode=iscsi_tcp_conn" class="sref">iscsi_tcp_c"drdgst_drivers/scsi/iscs"drdgst_dr id=iscsi_tcp.c#L380" id="L380" class="line4>rc =4ISne" name="L312"> 312{dgst_.c#L39href="drivers/scsi/iscsi_dgst_.c#L39cp.c#    struct iscsi_segment *tsk_restore"drivers/scsi/iscscp.c#L2Bfsi_sw_tcp_xmit_"dr"drivers/scsi/iscs"dr"dr    t.
 3304/a>                     4  got4 t53f">tsk_restore"drivers/scsi/iscscp.c#L2 class="sref">iov_"dr"drivers/scsi/iscs"dr"dr     ref">tcp_sw_conn-> 431                } 4lse i4 (iov_"dr"drivers/scsi/iscs"dr"dr    > 347        
tcs="sref">tcp_connconn 342                }
 343     4f="+code=4onsumed" class="sref">co4sumed435 id="L318" ce=error" class="sref">errRememi/is.c#L39 po
ne39 id="lae39,>

segment->done4/a> !4 iscsi_segment *segment "drivers/scsi/iscscp.c#L2 347        tcs="sref">tcp_connconntcp_conn 368<4339  4                        4    i4 (iscsi_segment *segment cp_segment_done" class="sref">iscsief">tsk_restore"drivers/scsi/iscscp.c#L2Bfsi_sw_tcp_xmit_"dr"drivers/scsi/iscs"dr"dr    t.
ISne" name="L312"> 312
tcs="sref">tcp_connconn 342                }
 332                        br4ef="drive4s/scsi/iscsi_tcp.c#L343"4id="L44L393"> 393 392
 395,4 2594>);
 395txdata_octets +4  * bytes tr*d return.
 348        retur4 ;
inline int iscsi_sw, f="+code=inline" classscate39lisment_done" class=cate39lisme" name="L398"> 398sendpage(
4350segmentsegment = segment->/* Tr4nsmit45 segment<"drivers/scsi/iscs"dr           struct  354<4pan clcsi_tcp.c#L380" id="L380" class="line4rror send4ng PDU, errno=%d\n&q4ot;dd_data{
 313        struct iscsi_tcp_conn *tcp_connconn(con45ref="+code=dd_data" class="sref">dd_data;
 314        struct iscsi_sw_tcp_conn *tcs="sref">tcp_connconn 355    4   re456ef="+code=dd_data" class="sref">ddef="_desLOC);
tcs="sref">tcp_connconnsegmenttcs="sref">tcp_connconnrc 4tcp.c#L354" id="L358" class="line"4name=45" id="L388" class="line" nam* here. */
 353        ISCSI_SW_TCP_DBG = segment<"drivers/scsi/iscs"dr    nt" class="sref">segment-> * iscsi_tcp_xmit_qle4 - re46(iscsi_tcp_co_codgst_drivers/scsi/iscso_codgst_dr id="?href="+code=rc" class="sref">rc 4tcp.c#L364" id="L360" class="line"4name=46 :53        cref">tcp_sw_conn->iscsi_4onn 391<4>)
errMrk  sur259"e w_coive matches w"at 2" cl/spar return.
conn-4gt;
tcp_conn-4gt;segmentiscsi_segment *segment "drivers/scsi/iscscp.c#L2s="sref">iscsi_tcp_coivegt"_segment" classoivegt"e=segf">tcs="sref">tcp_connconnout<4a>.                  asref"paddass="line" name="asref"paddascp.c#L353" id="L353"L397specrivers/scsi/iscsi_tL397specrivee=se)cref">tcp_sw_conn->PF_MEMALLOC<4t" class=4sref">segment->iscsi_tcp_co_codgst_drivers/scsi/iscso_codgst_dr id=       struct connx_ef="_segment" class=x_ef="ss=" hr    struct iscsi_segment *tcp_sw_conn->tcp_sw_conn->iscsi_4askPF_MEMAcsi/issi_tcp._seek_asref">sendpageiscsi_segment *segment  = tcp_sw_conn->conasref">sendpage(segment = segment<"drivers/scsi/iscs"dr    nt" class="sref">segment->tas4-47"L382"> 382      class="sref"e=conn" class="sref">con      if (segmenttcp_sw_conn->current<4a>-&g4; 342                }
 374  4     4nt rc 4 0;
rc 4 >;
flags |= inline int iscsi_sw, voidpcsi_sw_tcp_xmit_"+code=tcp_sw_conn" ss="srent" class="sref">segment->tcp_connlass="sref">cona>to_ iscsi_sw_tcp_xmit_ql4n47ref="+code=segment" class="sref">segmentiscsi_sw_tcp_4mit 399{
 313        struct iscsi_tcp_conn *tcp_connconn 380             4  if 4dd_data;
 314        struct iscsi_sw_tcp_conn *tcs="sref">tcp_connconnrc = -48 id="L371" class="line" name="L371"ef="_desLOC);
tcs="sref">tcp_connconnsegmenttcs="sref">tcp_connconn 343     4 name="L344"> 384             4  if 48ref="+code=dd"sref">segment<* here. */
 353        ISCSI_SW_TCP_DBG<"drivers/scsi/iscs"dr    nestruct iscsi_tcp_co_codgst_drivers/scsi/iscso_codgst_dr id="?href="+code=rc" class="sref">rc 4i_tcp.c#L485" id="L385" class="lin4" nam4="L385"> 385      >tcp_connl         :53        cref">tcp_sw_conn-> 386      4     48de=PF_MEMALLOC" class="sref">PF_MEMALLOC<4ef="drive4s/scsi/iscsi_tcp.c#L387"4id="L48errMrk  sur259"e w_coive matches w"at 2" cl/spar return.
 358
pflags, iscsi_segment *segment "drivers/scsi/iscscp.c#L2s="sref">iscsi_tcp_coivegt"_segment" classoivegt"e=segf">tcs="sref">tcp_connconn 390 4     49ef="+code=segef">iscsi_tcp_cWARN_O381" class="lineWARN_O3cp.c#L353" id="L353"asref"paddass="line" name="asref"paddascp.c#L353" id="L353""drivers/scsi/iscs"dr     >                  asref"paddass="line" name="asref"paddascp.c#L353" id="L353"L397specrivers/scsi/iscsi_tL397specrivee=se)cr">tcs="sref">tcp_connconn 391<4a>}
            /a>ode=iscsi_tcp_conn" class="sref">iscsi_tcp_co_codgst_drivers/scsi/iscso_codgst_dr id=       struct iscsi_segment *tcp_sw_conn-> * This is 4alled49t rc 4class="co4ment"> * Simply copy the4data_49" id="L375" class="line" nam="srefsi_tcp._scsi_    a9href="drivers/scsi/issi_tcp._scsi_    a9cp.c#    struct iscsi_segment *segment  = tcp_sw_conn->t5L375" class="line" nam"+code=tcp_sw_conn" ss="srenSCSI_SW_TCP_DBG<"drivers/scsi/iscs"dr    nestruct segmenttcp_sw_conn->iscsi_tcp_conn4*total_sizeiscsi_segment * 368<5>)
 369

iscsi_ssef">tcp_sw_conn->tcp_conn-5gt;Igment" class="sref">segment = segmentconnout. 312{
 372        struct iscsi_conn *conn = copi50="line" name=ass="sref">segment 349/scsi/iscsi_tcp.c#L386" id="L386" clas5s5scsi/is5ss="comment"> * This is 5id="L50t rc 5s6scsi/is5sent"> * Simply copy the5turn 50" id="L375" class="line" nam="srefs

 353372        struct tcp_sw_conn->PF_MEMALLOC<5a>}
segmentiscsi_segment 309tcp_sw_conn->segment< struct );
iscsi_5onniov_i_tcp.c#L397" id="    a9"w_conpreiivers/scsi/iscsi_tcp.c#L397" id="    a9"w_conpreia hreL353" id="L353" class="line" name="L353"> 353372        struct conn-5gt;);
 372       sLlas"+code=segment" clsLlas"+ccp.c#L353" id="L353"+struct );
tcp_conn-5gt;rc 5href="+co5e=out" class="sref">out<5a>. 385                     er name="L349"> 349ass="sref">iov_i_tcp.c#L397" id="w_conpreiivers/scsi/iscsi_tcp.c#L397" id="w_conpreia hreL353" id="L353" class="line" name="L353"> 353372       sdbOC);
 *segment sglOC);
tcp_sw_conn->t555555555555555555555555553372       sdbOC);
 *segment nenttsk_restore_flagnentt3"> 353372       base = segment-> 317  5     51f="+code=tcp_conn" class="sref">tcp_conn       /au"line" name="L389"au"li_sw scsi/iscsi_tcp.c#L386" id="L386" clas5e9}
total_sizetcp_sw_conn->tcp_conn 349 35152 href="+code=EAGAIN"dt=error" class="sref">errgota
nvalid code=s/ive *d return.
   5             * We may no5 have52"L382"> 382      "+code=rc" class="sref">rc);
   5             * is gettin5 stop524 id="L318" ctotal_size" class="sref">total_size  5     52ref="+code=ddlass="l/scsi/iscsi_tcp.c#L386" id="L386" clas5sref="+co5s="line" name="L325"> 325<52gmenttotal_size" class="sref">total_sizercPF_MEMALLOC<5e="L327">5327                 5     52 clas"L369" class="line" name="L369"> 369
);
 369
iscsi_ssde=inline" classucla8_ segmentrc =5 399{ 370static int { 370code=iscsi_sw_tcp_pdu_a>{ 370static int fa>{ 370code="> 372        struct tcs="sref">tcp_connconn 3305/a>                     5  got53ref="+code=dd_data" class="sref">dd_data<5="L331"> 531                } 5lse i5 (toofeiscsi_sw_tcp_pdu_a>{ 370static int fa>{ 370code scsi/iscsi_tcp.c#L386" id="L386" clas5i_tcp.c#L532" id="L332" class="lin5" nam53=data_segment" class="sref"> struct  369
tcs="sref">tcp_connconnco5sumed535 id=total_size" class="sref">total_size;
segment<5a7scsi/is5ef">segment-> 396 312{
segment<5a="L327">5=done" class="sref">done5/a> !5 {_creatra href="+code=inline" class="srefilssegment->tcp_conn       ucla32_ segmentdd_data{
 312{
{codescsi/iscsi_tcp.c#L386" id="L386" clas5/_tcp.c#L5scsi_tcp.c#L342" id="L345" cla54 id="L312" class="line" name="L312"> 312{
 313     scsi/iscsi_tcp.c#L386" id="L386" clas5/k;
dd_data;
 314        struct rc 5;xmit #d bytes\n",5{code2">ass="sref">iov_i_tcp.397"/a>{_sassiivers/scsi/iscsi_tcp.397"/a>{_sassia hreL353" id="L353" lstoofeiscsi_sw_tcp_pdu_a>{name="L314"> 314        struct segment->);
t55555555555555553372       /a>{_idxrs/scsi/iscsi_t/a>{_idx" id scsi/iscsi_tcp.c#L386" id="L386" clas5/="L327">5ref">txdata_octets +5 segment{code       struct  348        retur5 segment<      if (tcs="sref">tcp_connconn;
 372       /ls<372" class="line" nals{codei_conn" class="sref"ef="+code=tcp_sw_conn" class="sref">tcs="sref">tcp_connconn5350iscsi_tcp_css="line" name="L313"> 313        struct iscsi_tcp_conn *tcp_connconn/* Tr5nsmit55( 314        struct iscsi_sw_tcp_conn *tcs="sref">tcp_connconn 355<55"L332"> 332                        br5rror send5ng PDU, errno=%d\n&q5ot;        e" name="L314"> 314        struct  * 402 +fm_segment" class=fm       struct IS_t.
con55ref="+code=dddddddddddddddddddddddddddddddddddddddddddddddstruct  355    5   re55" id="L375" class="line" nam e" name="L314"> 314        struct  * 402 flagtsk_restore_flagflagt       /scsi/iscsi_tcp.c#L386" id="L386" clas5s);
 314        struct  * 402 +fm_segment" class=fm    )       struct  314  freeme="L"sref">tcs="sref">tcp_connconn 368<5ss="comme5t"> * iscsi_tcp_xmit_qle5 - re56( 314        struct  * 402 +fm_segment" class=fm       struct IS_t.
iscsi_5onn 401
 402 flagtsk_restore_flagflagt       /scsi/iscsi_tcp.c#L386" id="L386" clas5>)
            IS_ERR>
 314        struct  * 402 +fm_segment" class=fm    )       struct conn-5gt;tcs="sref">tcp_connconntcp_conn-5gt;segment<_sw_tcp_conn" class="sref">iscsi_sw_tcp_conn *iscsi_segment *tcs="sref">tcp_connconnout<5a>.segment<5a>;
{codescsi/iscsi_tcp.c#L386" id="L386" clas5t" class=5sref">segment->rc 5>;
rc 5a>}
 314        struct  * 402 +fm_segment" class=fm    )scsi/iscsi_tcp.c#L386" id="L386" clas5acp.c#L365ask" class="sref">iscsi_5ask 314  freeme="L"sre:href="+code=rc" class="sref">rc 5ae=iscsi_5="drivers/scsi/iscsi_tcp5c#L3757" id="L401" class="line" namrs/scsi/is_p hrt0static int 
 3href="+code=rc" class="sref">rc 5a)
tas5-57"L382"> 382      class="sreL        href="+code=rc" class="sref">rc 5acode=con5t" class="sref">current<5a>-&g57" id="L333" class="liclass="sreL        href="+code=rc" class="sref">rc 5a_conn" c5" name="L374"> 374  5     57ref="+code=ddddddddddddddddddddL        href="+code=rc" class="sref">rc 5as="line"5f="drivers/scsi/iscsi_tc5.c#L357"L385"> 385      >tcp_conndL        )scsi/iscsi_tcp.c#L386" id="L386" clas5a>;
flags |= {_teardow href="drivers/scsi/iscsi_tcp._teardow a hreL353" id="L353" ls<372" class="line" nals{code scsi/iscsi_tcp.c#L386" id="L386" clas5a" class=5f="drivers/scsi/iscsi_tc5.c#L357f="+code=tcp_lass="l"sref">segment<      if (tcs="sref">tcp_connconniscsi_sw_tcp_xmit_ql5n57ref="total_size" class="sref">total_sizeiscsi_sw_tcp_5mittcp_sw_conn-> 380             5  if 5dd_data;
 314  _data;
rc = -58 *conn 312iscsi_tcp_csessio{
tcs="sref">tcp_connconndd_data{
 313        struct iscsi_tcp_conn *tcp_connconn 384             5  if 58ref="+code=dd_data" class="sref">dd_data;
 314        struct iscsi_sw_tcp_conn *tcs="sref">tcp_connconnddsock =  314        struct  * = tcs="sref">tcp_connconn;
 386      5     58de=PF_MEMALLOC" class="sref">PF_MEMALLOC<5ef="drive5s/scsi/iscsi_tcp.c#L387"5id="L58segment = tcs="sref">tcp_connconnpflags, tcp_sw_conn-> 390 5     59ef="+code=segef">iscsi_tcp_csock_holss="line" name="sock_holsa hreL353" id="L353"socka> = {_restoremeallbacktsk_restore_flagrs/scsc#L397"/a>{_restoremeallbackta hreL353" id="L353" 72" class="line" name="L37 scsi/iscsi_tcp.c#L386" id="L386" clas5c_tcp.c#L5f="drivers/scsi/iscsi_tc5.c#L359=data_segment" class="sref">sock_p+code=segment" clsock_p+ca hreL353" id="L353"socka> =  343     5> * This is 5alled59ref="+code=dd"sref">segment * =  * Simply copy the5data_59" id="L375" class="line" nam_sw_name="L314"> 314        struct  * = tcs="sref">tcp_connconn * = iscsi_tcp_conn5* = iscsi_segment *total_size)
tcp_sw_conn->tcp_conn-6gt;dd_data;
{_destroysk_restore_flagrs/scsc#L397"/a>{_destroya href="+code=inline" class="srefils{
{code       struct connout. 312{
 372       /ls<372" class="line" nals{codei_conn" class="sref"ef="+code=tcp_sw_conn" class="sref">tcs="sref">tcp_connconncopi60ref="+code=dd_data" class="sref">dd_data{
 313        struct iscsi_tcp_conn *tcp_connconn * This is 6id="L60ref="+code=dd_data" class="sref">dd_data;
 314        struct iscsi_sw_tcp_conn *tcs="sref">tcp_connconn * Simply copy the6turn 60ref="+code=segment" class="sref">segment<6e7scsi/is6s id="L396" class="line"6c#L30607 id="L401" class="line" namrs/scs/a>;
 314  _data;
}
rc 6a9}
iscsi_segment            +e" name="L314"> 314        struct  * 402 +fm_segment" class=fm    )href="+code=rc" class="sref">rc 6e" name="6309"> 309 314        struct  * 402 +fm_segment" class=fm    )scsi/iscsi_tcp.c#L386" id="L386" clas6cp.c#L3106 id="L310" class="line" 6ame="61a href="+code383iscsi_segment * 402 +fm_segment" class=fm    )href="+code=rc" class="sref">rc 6e>;
iscsi_6onniov_3ryptoafreemef="_segment" class"ryptoafreemef="cp.c#L353" id="L353"+e" name="L314"> 314        struct  * 402 +fm_segment" class=fm    )scsi/iscsi_tcp.c#L386" id="L386" clas6c=out" cl6="drivers/scsi/iscsi_tcp6c#L3161"L332"> 332                        br6>/scsi/is6" class="sref">conn-6gt;       rs/scs397"/a>{_teardow href="drivers/scsi/iscsi_tcp._teardow a hreL353" id="L353" ls<372" class="line" nals{code scsi/iscsi_tcp.c#L386" id="L386" clas6e5scsi/is6ass="sref">tcp_conn-6gt;total_sizeout<6a>.segment<6h7scsi/is6>        unsigned int  396dd_data;
{_stoiivers/scsi/iscsi_tcp.c#L397"/a>{_stoia href="+code=inline" class="srefils{
{code, class="line" name="flag314"> 314  flag    )href="+code=rc" class="sref">rc 6e>}
 317  6     61f="+chref="+code=conn" class="sref">conn 312{
 372       /ls<372" class="line" nals{codei_conn" class="sref"ef="+code=tcp_sw_conn" class="sref">tcs="sref">tcp_connconn 399{
 313        struct iscsi_tcp_conn *tcp_connconntcp_conndd_data;
 314        struct iscsi_sw_tcp_conn *tcs="sref">tcp_connconn;
 36162 id="L371" class="line" name="L371"sock =  314        struct  * = tcs="sref">tcp_connconn   6             * We may no6 have62"L332"> 332                        br6ment">   6             * is gettin6 stop624 id="L318" ct=error" class="sref">errus   pace may have goofed up ans/not bouns/us *d return.
  6     62ref="+code=dd383segment =  326<62"L385"> 385      lass="f">tcs="sref">tcp_connconnrcPF_MEMALLOC<6e="L327">6327                 6     62 =  * 34sk_er t                 else6if (<629a href="+codtruct  = rc =6tcp_sw_conn-> 3306/a>                     6  got631 id="L318" ct=error" class="sref">errstoi xmit side *d return.
 631                } 6lse i6 ( 332                        br6ak;
errstoi recv side ans/release sock
co6sumed63ref="+code=dd"sref">segment;
 314  _data;
;
segment<6a7scsi/is6ef">segment->{_stoiivers/scsi/iscsi_tcp./a>{_stoia hrep.c#L372" id="L3ls<372" class="line" nals{code, s="line" name="flag314"> 314  flag    )scsi/iscsi_tcp.c#L386" id="L386" clas6a="L327">6=done" class="sref">done6/a> !63code=total_size" class="sref">total_sizetcp_conn 368<6339  6                        6    i64" id="L369" claL368" class="line" name="L368"> 368<6330"> 3306                        6  got64{_binss="line" name="asref"c#L397"/a>{_binsa href="+code=inline" class="srefilssegment-> 312{
{code, p.c#L372" id="Lucla64_ segment-> 382      class="class="line" name="L3_leadscs
conndd_data *tcs="sref">tcp_connconn,6dd> 312{
 372       /ls<372" class="line" nals{codei_conn" class="sref"ef="+code=tcp_sw_conn" class="sref">tcs="sref">tcp_connconn);
 399{
 313        struct iscsi_tcp_conn *tcp_connconn6ref">txdata_octets +6 dd_data;
 314        struct iscsi_sw_tcp_conn *tcs="sref">tcp_connconn 348        retur6  = tcs="sref">tcp_connconn;
 = tcs="sref">tcp_connconn 3306lass="line" name="L350">6350segment 349tcs="sref">tcp_connconn/* Tr6nsmit65 id="L391" class="line" name="L391"> 391<6L352" cla6s="line" name="L352"> 356<65=data_segment"=error" class="sref">errlookup for existscsisock
       socka> =  =  349tcs="sref">tcp_connconncon65ref="+code=dd383segment =  355    6   re65"L385"> 385                     i_tcp./a>{_p hrt0static int 
 3href="+code=rc" class="sref">rc 6s);
t5555555555L        sde=inline" classer name="L349"> 349tcs="sref">tcp_connconn6f="drivers/scsi/iscsi_tc6.c#L365f="+code=tcp_conn" cl"+code=rc" class="sref">EXIST);
tcs="sref">tcp_connconntotal_size * iscsi_tcp_xmit_qle6 - re66" id=ef">tcp_sw_conn->iscsi_tcp_cer name="L349"> 349ass="sref">iov_i_tcp./a>{_binss="line" name="asref"/a>{_binsa hrep.c#L372" id="L3ls{coden> 372       L3_leadscs
tcs="sref">tcp_connconniscsi_6onn 349tcs="sref">tcp_connconn 382      gotoclass="line" namfreemsock = tcs="sref">tcp_connconnconn-6gt; 343     6p_conn" c6ass="sref">tcp_conn-6gt;segment * = out<6a>.errbins irs/s "L35ection ans/sock
 314        struct  * =  = tcs="sref">tcp_connconnsegment-> * = ;
 368<6a>}
errsassi Sock
iscsi_6askiscsi_tcp_cska> =  =  = tas6-67=data_segment" class="sref">ska> = HZivers/scsi/iscsHZcodesoe=error" class="sref">errFIXME: mrk  it "L3figurdef= *d return.
current<6a>-&g67ref="+code=dd3372       ska> =  374  6     67ref="+code=dd"sref">segment);
 = segment<6a>;
flags |= {_sas_eallbacktsk_restore_flagrs/scsc#L397"/a>{_sas_eallbackta hreL353" id="L353" 72" class="line" name="L37 scsi/iscsi_tcp.c#L386" id="L386" clas6a" class=6f="drivers/scsi/iscsi_tc6.c#L367 314        struct  * 314        struct  * = iscsi_sw_tcp_xmit_ql6n679er return.
iscsi_sw_tcp_6mit/a>      rrsas recehre "L36e machscsa
nersinitial "L36e return.
 380             6  if 6/a>      rd return.
rc = -68(iscsi_sw scsi/iscsi_tcp.c#L386" id="L386" clas6i_tcp.c#L682" id="L382" class="lin6" nam68 id="L312" cllass="l/scsi/iscsi_tcp.c#L386" id="L386" clas6ers/scsi/6scsi_tcp.c#L383" id="L386" cla683" class="line" name="L343"> 343     6e_conn" c64"> 384             6  if 68ref="lass="line" namfreemsock = rc 6es="line"685" id="L385" class="lin6" nam68" id="L375" class="line" namsockfd_p+code=segment" clsockfd_p+ca hreL353" id="L353"socka> = ;
 386      6     68" id="L366" class="lp.c#L372" id="Ler name="L349"> 349tcs="sref">tcp_connconntotal_size 368<6gs" class6"sref">pflags, {_sas_parcssk_restore_flagrs/scsc#L397"/a>{_sas_parcsa hreass="line" name="L312"> 312{
{code,L368" class="line" name="L368"> 368<6gcp.c#L366e" name="L390"> 390 6     69 312 368<6ge=iscsi_6="drivers/scsi/iscsi_tcp6c#L3969(tcs="sref">tcp_connconndd_data{
 372       /ls<372" class="line" nals{codei_conn" class="sref"ef="+code=tcp_sw_conn" class="sref">tcs="sref">tcp_connconn * This is 6alled69ref="+code=dd_data" class="sref">dd_data{
 313        struct iscsi_tcp_conn *tcp_connconn * Simply copy the6data_696ef="+code=dd_data" class="sref">dd> 312;
 314        struct iscsi_sw_tcp_conn *tcs="sref">tcp_connconnPF_MEMALLOC<6cf="drive6sref">iscsi_tcp_conn6*iscsi_segment *rc 7>)
       /ls<372" class="line" nals{coden> 372       parcssk_restore_flagparcsa hr, p.c#L372" id="LscsOC);
tcs="sref">tcp_connconntcp_conn-7gt;tcs="sref">tcp_connconnrc 7>3conn" c7a="drivers/scsi/iscsi_tc7="+co70"L382"> 382      e=inline" classrs/scsses_parcssk_restore_flagrs/scscas_parcsa hre 372       /ls<372" class="line" nals{coden> 372       parcssk_restore_flagparcsa hr, p.c#L372" id="LscsOC);
tcs"+code=rc" class="sref">rc 7>4conn" c7a" id="L393" class="line7>copi70" id="L333" class="litruct  314        struct  *iscsi_tcp_coss=dgst_e" class="line" noss=dgst_e"t tcs"+code=rc" class="sref">rc 7>5conn" c7as="comment"> * This is 7id="L70ref="+code=ddddddddddddddddddL353" id="L353"sock_no_sendpag=uct  314        struct  * =  * Simply copy the7turn 70"L385"> 385      breakf">tcs="sref">tcp_connconn);
rc 7>8scsi/is7sref">iscsi_tcp_conn7.c#L370f="+code=tcp_conn" cl"+code=class="sref">dd_data{sas_max_r2code=segment" cl_data{sas_max_r2ca hreL353" id="L353" 72" class="line" name="L37, p.c#L372" id="LscsOC);
tcs"+code=rc" class="sref">rc 7>9scsi/is7s="sref">iscsi_segmentrc 7e" name="7309"> 309dd_data       /ls<372" class="line" nals{coden> 372       parcssk_restore_flagparcsa hr, p.c#L372" id="LscsOC);
tcs"+code=rc" class="sref">rc 7e_conn" c7 id="L310" class="line" 7ame="71a href="+codetotal_size" class="sref">total_size;
iscsi_7onn 391<7c=out" cl7="drivers/scsi/iscsi_tcp7c#L3171 id="L312" cllass="l/scsi/iscsi_tcp.c#L386" id="L386" clas7>/scsi/is7" class="sref">conn-7gt;total_sizetcp_conn-7gt;total_sizeout<7a>.{_gas_parcssk_restore_flagrs/scsc#L397"/a>{_gas_parcsa hreass="line" name="L312"> 312{
{code,L368" class="line" name="L368"> 368<7h7scsi/is7>        unsigned int t555555555555555enumine" name="L312"> 312tcs="sref">tcp_connconn}
 317  7     71f="+chref="+code=conn" class="sref">conn 312{
 372       /ls<372" class="line" nals{codei_conn" class="sref"ef="+code=tcp_sw_conn" class="sref">tcs="sref">tcp_connconn 399{
 313        struct iscsi_tcp_conn *tcp_connconntcp_conndd_data;
 314        struct iscsi_sw_tcp_conn *tcs="sref">tcp_connconn;
 37172 id="L371" class="line" name="L371"sockaddr_in6de=tcp_sw_conn"sockaddr_in6a hrine" name="L312"addrde=tcp_sw_conn"addr"sref">tcs="sref">tcp_connconn);
tcs="sref">tcp_connconn 343     7s5scsi/is7  7     72ref="+code=ddswitcheL353" id="L353"parcssk_restore_flagparcsa hr scsi_tcp.c#L380" id="L380" class="line7sref="+co7s="line" name="L325"> 327<72"L385"> 385);
rc 7s7scsi/is7e=rc" class="sref">rc);
rc 7s>}
                 7     72f="+code=tcp_conn" clne" name="L371"spin_lock_b"_segment" classspin_lock_b"a hre    struct iscsi_tcp_csessio{
                else7if (<72a href="+code=conn" c383segment 314        struct segment 314        struct  * = iscsi_tcp_csessio{
 3307/a>                     7  got73NOTCONNa> = tcs="sref">tcp_connconn 731                } 7lse i73(total_size 382      e=inline" classrLOC);
);
 314        struct  * =  368<7ak;
co7sumed73ref="+code=ddddddddddne" name="L371"spin_unlock_b"_segment" classspin_unlock_b"a hre    struct iscsi_tcp_csessio{
 385      383<               rLOC);
tcs="sref">tcp_connconnsegment->t"+code=class="sref">ddrLOC);
}
done7/a> !73t rc 7i0;
tcp_conniov_i_tcp./a>{_gas_addr_parcssk_restore_flagrs/scs/a>{_gas_addr_parcsa hreeass="line" name="L312"sockaddr_storag=uct rc 7339  7                        7    i74(       parcssk_restore_flagparcsa hr, p.c#L372" id="LscsOC);
 3307                        7  got74rc 7/iscsi_tc7.c#L341" id="L341" class7"line74(iov_i_tcp./a>{_gas_parcssk_restore_flagrs/scs/a>{_gas_parcsa hre 372       /ls<372" class="line" nals{coden> 372       parcssk_restore_flagparcsa hr, p.c#L372" id="LscsOC);
 382total_size 343     7/="+code=7f="drivers/scsi/iscsi_tc7.c#L374ref="+code=ddlass="l/scsi/iscsi_tcp.c#L386" id="L386" clas7;xmit %d bytes\n",7total_sizePF_MEMALLOC<7/="L327">7ref">txdata_octets +7  368<7/0;
 348        retur7  312tcs="sref">tcp_connconn;
 3307lass="line" name="L350">7350dd_data;
;
       shostsk_restore_flagshostt /* Tr7nsmit75 id="L371" class="line" name="L371"rs/scscassio{
iscsi_tcp_csessio{
 357<75 id="L312" class="line" name="L312"> 312{
dd_data{
 313     scsi/iscsi_tcp.c#L386" id="L386" clas7a="+code=7="+code=conn" class="sre7">con75ref="+code=dd_data" class="sref">dd_data;
 314        struct  355    7   re756ef="+code=dd_data" class="sref">ddsockaddr_in6de=tcp_sw_conn"sockaddr_in6a hrine" name="L312"addrde=tcp_sw_conn"addr"sref">tcs="sref">tcp_connconn);
tcs="sref">tcp_connconn7f="drivers/scsi/iscsi_tc7.c#L375t rc 7a0;
 * iscsi_tcp_xmit_qle7 - re76();
rc 7tcp.c#L367" id="L360" class="line"7name=76 * = iscsi_7onniov_372" class="line" name="L372"> 372       sessio{
tcs="sref">tcp_connconn 382      383segment< 72" class="line" name="L37 scsi_tcp.c#L380" id="L380" class="line7sk;
conn-7gt; * = tcp_conn-7gt;NOTCONNa> = tcs="sref">tcp_connconnout<7a>. 385      total_size" class="sref">total_size;
 313        struct iscsi_tcp_conn *tcp_connconnsegment->rc 7>;
segment 314        struct iscsi_sw_tcp_conn *tcs="sref">tcp_connconn}
segment 314        struct  * = iscsi_7ask * = NOTCONNa> = tcs="sref">tcp_connconntas7-77"L382"> 382      total_size" class="sref">total_sizecurrent<7a>-&g773" class="line" name="L343"> 343     7a_conn" c7" name="L374"> 374  7     77ref="+code=ddddddddddne" name="L371"rLOC);
);
 314        struct  * =  368<7as="line"7f="drivers/scsi/iscsi_tc7.c#L377"L385"> 385                              eass="line" name="L312"sockaddrde=tcp_sw_conn"sockaddr" id=")    struct ;
flags |=  * = );
tcs="sref">tcp_connconniscsi_sw_tcp_xmit_ql7n77a href="+code=conn" ccccccccc"+code=class="sref">ddrLOC);
iscsi_sw_tcp_7mittcp_sw_conn-> 380             7  if 78iov_i_tcp./a>{_gas_addr_parcssk_restore_flagrs/scs/a>{_gas_addr_parcsa hreeass="line" name="L312"sockaddr_storag=uct rc 7 e=iscsi_7de=rc" class="sref">rc = -78(       parcssk_restore_flagparcsa hr, p.c#L372" id="LscsOC);
rc 7ers/scsi/7scsi_tcp.c#L383" id="L387" cla78" id="L333" class="lilass=">ass="sref">iov_i_tcp.host_gas_parcssk_restore_flagrs/scshost_gas_parcsa hreL314" class="lishostsk_restore_flagshostt        parcssk_restore_flagparcsa hr, p.c#L372" id="LscsOC);
 384             7  if 78ref="+code=ddtotal_size" class="sref">total_sizesegment<7e>;
 386      7     78" id="L366" class="l/scsi/iscsi_tcp.c#L386" id="L386" clas7ef="drive7s/scsi/iscsi_tcp.c#L387"7id="L78code=total_size" class="sref">total_size 368<7gs" class7"sref">pflags,  368<7gcp.c#L367e" name="L390"> 390 7     79{_gas_"L36tsk_restore_flagrs/scsc#L397"/a>{_gas_"L36ta hreass="line" name="L312"> 312{
{code,L368" class="line" name="L368"> 368<7ge=iscsi_7="drivers/scsi/iscsi_tcp7c#L3979(dd_datarc 7c_tcp.c#L7f="drivers/scsi/iscsi_tc7.c#L379=datacsi_tcp.c#L380" id="L380" class="line7crs/scsi/73" id="L393" class="line7 name79ref="+code=dd_data" class="sref">dd_data{
 372       /ls<372" class="line" nals{codei_conn" class="sref"ef="+code=tcp_sw_conn" class="sref">tcs="sref">tcp_conncoline7c_conn" c7ss="comment"> * This is 7alled79ref="+code=dd_data" class="sref">dd_data{
 313        struct iscsi_tcp_conn *tcp_conncoline7cs="line"7ment"> * Simply copy the7data_796ef="+code=dd_data" class="sref">dd> 312;
 314        struct iscsi_sw_tcp_conn *tcs="sref">tcp_conncoline7c>;
PF_MEMALLOC<7cf="drive7sref">iscsi_tcp_conn7* *tcs="sref">tcp_conncoline7cclass="s7s="sref">iscsi_segment * *);
         scsi/iscsi_tcp.c#L386" id="L386" clas8>)
 * 314        struct  *tcs="sref">tcp_conncoline8p_conn" c8ass="sref">tcp_conn-8gt;iscsi_tcp_csLrcpysk_restore_flagcLrcpya hreL314" class="lisL36tsk_restore_flagcL36ta hr_tcp_conn * *);
         scsi/iscsi_tcp.c#L386" id="L386" clas8>2conn" c8a"drivers/scsi/iscsi_tcp8.c#L480" id="L401" class="line" namsL36tsk_restore_flagcL36ta hr_tcp_conn * * 314        struct  *tcs="sref">tcp_conncoline8p3conn" c8a="drivers/scsi/iscsi_tc8="+co80"L382"> 382iscsi_tcp_csLrcpysk_restore_flagcLrcpya hreL314" class="lisL36tsk_restore_flagcL36ta hr_tcp_conn * *);
         scsi/iscsi_tcp.c#L386" id="L386" clas8>4conn" c8a" id="L393" class="line8>copi80ref="+code=dd3372       sL36tsk_restore_flagcL36ta hr_tcp_conn * *iscsi_tcp_ceh_abort_cntde=iscsi_tcp_coeh_abort_cnt"sref">tcs="sref">tcp_conncoline8p5conn" c8as="comment"> * This is 8id="L805 id=otal_size" class="sref">total_size * Simply copy the8turn 80" id="L375" class="line" namcsi/iscsi_tcp._gas_"L36tsk_restore_flagrs/scs397"/a>{_gas_"L36ta hrep.c#L372" id="L3ls<372" class="line" nals{code,d3372       sL36tsk_restore_flagcL36ta hr scsi/iscsi_tcp.c#L386" id="L386" clas8>7scsi/is8s id="L396" class="line"8c#L30807 id=total_size" class="sref">total_size8scsi/is8sref">iscsi_tcp_conn8.c#L380t rc 8>9scsi/is8s="sref">iscsi_segment 312rc 8e" name="8309"> 309dd> 312;
 312 312 368<8e_conn" c8 id="L310" class="line" 8ame="81       uint32_tde=iscsi_tcp_couint32_t" id=p.c#L372" id="Linitial_amds{
rc 8e>;
iscsi_8onn 312/scsi/is8" class="sref">conn-8gt;dd_data5conn" c8ass="sref">tcp_conn-8gt;dd_data;
;
6scsi/is8e=out" class="sref">out<8a>.ddScscsHostsk_restore_flagS/scsHost" id="L314" class="lishostsk_restore_flagshostt 7scsi/is8>        unsigned int PF_MEMALLOC<8e>}
 317  8     81segment

= sde=inline" classeiivers/scsi/iscseia hr scsi/iscsi_tcp.c#L386" id="L386" clas8s/scsi/is8si_tcp.c#L319" id="L319"8class82(ddNULLivers/scsi/iscsNULLt tcp_conntotal_size; 38182 id="L391" class="line" name="L391"> 391<8s=out" cl8 * We may no8 have82"L382"> 382iscsi_tcp_cshostsk_restore_flagshostt 312; ; 368<8s/scsi/is8 * is gettin8 stop82" id="L333" class="liclass="sreeeeeeeesizeofeass="line" name="L312"> 312; ; 8 82ref="+code=dd383segment 328<82"L385"> 385 "+code=class="sref">ddNULLivers/scsi/iscsNULLt rciscsi_tcp_ctransporttsk_restore_flagnransporttt ; } 8 82iscsi_tcp_camd_per_lu{ else8if (<829iscsi_tcp_cmax_lu{ rc =8iscsi_tcp_cmax_id 3308/a> 8 got83ef="+code=segef">iscsi_tcp_cshostsk_restore_flagshostt iscsi_tcp_cmax_channel ; } 8lse i83" id="L401" class="line" namshostsk_restore_flagshostt iscsi_tcp_cmax_cmd_le" class="line" nmax_cmd_le"t =out" cl832" id="L332" class="lin8" nam83"L382csi/iscsi_tcp.c#L386" id="L386" clas8>/scsi/is8f="drivers/scsi/iscsi_tc8.c#L383" id="L333" c383< rs/scshost_add co8sumed83ref="+code=ddddddddddgotor 372 freemhostsk_restore_flagfreemhosta hrscsi/iscsi_tcp.c#L386" id="L386" clas8>6scsi/is8f="drivers/scsi/iscsi_tc8.c#L383ref="+code=segment" class="sref">segment<8a7scsi/is8ef">segment-> 368<83>} done8/a> !83f="+code=tcp_conn" clllllllllllllllllllllllllllp.c#L372" id="L3mds_max class="line" namds_maxcode, 0,L368" class="line" name="L368"> 368<839} tcp_conn 312<; = 368<8339 8 8 i84( 312; ); 312; 368<8330"> 3308 8 got84segment< ls 382 gotor 372 removemhostsk_restore_flagremovemhosta hrscsi/iscsi_tcp.c#L386" id="L386" clas8/k; sessio{ *tcs="sref">tcp_conncoline8/="+code=8f="drivers/scsi/iscsi_tc8.c#L384ref="+code=ddL314" class="line" namhostsk_restore_flagne" namhost"L37 href="+code=iscsirs/scshost_p80"sk_restore_flagrs/scshost_p80"a hre 372 shostsk_restore_flagshostt ,8iscsi_tcp_csessio{ 372 sessio{ PF_MEMALLOC<8/="L327">8ref">txdata_octets +8 iscsi_tcp_caan_queu=uct 372 sessio{ iscsi_tcp_cs/scsimds_max class="line" ns/scsimds_maxcsi_scsi/iscsi_tcp.c#L386" id="L386" clas8;9} 348 retur8 ); sessio{ ; removemsessio{ 3308lass="line" name="L350">8350dd3ls/* Tr8nsmit85 id="L391" class="line" name="L391"> 391<8a_tcp.c#L8s="line" name="L352"> 358<85 id=" 372 removemsessio{ rc 8ak; i_tcp./essio{_teardow{ con85ref=" 372 removemhostsk_restore_flagremovemhosta hr:href="+code=rc" class="sref">rc 8axmit &name="L355"> 355 8 re85" id="L375" class="line" namcsi/ishost_removesk_restore_flagrs/scshost_removea hre 372 shostsk_restore_flagshostt rc 8a="L327">8f="drivers/scsi/iscsi_tc8.c#L385 shostsk_restore_flagshostt ddNULLivers/scsi/iscsNULLt * iscsi_tcp_xmit_qle8 - re86(total_sizetotal_sizeiscsi_8onn; ; 312conn-8gt;ddScscsHostsk_restore_flagS/scsHost" id="L314" class="lishostsk_restore_flagshostt tcp_conn-8gt;total_sizeout<8a>. *segment->rc 8>; } iscsi_8asktotal_size 391<8a352" cla8e=task" class="sref">tas8-87"L382"L369" 372 um _tde=iscsi_tcp_coum _t 312; current<8a>-&g873" clcsi_tcp.c#L380" id="L380" class="line8a_conn" c8" name="L374"> 374 8 87ref="+code=ddswitch3< parcs_typ=uct 385rc 8a>; flags |= rc 8a; iscsi_sw_tcp_xmit_ql8n87a href="+code=conn" ccase L353" id="L353"ers/scHOSTcPARAM_HWADDRESS); rc 8p_xmit" c8ass="sref">iscsi_sw_tcp_8mit); rc 8pcp.c#L3680"> 380 8 if 88rc 8pe=iscsi_8de=rc" class="sref">rc = -88(ddS_IRUGOsk_restore_flagS_IRUGOt 382 default:href="+code=rc" class="sref">rc 8ers/scsi/8scsi_tcp.c#L383" id="L388" cla88" id="L333" class="liL318" cc"+code=/scsi/iscsi_tcp.c#L386" id="L386" clas8i_conn" c84"> 384 8 if 88ref="+code=ddddddddddtotal_size" class="sref">total_size 385rc 8e>; 386 8 88de=total_size" class=switch3< parcssk_restore_flagparcsa hr scsi_tcp.c#L380" id="L380" class="line8ef="drive8s/scsi/iscsi_tcp.c#L387"8id="L88f="+code=tcp_conn" clcase L353" id="L353"ers/scPARAM_MAX_RECV_DLENGTHsk_restore_flagers/scPARAM_MAX_RECV_DLENGTHa hr:href="+code=rc" class="sref">rc 8e; rc 8gs" class8"sref">pflags, = rc 8gcp.c#L368e" name="L390"> 390 8 89 = rc 8ge=iscsi_8="drivers/scsi/iscsi_tcp8c#L3989(); rc 8c_tcp.c#L8f="drivers/scsi/iscsi_tc8.c#L389"L382"> 382 case L353" id="L353"ers/scPARAM_CONN_PORT); rc 8crs/scsi/83" id="L393" class="line8 name89" id="L333" class="licase L353" id="L353"ers/scPARAM_EXP_STATSNa> = rc 8c_conn" c8ss="comment"> * This is 8alled89ref="+code=ddddddddddcase L353" id="L353"ers/scPARAM_PERSISTENT_ADDRESS); rc 8cs="line"8ment"> * Simply copy the8data_89"L385"> 385 case L353" id="L353"ers/scPARAM_PERSISTENT_PORT); rc 8c>; rc 8cf="drive8sref">iscsi_tcp_conn8*rc 8c; iscsi_segment * = rc 9>) ); rc 9>1 390 9gt; = rc 9>2 = rc 9>3 382 case L353" id="L353"ers/scPARAM_MAX_BURSTa> = rc 9>4 = rc 9>5 * This is 9id="L90ref="+code=ddddddddddcase L353" id="L353"ers/scPARAM_DATASEQ_INORDERcENa> = rc 9>6 * Simply copy the9turn 90"L385"> 385 case L353" id="L353"ers/scPARAM_ERLivers/scsi/iscsers/scPARAM_ERL"L37:href="+code=rc" class="sref">rc 9>7 rc 9>8 iscsi_tcp_conn9.c#L390f="+code=tcp_conn" clcase L353" id="L353"ers/scPARAM_TPGTa> = rc 9>9 iscsi_segmentrc 9e" name="9309"> 309 = rc 9e1 rc 9e2 iscsi_9onnrc 9e3 382 case L353" id="L353"ers/scPARAM_FASTcABORT); rc 9e4 conn-9gt;rc 9e5 tcp_conn-9gt;rc 9e6 out<9a>. 385 case L353" id="L353"ers/scPARAM_TGT_RESET_TMOsk_restore_flagers/scPARAM_TGT_RESET_TMO"L37:href="+code=rc" class="sref">rc 9e7 unsigned int rc 9e8 317 9 91f="+code=tcp_conn" clcase L353" id="L353"ers/scPARAM_INITIATOR_NAMEsk_restore_flagers/scPARAM_INITIATOR_NAME"L37:href="+code=rc" class="sref">rc 9e9} ddS_IRUGOsk_restore_flagS_IRUGOt rc 9s_conn" c9class="sref">tcp_conn; 39192(total_size 382total_size 343 9s5conn" c9 9 92ref="+code=dd"+code=/scsi/iscsi_tcp.c#L386" id="L386" clas9s6 329<92"L385total_size" class="sref">total_sizercPF_MEMALLOC<9s>} 9 92; ); ; else9if (<929 * 3309/a> 9 got93a href="+code"+code=/scsi/iscsi_tcp.c#L386" id="L386" clas93>; } 9lse i93" id=total_size" class="sref">total_size=out" cl932" id="L332" class="lin9" nam93"L382csi/iscsi_tcp.c#L386" id="L386" clas9>/scsi/is9f="drivers/scsi/iscsi_tc9.c#L393" id="L369" 3laclass="line" namrs/scs/a>; co9sumed93ref="csi_tcp.c#L380" id="L380" class="line9>6 sdevuct BLK_BOUNCE_ANYuct segment-> sdevuct } done9/a> !93f="+code=tcp_"+code=/scsi/iscsi_tcp.c#L386" id="L386" clas939} tcp_conntotal_size 9 9 i94" id=ef">tcp_sw_conn-> 3309 9 got94; ; 382 * ssi_tcp.c#L380" id="L380" class="line9//scsi/is9s/scsi/iscsi_tcp.c#L343"9id="L94ref="+code=dd.conn * * *txdata_octets +9 348 retur9 3309lass="line" name="L350">9350 */* Tr9nsmit95( 359<95"L382"> 382 * *); con95ref="+code=dd.conn * 312; 355 9 re95" id="L375" c.conn *); ); * ssi_tcp.c#L380" id="L380" class="line9a="L327">9f="drivers/scsi/iscsi_tc9.c#L395 * iscsi_tcp_xmit_qle9 - re96" id=ef">tcp_sw_conn->iscsi_9onn * 382 * ssi_tcp.c#L380" id="L380" class="line9sk; conn-9gt; * * *); *); tcp_sw_conn->tcp_conn-9gt; *); out<9a>. commentd>/* sessio{ management */"sref">si_tcp.c#L380" id="L380" class="line9d7 * 312; 9sref">segment->si_tcp.c#L380" id="L380" class="line9a>} * 312; {_creat=a hr,si_tcp.c#L380" id="L380" class="line9acp.c#L369ask" class="sref">iscsi_9ask * 312; {_binda hr,si_tcp.c#L380" id="L380" class="line9aiscsi_tc9="drivers/scsi/iscsi_tcp9c#L3797(; {_deassoysk_restore_flagrs/scs/a>; {_deassoya hr,si_tcp.c#L380" id="L380" class="line9a352" cla9e=task" class="sref">tas9-97"L382"> 382 *; current<9a>-&g97ref="+code=dd.conn * 374 9 97ref="+code=dd.conn *{_parcssk_restore_flaggas_/a>{_parcst 312; {_gas_parcssk_restore_flag> 312; {_gas_parcsa hr,si_tcp.c#L380" id="L380" class="line9a6 *flags |= *{_start_segment" classrs/scsca>{_starta hr,si_tcp.c#L380" id="L380" class="line9a="L327">9f="drivers/scsi/iscsi_tc9.c#L397iscsi_sw_tcp_xmit_ql9n979si_tcp.c#L380" id="L380" class="line9p_xmit" c9ass="sref">iscsi_sw_tcp_9mit * 312; 312; 380 9 if 98a href="+code.conn * 312 312rc = -98(si_tcp.c#L380" id="L380" class="line9p352" cla982" id="L382" class="lin9" nam98"L382"> 382 *{_send{_send 312; {_gas_"tatta hr,si_tcp.c#L380" id="L380" class="line9p5scsi/is94"> 384 9 if 98ref="+code=ddt commentd>/* " cla 6ask/cmd help id */"sref">si_tcp.c#L380" id="L380" class="line9p6 * = 386 9 987 id="L375" c.conn * = 9s/scsi/iscsi_tcp.c#L387"9id="L98 = si_tcp.c#L380" id="L380" class="line9gs" class9"sref">pflags, *; 312; 390 9 99a href="+code.conn *nitapdusk_restore_flagrnitapduef="+code=dddddddddhref="+code=iscsirs/scs/a>; nitsk_restore_flag_data; nita hr,si_tcp.c#L380" id="L380" class="line9giscsi_tc9="drivers/scsi/iscsi_tcp9c#L3999( 382 commentd>/* r=co" iy */"sref">si_tcp.c#L380" id="L380" class="line9gk; *6scs9 ; iscsi_tcp_cmax_lu{ tcp_sw_conn-&gid="L380" class=".c# = *8de=total_size" class=switch3< 10<1 href="10 312; 1086" id="L386" clas8;9as="sref">iscsi_tcp_cmax_lu{ ; n1010 *total_size/* r=co" iy */1010total_size10<>tcs="sref">tcp_conn * 3.c#L369" id="L360" class="line"regi"> 3.c#L369" idddd(ize" class="sref">total_size1010<7i/iscsi_tcp.c#L386" id="L386" clessio{a hr=errccp.c#L369" id="L360" class="line"a hr=errccp.c#L369" inn10 *total_size10e_ef="+code=rcc#L386" id="L386" clas93>} 10esi/iscsi_tcp.c#L386" id="L386" clas8acp.c#10e2 href="10lagers/scPARAM_USERNAME_10lag>10etal_size" class="sref">total_size10e391" class="ass="sref">total_siz__exsk_restore_flagrn_dexskdddd href="+co.conn * *10esi/iscsi_tcp.c#L386" id="L386" clas8acode=10e5 href="10_flagers/scPARAM_ABORT_T10_fl>10e>tcs="sref">tcp_conn 3.c#L369" id="L360" class="line"unregi"> 3.c#L369" idddd(i_ href="+code=iscsirs/scs/essio{_s+coiivers/scsi/iscsi_tcp./essio{_s+coia hre s+csdevcsi__tcp_conn *total_size10eref="ef="+code=iscsi341" ildusk_restore_flagrn341" ilduskdddd(id="L380" class/a> *10e9ef="ef="+code=iscsi341" ilexsk_restore_flagrn341" ilexskdddd(id="L380" class/a> * * *

3"> The original LXR software5by thef">rc http://sourceforge.net/projects/lx3">LXR ass=udddf="+co iver experi="lial conn9="dby ">rc mailto:lx3@oreux.no">lx3@oreux.no="+c. 3"> lx3.oreux.no kindlyhr9efeddby ">rc http://www.redpill-orepro.no">Redpill Lrepro AS="+co provider of Lreux9} and operar9="s seret_hs since 1995.