Skip to content

Commit

Permalink
iser-target: Rename sense_buf_[dma,len] to pdu_[dma,len]
Browse files Browse the repository at this point in the history
Now that these two variables are used for REJECT payloads as well
as SCSI response sense payloads, rename them to something that
makes more sense.

Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  • Loading branch information
Nicholas Bellinger committed Jul 8, 2013
1 parent c5a2adb commit dbbc5d1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
30 changes: 15 additions & 15 deletions drivers/infiniband/ulp/isert/ib_isert.c
Original file line number Diff line number Diff line change
Expand Up @@ -1286,11 +1286,11 @@ static void
isert_completion_put(struct iser_tx_desc *tx_desc, struct isert_cmd *isert_cmd,
struct ib_device *ib_dev)
{
if (isert_cmd->sense_buf_dma != 0) {
pr_debug("Calling ib_dma_unmap_single for isert_cmd->sense_buf_dma\n");
ib_dma_unmap_single(ib_dev, isert_cmd->sense_buf_dma,
isert_cmd->sense_buf_len, DMA_TO_DEVICE);
isert_cmd->sense_buf_dma = 0;
if (isert_cmd->pdu_buf_dma != 0) {
pr_debug("Calling ib_dma_unmap_single for isert_cmd->pdu_buf_dma\n");
ib_dma_unmap_single(ib_dev, isert_cmd->pdu_buf_dma,
isert_cmd->pdu_buf_len, DMA_TO_DEVICE);
isert_cmd->pdu_buf_dma = 0;
}

isert_unmap_tx_desc(tx_desc, ib_dev);
Expand Down Expand Up @@ -1588,23 +1588,23 @@ isert_put_response(struct iscsi_conn *conn, struct iscsi_cmd *cmd)
(cmd->se_cmd.se_cmd_flags & SCF_EMULATED_TASK_SENSE))) {
struct ib_device *ib_dev = isert_conn->conn_cm_id->device;
struct ib_sge *tx_dsg = &isert_cmd->tx_desc.tx_sg[1];
u32 padding, sense_len;
u32 padding, pdu_len;

put_unaligned_be16(cmd->se_cmd.scsi_sense_length,
cmd->sense_buffer);
cmd->se_cmd.scsi_sense_length += sizeof(__be16);

padding = -(cmd->se_cmd.scsi_sense_length) & 3;
hton24(hdr->dlength, (u32)cmd->se_cmd.scsi_sense_length);
sense_len = cmd->se_cmd.scsi_sense_length + padding;
pdu_len = cmd->se_cmd.scsi_sense_length + padding;

isert_cmd->sense_buf_dma = ib_dma_map_single(ib_dev,
(void *)cmd->sense_buffer, sense_len,
isert_cmd->pdu_buf_dma = ib_dma_map_single(ib_dev,
(void *)cmd->sense_buffer, pdu_len,
DMA_TO_DEVICE);

isert_cmd->sense_buf_len = sense_len;
tx_dsg->addr = isert_cmd->sense_buf_dma;
tx_dsg->length = sense_len;
isert_cmd->pdu_buf_len = pdu_len;
tx_dsg->addr = isert_cmd->pdu_buf_dma;
tx_dsg->length = pdu_len;
tx_dsg->lkey = isert_conn->conn_mr->lkey;
isert_cmd->tx_desc.num_sge = 2;
}
Expand Down Expand Up @@ -1692,11 +1692,11 @@ isert_put_reject(struct iscsi_cmd *cmd, struct iscsi_conn *conn)
isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc);

hton24(hdr->dlength, ISCSI_HDR_LEN);
isert_cmd->sense_buf_dma = ib_dma_map_single(ib_dev,
isert_cmd->pdu_buf_dma = ib_dma_map_single(ib_dev,
(void *)cmd->buf_ptr, ISCSI_HDR_LEN,
DMA_TO_DEVICE);
isert_cmd->sense_buf_len = ISCSI_HDR_LEN;
tx_dsg->addr = isert_cmd->sense_buf_dma;
isert_cmd->pdu_buf_len = ISCSI_HDR_LEN;
tx_dsg->addr = isert_cmd->pdu_buf_dma;
tx_dsg->length = ISCSI_HDR_LEN;
tx_dsg->lkey = isert_conn->conn_mr->lkey;
isert_cmd->tx_desc.num_sge = 2;
Expand Down
4 changes: 2 additions & 2 deletions drivers/infiniband/ulp/isert/ib_isert.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ struct isert_cmd {
uint32_t write_stag;
uint64_t read_va;
uint64_t write_va;
u64 sense_buf_dma;
u32 sense_buf_len;
u64 pdu_buf_dma;
u32 pdu_buf_len;
u32 read_va_off;
u32 write_va_off;
u32 rdma_wr_num;
Expand Down

0 comments on commit dbbc5d1

Please sign in to comment.