diff options
author | Jayamohan Kallickal <jayamohank@serverengines.com> | 2010-01-22 19:08:18 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-02-08 19:34:16 -0500 |
commit | caf818f118b1ea60226a884072f1c3a9d5714766 (patch) | |
tree | 089670c5651b6e81aeb2e092a5eb2b87707f2f73 /drivers/scsi/be2iscsi | |
parent | f55a24f2c24b63f8b4329eb28b4aec02a4bcf5d0 (diff) |
[SCSI] be2iscsi: Ensure clean reuse of wrb
This patch ensures that wrb is cleanly resued for io path
and is memset to zero for non io path
Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/be2iscsi')
-rw-r--r-- | drivers/scsi/be2iscsi/be_main.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index 6b700ad2bb47..85c0e80628a8 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c | |||
@@ -1663,11 +1663,7 @@ hwi_write_sgl(struct iscsi_wrb *pwrb, struct scatterlist *sg, | |||
1663 | AMAP_SET_BITS(struct amap_iscsi_wrb, sge0_len, pwrb, | 1663 | AMAP_SET_BITS(struct amap_iscsi_wrb, sge0_len, pwrb, |
1664 | sg_len); | 1664 | sg_len); |
1665 | sge_len = sg_len; | 1665 | sge_len = sg_len; |
1666 | AMAP_SET_BITS(struct amap_iscsi_wrb, sge0_last, pwrb, | ||
1667 | 1); | ||
1668 | } else { | 1666 | } else { |
1669 | AMAP_SET_BITS(struct amap_iscsi_wrb, sge0_last, pwrb, | ||
1670 | 0); | ||
1671 | AMAP_SET_BITS(struct amap_iscsi_wrb, sge1_r2t_offset, | 1667 | AMAP_SET_BITS(struct amap_iscsi_wrb, sge1_r2t_offset, |
1672 | pwrb, sge_len); | 1668 | pwrb, sge_len); |
1673 | sg_len = sg_dma_len(sg); | 1669 | sg_len = sg_dma_len(sg); |
@@ -1690,8 +1686,22 @@ hwi_write_sgl(struct iscsi_wrb *pwrb, struct scatterlist *sg, | |||
1690 | AMAP_SET_BITS(struct amap_iscsi_sge, addr_lo, psgl, | 1686 | AMAP_SET_BITS(struct amap_iscsi_sge, addr_lo, psgl, |
1691 | io_task->bhs_pa.u.a32.address_lo); | 1687 | io_task->bhs_pa.u.a32.address_lo); |
1692 | 1688 | ||
1693 | if (num_sg == 2) | 1689 | if (num_sg == 1) { |
1694 | AMAP_SET_BITS(struct amap_iscsi_wrb, sge1_last, pwrb, 1); | 1690 | AMAP_SET_BITS(struct amap_iscsi_wrb, sge0_last, pwrb, |
1691 | 1); | ||
1692 | AMAP_SET_BITS(struct amap_iscsi_wrb, sge1_last, pwrb, | ||
1693 | 0); | ||
1694 | } else if (num_sg == 2) { | ||
1695 | AMAP_SET_BITS(struct amap_iscsi_wrb, sge0_last, pwrb, | ||
1696 | 0); | ||
1697 | AMAP_SET_BITS(struct amap_iscsi_wrb, sge1_last, pwrb, | ||
1698 | 1); | ||
1699 | } else { | ||
1700 | AMAP_SET_BITS(struct amap_iscsi_wrb, sge0_last, pwrb, | ||
1701 | 0); | ||
1702 | AMAP_SET_BITS(struct amap_iscsi_wrb, sge1_last, pwrb, | ||
1703 | 0); | ||
1704 | } | ||
1695 | sg = l_sg; | 1705 | sg = l_sg; |
1696 | psgl++; | 1706 | psgl++; |
1697 | psgl++; | 1707 | psgl++; |
@@ -3476,6 +3486,7 @@ static int beiscsi_mtask(struct iscsi_task *task) | |||
3476 | 3486 | ||
3477 | cid = beiscsi_conn->beiscsi_conn_cid; | 3487 | cid = beiscsi_conn->beiscsi_conn_cid; |
3478 | pwrb = io_task->pwrb_handle->pwrb; | 3488 | pwrb = io_task->pwrb_handle->pwrb; |
3489 | memset(pwrb, 0, sizeof(*pwrb)); | ||
3479 | AMAP_SET_BITS(struct amap_iscsi_wrb, cmdsn_itt, pwrb, | 3490 | AMAP_SET_BITS(struct amap_iscsi_wrb, cmdsn_itt, pwrb, |
3480 | be32_to_cpu(task->cmdsn)); | 3491 | be32_to_cpu(task->cmdsn)); |
3481 | AMAP_SET_BITS(struct amap_iscsi_wrb, wrb_idx, pwrb, | 3492 | AMAP_SET_BITS(struct amap_iscsi_wrb, wrb_idx, pwrb, |