diff mbox

[v2,00/12] T10-DIF Initial support for iSER target

Message ID 1392851690.22195.7.camel@haakon3.risingtidesystems.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Nicholas A. Bellinger Feb. 19, 2014, 11:14 p.m. UTC
On Wed, 2014-02-19 at 17:50 +0200, Sagi Grimberg wrote:
> Hey Nic,
> 
> I addressed your comments in the this set. I'll try to send the
> initiator code for review in the next couple of days.
> 
> This patchset introduces target side T10-PI offload support over
> RDMA. Currently the implementation is for iSER transport but can
> be easily extended to SRP (or FCoE in the future).
> 
> Should mention that this patchset depends on RDMA signature
> verbs making it for inclusion which will hopefully happen in
> near future.
> 
> This code was tested against iSER legacy initiator, and also
> initiator that uses T10-PI offload as well. I'll clean up the
> initiator code in the following days and submit that as well.
> 
> This code works under medium loads using backstores:
> - FileIO with DIF emulation.
> - RD with DIF emulation.
> - iBLOCK (scsi_debug with DIF support).
> 
> Chnages from v1:
> - Rebased rdma_dif (3.14-rc2)
> - Target core:
>   - Pass zero_flag=true to alloc_sgl for protection buffers
>   - Removed Unneeded inline function rwprotect
>   - Pass is_write bool to sbc_set_prot_op_checks
>   - Send failure response for absence of protection buffers
>     when needed.
> - iSER:
>   - Removed unneeded assignments in isert_set_sig_attrs
> 
> Chnages from v0:
> - Rebased from for-next
> - Target core:
>   - Don't minor fixes for check_prot - to support transports
>     that doesn't use submit_map_sgls.
>   - file  format - use escape values.
>   - Removed redundant prot_handover.
>   - Added protection checks and operation set.
> - iSER:
>   - Added preperation routines for mapping/unmapping buffers
>     to ease the amount of code in isert_reg_rdma.
>   - Fixed print of DIF error (sector instead of offset).
>   - Fix RDMA length for protection on wire domain.
>   - Refactored reg_sig_mr to use helper routines.
> 

Hey Sagi,

FYI, this series did not compile:

drivers/infiniband/ulp/isert/ib_isert.c: In function ‘isert_reg_sig_mr’:
drivers/infiniband/ulp/isert/ib_isert.c:2531:2: error: expected ‘;’ before ‘ret’
drivers/infiniband/ulp/isert/ib_isert.c: In function ‘isert_reg_rdma’:
drivers/infiniband/ulp/isert/ib_isert.c:2611:24: warning: comparison between ‘enum target_prot_type’ and ‘enum target_prot_op’ [-Wenum-compare]
drivers/infiniband/ulp/isert/ib_isert.c:2625:24: warning: comparison between ‘enum target_prot_type’ and ‘enum target_prot_op’ [-Wenum-compare]
drivers/infiniband/ulp/isert/ib_isert.c:2667:43: warning: comparison between ‘enum target_prot_type’ and ‘enum target_prot_op’ [-Wenum-compare]
drivers/infiniband/ulp/isert/ib_isert.c: In function ‘isert_put_datain’:
drivers/infiniband/ulp/isert/ib_isert.c:2711:24: warning: comparison between ‘enum target_prot_type’ and ‘enum target_prot_op’ [-Wenum-compare]
drivers/infiniband/ulp/isert/ib_isert.c:2732:24: warning: comparison between ‘enum target_prot_type’ and ‘enum target_prot_op’ [-Wenum-compare]
drivers/infiniband/ulp/isert/ib_isert.c: At top level:
drivers/infiniband/ulp/isert/ib_isert.c:2468:1: warning: ‘isert_set_sig_attrs’ defined but not used [-Wunused-function]
drivers/target/target_core_transport.c: In function ‘transport_generic_new_cmd’:
drivers/target/target_core_transport.c:2221:22: warning: comparison between ‘enum target_prot_type’ and ‘enum target_prot_op’ [-Wenum-compare]

Squashing the following patch(es) into your original series, and applied
to target-pending/rdma-dif.

Thank you,

--nab



--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Sagi Grimberg Feb. 20, 2014, 12:51 p.m. UTC | #1
On 2/20/2014 1:14 AM, Nicholas A. Bellinger wrote:
> On Wed, 2014-02-19 at 17:50 +0200, Sagi Grimberg wrote:
>> Hey Nic,
>>
>> I addressed your comments in the this set. I'll try to send the
>> initiator code for review in the next couple of days.
>>
>> This patchset introduces target side T10-PI offload support over
>> RDMA. Currently the implementation is for iSER transport but can
>> be easily extended to SRP (or FCoE in the future).
>>
>> Should mention that this patchset depends on RDMA signature
>> verbs making it for inclusion which will hopefully happen in
>> near future.
>>
>> This code was tested against iSER legacy initiator, and also
>> initiator that uses T10-PI offload as well. I'll clean up the
>> initiator code in the following days and submit that as well.
>>
>> This code works under medium loads using backstores:
>> - FileIO with DIF emulation.
>> - RD with DIF emulation.
>> - iBLOCK (scsi_debug with DIF support).
>>
>> Chnages from v1:
>> - Rebased rdma_dif (3.14-rc2)
>> - Target core:
>>    - Pass zero_flag=true to alloc_sgl for protection buffers
>>    - Removed Unneeded inline function rwprotect
>>    - Pass is_write bool to sbc_set_prot_op_checks
>>    - Send failure response for absence of protection buffers
>>      when needed.
>> - iSER:
>>    - Removed unneeded assignments in isert_set_sig_attrs
>>
>> Chnages from v0:
>> - Rebased from for-next
>> - Target core:
>>    - Don't minor fixes for check_prot - to support transports
>>      that doesn't use submit_map_sgls.
>>    - file  format - use escape values.
>>    - Removed redundant prot_handover.
>>    - Added protection checks and operation set.
>> - iSER:
>>    - Added preperation routines for mapping/unmapping buffers
>>      to ease the amount of code in isert_reg_rdma.
>>    - Fixed print of DIF error (sector instead of offset).
>>    - Fix RDMA length for protection on wire domain.
>>    - Refactored reg_sig_mr to use helper routines.
>>
> Hey Sagi,
>
> FYI, this series did not compile:
>
> drivers/infiniband/ulp/isert/ib_isert.c: In function ‘isert_reg_sig_mr’:
> drivers/infiniband/ulp/isert/ib_isert.c:2531:2: error: expected ‘;’ before ‘ret’
> drivers/infiniband/ulp/isert/ib_isert.c: In function ‘isert_reg_rdma’:
> drivers/infiniband/ulp/isert/ib_isert.c:2611:24: warning: comparison between ‘enum target_prot_type’ and ‘enum target_prot_op’ [-Wenum-compare]
> drivers/infiniband/ulp/isert/ib_isert.c:2625:24: warning: comparison between ‘enum target_prot_type’ and ‘enum target_prot_op’ [-Wenum-compare]
> drivers/infiniband/ulp/isert/ib_isert.c:2667:43: warning: comparison between ‘enum target_prot_type’ and ‘enum target_prot_op’ [-Wenum-compare]
> drivers/infiniband/ulp/isert/ib_isert.c: In function ‘isert_put_datain’:
> drivers/infiniband/ulp/isert/ib_isert.c:2711:24: warning: comparison between ‘enum target_prot_type’ and ‘enum target_prot_op’ [-Wenum-compare]
> drivers/infiniband/ulp/isert/ib_isert.c:2732:24: warning: comparison between ‘enum target_prot_type’ and ‘enum target_prot_op’ [-Wenum-compare]
> drivers/infiniband/ulp/isert/ib_isert.c: At top level:
> drivers/infiniband/ulp/isert/ib_isert.c:2468:1: warning: ‘isert_set_sig_attrs’ defined but not used [-Wunused-function]
> drivers/target/target_core_transport.c: In function ‘transport_generic_new_cmd’:
> drivers/target/target_core_transport.c:2221:22: warning: comparison between ‘enum target_prot_type’ and ‘enum target_prot_op’ [-Wenum-compare]
>
> Squashing the following patch(es) into your original series, and applied
> to target-pending/rdma-dif.

Ohhh, last second cosmetics...

Thanks for fixing it, won't happen again...

> Thank you,

Thank you...

> --nab
>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.
index 04bdd79..b7c8cd7 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -2527,7 +2527,7 @@  isert_reg_sig_mr(struct isert_conn *isert_conn, struct se_cmd *se_cmd,
        int ret;
        u32 key;
 
-       memset(&sig_attrs, 0, sizeof(sig_attrs))
+       memset(&sig_attrs, 0, sizeof(sig_attrs));
        ret = isert_set_sig_attrs(se_cmd, &sig_attrs);
        if (ret)
                goto err;
@@ -2608,7 +2608,7 @@  isert_reg_rdma(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
                return ret;
 
        if (wr->data.dma_nents != 1 ||
-           se_cmd->prot_type != TARGET_PROT_NORMAL) {
+           se_cmd->prot_op != TARGET_PROT_NORMAL) {
                spin_lock_irqsave(&isert_conn->conn_lock, flags);
                fr_desc = list_first_entry(&isert_conn->conn_fr_pool,
                                           struct fast_reg_descriptor, list);
@@ -2622,7 +2622,7 @@  isert_reg_rdma(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
        if (ret)
                goto unmap_cmd;
 
-       if (se_cmd->prot_type != TARGET_PROT_NORMAL) {
+       if (se_cmd->prot_op != TARGET_PROT_NORMAL) {
                struct ib_sge prot_sge, sig_sge;
 
                if (se_cmd->t_prot_sg) {
@@ -2664,7 +2664,7 @@  isert_reg_rdma(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
                send_wr->opcode = IB_WR_RDMA_WRITE;
                send_wr->wr.rdma.remote_addr = isert_cmd->read_va;
                send_wr->wr.rdma.rkey = isert_cmd->read_stag;
-               send_wr->send_flags = se_cmd->prot_type == TARGET_PROT_NORMAL ?
+               send_wr->send_flags = se_cmd->prot_op == TARGET_PROT_NORMAL ?
                                      0 : IB_SEND_SIGNALED;
        } else {
                send_wr->opcode = IB_WR_RDMA_READ;
@@ -2708,7 +2708,7 @@  isert_put_datain(struct iscsi_conn *conn, struct iscsi_cmd *cmd)
                return rc;
        }
 
-       if (se_cmd->prot_type == TARGET_PROT_NORMAL) {
+       if (se_cmd->prot_op == TARGET_PROT_NORMAL) {
                /*
                 * Build isert_conn->tx_desc for iSCSI response PDU and attach
                 */
@@ -2729,7 +2729,7 @@  isert_put_datain(struct iscsi_conn *conn, struct iscsi_cmd *cmd)
                atomic_dec(&isert_conn->post_send_buf_count);
        }
 
-       if (se_cmd->prot_type == TARGET_PROT_NORMAL)
+       if (se_cmd->prot_op == TARGET_PROT_NORMAL)
                pr_debug("Cmd: %p posted RDMA_WRITE + Response for iSER Data "
                         "READ\n", isert_cmd);
        else
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index a45d628..954e7ed 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -2218,7 +2218,7 @@  transport_generic_new_cmd(struct se_cmd *cmd)
                                return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
                }
 
-               if (cmd->prot_type != TARGET_PROT_NORMAL) {
+               if (cmd->prot_op != TARGET_PROT_NORMAL) {
                        ret = target_alloc_sgl(&cmd->t_prot_sg,
                                               &cmd->t_prot_nents,
                                               cmd->prot_length, true);