Commit 6e458cc9 authored by Mike Christie's avatar Mike Christie Committed by James Bottomley

[SCSI] iscsi: dont use sendpage for iscsi headers

From Zhen and ported by Mike:

Don't use sendpage for the headers. sendpage for the pdu headers
does not seem to have a performance impact, makes life harder
for mutiple data pdus to be in flight and still trips up some
network cards when it is from slab mem.
Signed-off-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 07fb75a5
...@@ -70,14 +70,6 @@ module_param_named(max_lun, iscsi_max_lun, uint, S_IRUGO); ...@@ -70,14 +70,6 @@ module_param_named(max_lun, iscsi_max_lun, uint, S_IRUGO);
/* global data */ /* global data */
static kmem_cache_t *taskcache; static kmem_cache_t *taskcache;
static inline void
iscsi_buf_init_virt(struct iscsi_buf *ibuf, char *vbuf, int size)
{
sg_init_one(&ibuf->sg, (u8 *)vbuf, size);
ibuf->sent = 0;
ibuf->use_sendmsg = 0;
}
static inline void static inline void
iscsi_buf_init_iov(struct iscsi_buf *ibuf, char *vbuf, int size) iscsi_buf_init_iov(struct iscsi_buf *ibuf, char *vbuf, int size)
{ {
...@@ -324,7 +316,7 @@ iscsi_solicit_data_init(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask, ...@@ -324,7 +316,7 @@ iscsi_solicit_data_init(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask,
r2t->sent = 0; r2t->sent = 0;
iscsi_buf_init_virt(&r2t->headbuf, (char*)hdr, iscsi_buf_init_iov(&r2t->headbuf, (char*)hdr,
sizeof(struct iscsi_hdr)); sizeof(struct iscsi_hdr));
r2t->dtask = dtask; r2t->dtask = dtask;
...@@ -1208,7 +1200,7 @@ iscsi_digest_final_send(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask, ...@@ -1208,7 +1200,7 @@ iscsi_digest_final_send(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask,
if (final) if (final)
crypto_digest_final(tcp_conn->data_tx_tfm, (u8*)digest); crypto_digest_final(tcp_conn->data_tx_tfm, (u8*)digest);
iscsi_buf_init_virt(buf, (char*)digest, 4); iscsi_buf_init_iov(buf, (char*)digest, 4);
rc = iscsi_sendpage(conn, buf, &tcp_ctask->digest_count, &sent); rc = iscsi_sendpage(conn, buf, &tcp_ctask->digest_count, &sent);
if (rc) { if (rc) {
tcp_ctask->datadigest = *digest; tcp_ctask->datadigest = *digest;
...@@ -1265,7 +1257,7 @@ iscsi_solicit_data_cont(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask, ...@@ -1265,7 +1257,7 @@ iscsi_solicit_data_cont(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask,
} }
conn->dataout_pdus_cnt++; conn->dataout_pdus_cnt++;
iscsi_buf_init_virt(&r2t->headbuf, (char*)hdr, iscsi_buf_init_iov(&r2t->headbuf, (char*)hdr,
sizeof(struct iscsi_hdr)); sizeof(struct iscsi_hdr));
r2t->dtask = dtask; r2t->dtask = dtask;
...@@ -1294,7 +1286,7 @@ iscsi_unsolicit_data_init(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask) ...@@ -1294,7 +1286,7 @@ iscsi_unsolicit_data_init(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask)
iscsi_prep_unsolicit_data_pdu(ctask, &dtask->hdr, iscsi_prep_unsolicit_data_pdu(ctask, &dtask->hdr,
tcp_ctask->r2t_data_count); tcp_ctask->r2t_data_count);
iscsi_buf_init_virt(&tcp_ctask->headbuf, (char*)&dtask->hdr, iscsi_buf_init_iov(&tcp_ctask->headbuf, (char*)&dtask->hdr,
sizeof(struct iscsi_hdr)); sizeof(struct iscsi_hdr));
list_add(&dtask->item, &tcp_ctask->dataqueue); list_add(&dtask->item, &tcp_ctask->dataqueue);
...@@ -1361,7 +1353,7 @@ iscsi_tcp_cmd_init(struct iscsi_cmd_task *ctask) ...@@ -1361,7 +1353,7 @@ iscsi_tcp_cmd_init(struct iscsi_cmd_task *ctask)
} else } else
tcp_ctask->xmstate = XMSTATE_R_HDR; tcp_ctask->xmstate = XMSTATE_R_HDR;
iscsi_buf_init_virt(&tcp_ctask->headbuf, (char*)ctask->hdr, iscsi_buf_init_iov(&tcp_ctask->headbuf, (char*)ctask->hdr,
sizeof(struct iscsi_hdr)); sizeof(struct iscsi_hdr));
} }
...@@ -1758,7 +1750,7 @@ handle_xmstate_w_pad(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask) ...@@ -1758,7 +1750,7 @@ handle_xmstate_w_pad(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask)
int sent; int sent;
tcp_ctask->xmstate &= ~XMSTATE_W_PAD; tcp_ctask->xmstate &= ~XMSTATE_W_PAD;
iscsi_buf_init_virt(&tcp_ctask->sendbuf, (char*)&tcp_ctask->pad, iscsi_buf_init_iov(&tcp_ctask->sendbuf, (char*)&tcp_ctask->pad,
tcp_ctask->pad_count); tcp_ctask->pad_count);
if (iscsi_sendpage(conn, &tcp_ctask->sendbuf, &tcp_ctask->pad_count, if (iscsi_sendpage(conn, &tcp_ctask->sendbuf, &tcp_ctask->pad_count,
&sent)) { &sent)) {
...@@ -2078,8 +2070,8 @@ iscsi_tcp_mgmt_init(struct iscsi_conn *conn, struct iscsi_mgmt_task *mtask, ...@@ -2078,8 +2070,8 @@ iscsi_tcp_mgmt_init(struct iscsi_conn *conn, struct iscsi_mgmt_task *mtask,
{ {
struct iscsi_tcp_mgmt_task *tcp_mtask = mtask->dd_data; struct iscsi_tcp_mgmt_task *tcp_mtask = mtask->dd_data;
iscsi_buf_init_virt(&tcp_mtask->headbuf, (char*)mtask->hdr, iscsi_buf_init_iov(&tcp_mtask->headbuf, (char*)mtask->hdr,
sizeof(struct iscsi_hdr)); sizeof(struct iscsi_hdr));
tcp_mtask->xmstate = XMSTATE_IMM_HDR; tcp_mtask->xmstate = XMSTATE_IMM_HDR;
if (mtask->data_count) if (mtask->data_count)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment