diff options
| -rw-r--r-- | drivers/target/iscsi/iscsi_target.c | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 37bc8a37401d..91fbada7cdc2 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c | |||
| @@ -500,7 +500,7 @@ void iscsit_aborted_task(struct iscsi_conn *conn, struct iscsi_cmd *cmd) | |||
| 500 | EXPORT_SYMBOL(iscsit_aborted_task); | 500 | EXPORT_SYMBOL(iscsit_aborted_task); |
| 501 | 501 | ||
| 502 | static void iscsit_do_crypto_hash_buf(struct ahash_request *, const void *, | 502 | static void iscsit_do_crypto_hash_buf(struct ahash_request *, const void *, |
| 503 | u32, u32, u8 *, u8 *); | 503 | u32, u32, const void *, void *); |
| 504 | static void iscsit_tx_thread_wait_for_tcp(struct iscsi_conn *); | 504 | static void iscsit_tx_thread_wait_for_tcp(struct iscsi_conn *); |
| 505 | 505 | ||
| 506 | static int | 506 | static int |
| @@ -521,7 +521,7 @@ iscsit_xmit_nondatain_pdu(struct iscsi_conn *conn, struct iscsi_cmd *cmd, | |||
| 521 | 521 | ||
| 522 | iscsit_do_crypto_hash_buf(conn->conn_tx_hash, hdr, | 522 | iscsit_do_crypto_hash_buf(conn->conn_tx_hash, hdr, |
| 523 | ISCSI_HDR_LEN, 0, NULL, | 523 | ISCSI_HDR_LEN, 0, NULL, |
| 524 | (u8 *)header_digest); | 524 | header_digest); |
| 525 | 525 | ||
| 526 | iov[0].iov_len += ISCSI_CRC_LEN; | 526 | iov[0].iov_len += ISCSI_CRC_LEN; |
| 527 | tx_size += ISCSI_CRC_LEN; | 527 | tx_size += ISCSI_CRC_LEN; |
| @@ -548,9 +548,8 @@ iscsit_xmit_nondatain_pdu(struct iscsi_conn *conn, struct iscsi_cmd *cmd, | |||
| 548 | if (conn->conn_ops->DataDigest) { | 548 | if (conn->conn_ops->DataDigest) { |
| 549 | iscsit_do_crypto_hash_buf(conn->conn_tx_hash, | 549 | iscsit_do_crypto_hash_buf(conn->conn_tx_hash, |
| 550 | data_buf, data_buf_len, | 550 | data_buf, data_buf_len, |
| 551 | padding, | 551 | padding, &cmd->pad_bytes, |
| 552 | (u8 *)&cmd->pad_bytes, | 552 | &cmd->data_crc); |
| 553 | (u8 *)&cmd->data_crc); | ||
| 554 | 553 | ||
| 555 | iov[niov].iov_base = &cmd->data_crc; | 554 | iov[niov].iov_base = &cmd->data_crc; |
| 556 | iov[niov++].iov_len = ISCSI_CRC_LEN; | 555 | iov[niov++].iov_len = ISCSI_CRC_LEN; |
| @@ -595,7 +594,7 @@ iscsit_xmit_datain_pdu(struct iscsi_conn *conn, struct iscsi_cmd *cmd, | |||
| 595 | 594 | ||
| 596 | iscsit_do_crypto_hash_buf(conn->conn_tx_hash, cmd->pdu, | 595 | iscsit_do_crypto_hash_buf(conn->conn_tx_hash, cmd->pdu, |
| 597 | ISCSI_HDR_LEN, 0, NULL, | 596 | ISCSI_HDR_LEN, 0, NULL, |
| 598 | (u8 *)header_digest); | 597 | header_digest); |
| 599 | 598 | ||
| 600 | iov[0].iov_len += ISCSI_CRC_LEN; | 599 | iov[0].iov_len += ISCSI_CRC_LEN; |
| 601 | tx_size += ISCSI_CRC_LEN; | 600 | tx_size += ISCSI_CRC_LEN; |
| @@ -1408,13 +1407,9 @@ static u32 iscsit_do_crypto_hash_sg( | |||
| 1408 | return data_crc; | 1407 | return data_crc; |
| 1409 | } | 1408 | } |
| 1410 | 1409 | ||
| 1411 | static void iscsit_do_crypto_hash_buf( | 1410 | static void iscsit_do_crypto_hash_buf(struct ahash_request *hash, |
| 1412 | struct ahash_request *hash, | 1411 | const void *buf, u32 payload_length, u32 padding, |
| 1413 | const void *buf, | 1412 | const void *pad_bytes, void *data_crc) |
| 1414 | u32 payload_length, | ||
| 1415 | u32 padding, | ||
| 1416 | u8 *pad_bytes, | ||
| 1417 | u8 *data_crc) | ||
| 1418 | { | 1413 | { |
| 1419 | struct scatterlist sg[2]; | 1414 | struct scatterlist sg[2]; |
| 1420 | 1415 | ||
| @@ -1876,10 +1871,9 @@ static int iscsit_handle_nop_out(struct iscsi_conn *conn, struct iscsi_cmd *cmd, | |||
| 1876 | } | 1871 | } |
| 1877 | 1872 | ||
| 1878 | if (conn->conn_ops->DataDigest) { | 1873 | if (conn->conn_ops->DataDigest) { |
| 1879 | iscsit_do_crypto_hash_buf(conn->conn_rx_hash, | 1874 | iscsit_do_crypto_hash_buf(conn->conn_rx_hash, ping_data, |
| 1880 | ping_data, payload_length, | 1875 | payload_length, padding, |
| 1881 | padding, cmd->pad_bytes, | 1876 | cmd->pad_bytes, &data_crc); |
| 1882 | (u8 *)&data_crc); | ||
| 1883 | 1877 | ||
| 1884 | if (checksum != data_crc) { | 1878 | if (checksum != data_crc) { |
| 1885 | pr_err("Ping data CRC32C DataDigest" | 1879 | pr_err("Ping data CRC32C DataDigest" |
| @@ -2285,10 +2279,9 @@ iscsit_handle_text_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd, | |||
| 2285 | goto reject; | 2279 | goto reject; |
| 2286 | 2280 | ||
| 2287 | if (conn->conn_ops->DataDigest) { | 2281 | if (conn->conn_ops->DataDigest) { |
| 2288 | iscsit_do_crypto_hash_buf(conn->conn_rx_hash, | 2282 | iscsit_do_crypto_hash_buf(conn->conn_rx_hash, text_in, |
| 2289 | text_in, payload_length, | 2283 | payload_length, padding, |
| 2290 | padding, (u8 *)&pad_bytes, | 2284 | &pad_bytes, &data_crc); |
| 2291 | (u8 *)&data_crc); | ||
| 2292 | 2285 | ||
| 2293 | if (checksum != data_crc) { | 2286 | if (checksum != data_crc) { |
| 2294 | pr_err("Text data CRC32C DataDigest" | 2287 | pr_err("Text data CRC32C DataDigest" |
| @@ -3976,9 +3969,9 @@ static void iscsit_get_rx_pdu(struct iscsi_conn *conn) | |||
| 3976 | return; | 3969 | return; |
| 3977 | } | 3970 | } |
| 3978 | 3971 | ||
| 3979 | iscsit_do_crypto_hash_buf(conn->conn_rx_hash, | 3972 | iscsit_do_crypto_hash_buf(conn->conn_rx_hash, buffer, |
| 3980 | buffer, ISCSI_HDR_LEN, | 3973 | ISCSI_HDR_LEN, 0, NULL, |
| 3981 | 0, NULL, (u8 *)&checksum); | 3974 | &checksum); |
| 3982 | 3975 | ||
| 3983 | if (digest != checksum) { | 3976 | if (digest != checksum) { |
| 3984 | pr_err("HeaderDigest CRC32C failed," | 3977 | pr_err("HeaderDigest CRC32C failed," |
