diff options
author | dmitry_yus <dmitry_yus@d7303112-9cec-0310-bdd2-e83a94d6c2b6> | 2005-03-12 01:14:07 +0000 |
---|---|---|
committer | dmitry_yus <dmitry_yus@d7303112-9cec-0310-bdd2-e83a94d6c2b6> | 2005-03-12 01:14:07 +0000 |
commit | 5ce4ce74660b264961a2f13bdf111be3b54ba253 (patch) | |
tree | dfafc9353b56cc5094e1a84333125ffbde54c0e5 /kernel | |
parent | 320ea6e009dd981053a42075b5199ecb317b8ec5 (diff) | |
download | open-iscsi-5ce4ce74660b264961a2f13bdf111be3b54ba253.tar.gz |
write optimization: reduce number of TCP round trips. i.e.
send iSCSI PDU header as a part of the same TCP payload.
git-svn-id: svn://svn.berlios.de/open-iscsi@180 d7303112-9cec-0310-bdd2-e83a94d6c2b6
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/iscsi_tcp.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/kernel/iscsi_tcp.c b/kernel/iscsi_tcp.c index e9c7608..dae0dd6 100644 --- a/kernel/iscsi_tcp.c +++ b/kernel/iscsi_tcp.c @@ -1062,7 +1062,7 @@ iscsi_conn_restore_callbacks(struct iscsi_conn *conn) * (Tx, Fast Path) */ static inline int -iscsi_sendhdr(struct iscsi_conn *conn, struct iscsi_buf *buf) +iscsi_sendhdr(struct iscsi_conn *conn, struct iscsi_buf *buf, int datalen) { struct socket *sk = conn->sock; int flags = 0; /* MSG_DONTWAIT; */ @@ -1071,7 +1071,7 @@ iscsi_sendhdr(struct iscsi_conn *conn, struct iscsi_buf *buf) offset = buf->sg.offset + buf->sent; size = buf->sg.length - buf->sent; BUG_ON(buf->sent + size > buf->sg.length); - if (buf->sent + size != buf->sg.length) { + if (buf->sent + size != buf->sg.length || datalen) { flags |= MSG_MORE; } @@ -1365,7 +1365,7 @@ iscsi_mtask_xmit(struct iscsi_conn *conn, struct iscsi_mgmt_task *mtask) mtask->xmstate &= ~XMSTATE_IMM_HDR; if (mtask->data_count) mtask->xmstate |= XMSTATE_IMM_DATA; - if (iscsi_sendhdr(conn, &mtask->headbuf)) { + if (iscsi_sendhdr(conn, &mtask->headbuf, mtask->data_count)) { mtask->xmstate |= XMSTATE_IMM_HDR; if (mtask->data_count) mtask->xmstate &= ~XMSTATE_IMM_DATA; @@ -1402,7 +1402,7 @@ iscsi_ctask_xmit(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask) if (ctask->xmstate & XMSTATE_R_HDR) { ctask->xmstate &= ~XMSTATE_R_HDR; - if (!iscsi_sendhdr(conn, &ctask->headbuf)) { + if (!iscsi_sendhdr(conn, &ctask->headbuf, 0)) { BUG_ON(ctask->xmstate != XMSTATE_IDLE); return 0; /* wait for Data-In */ } @@ -1412,7 +1412,7 @@ iscsi_ctask_xmit(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask) if (ctask->xmstate & XMSTATE_W_HDR) { ctask->xmstate &= ~XMSTATE_W_HDR; - if (iscsi_sendhdr(conn, &ctask->headbuf)) { + if (iscsi_sendhdr(conn, &ctask->headbuf, ctask->imm_count)) { ctask->xmstate |= XMSTATE_W_HDR; return -EAGAIN; } @@ -1443,7 +1443,7 @@ _unsolicit_head_again: iscsi_unsolicit_data_init(conn, ctask); ctask->xmstate &= ~XMSTATE_UNS_INIT; } - if (iscsi_sendhdr(conn, &ctask->headbuf)) { + if (iscsi_sendhdr(conn, &ctask->headbuf, ctask->data_count)) { ctask->xmstate &= ~XMSTATE_UNS_DATA; ctask->xmstate |= XMSTATE_UNS_HDR; return -EAGAIN; @@ -1498,7 +1498,7 @@ _unsolicit_head_again: } _solicit_head_again: BUG_ON(r2t == NULL); - if (iscsi_sendhdr(conn, &r2t->headbuf)) { + if (iscsi_sendhdr(conn, &r2t->headbuf, r2t->data_count)) { ctask->xmstate &= ~XMSTATE_SOL_DATA; ctask->xmstate |= XMSTATE_SOL_HDR; return -EAGAIN; |