Re: [PATCH 08/11] IB/iser: Support T10-PI operations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2014-02-23 at 14:19 +0200, Sagi Grimberg wrote:
> Add logic to initialize protection information entities.
> Upon each iSCSI task, we keep the scsi_cmnd in order to
> query the scsi protection operations and reference to
> protection buffers.
> 
> Modify iser_fast_reg_mr to receive indication weather it
> is registering the data or protection buffers.
> 
> In addition Introduce iser_reg_sig_mr which performs fast
> registration work-request for a signature enabled memory region
> (IB_WR_REG_SIG_MR). In this routine we set all the protection
> relevants for the device to offload protection data-transfer
> and verification.
> 
> Signed-off-by: Sagi Grimberg <sagig@xxxxxxxxxxxx>
> ---
>  drivers/infiniband/ulp/iser/iscsi_iser.c     |    2 +
>  drivers/infiniband/ulp/iser/iscsi_iser.h     |    8 +
>  drivers/infiniband/ulp/iser/iser_initiator.c |   41 ++++-
>  drivers/infiniband/ulp/iser/iser_memory.c    |  255 +++++++++++++++++++++++---
>  4 files changed, 280 insertions(+), 26 deletions(-)
> 

<SNIP>

> diff --git a/drivers/infiniband/ulp/iser/iser_memory.c b/drivers/infiniband/ulp/iser/iser_memory.c
> index 3edab18..9729aae 100644
> --- a/drivers/infiniband/ulp/iser/iser_memory.c
> +++ b/drivers/infiniband/ulp/iser/iser_memory.c

<SNIP>

> @@ -471,35 +646,42 @@ static int iser_fast_reg_mr(struct iscsi_iser_task *iser_task,
>  		return 0;
>  	}
>  
> -	plen = iser_sg_to_page_vec(mem, device->ib_device,
> -				   desc->data_frpl->page_list,
> +	if (ind == ISER_DATA_KEY_VALID) {
> +		mr = desc->data_mr;
> +		frpl = desc->data_frpl;
> +	} else {
> +		mr = desc->pi_ctx->prot_mr;
> +		frpl = desc->pi_ctx->prot_frpl;
> +	}
> +
> +	plen = iser_sg_to_page_vec(mem, device->ib_device, frpl->page_list,
>  				   &offset, &size);
>  	if (plen * SIZE_4K < size) {
>  		iser_err("fast reg page_list too short to hold this SG\n");
>  		return -EINVAL;
>  	}
>  
> -	if (!(desc->reg_indicators & ISER_DATA_KEY_VALID)) {
> +	if (!(desc->reg_indicators & ind)) {
>  		memset(&inv_wr, 0, sizeof(inv_wr));
>  		inv_wr.wr_id = ISER_FRWR_LI_WRID;
>  		inv_wr.opcode = IB_WR_LOCAL_INV;
> -		inv_wr.ex.invalidate_rkey = desc->data_mr->rkey;
> +		inv_wr.ex.invalidate_rkey = mr->rkey;
>  		wr = &inv_wr;
>  		/* Bump the key */
> -		key = (u8)(desc->data_mr->rkey & 0x000000FF);
> -		ib_update_fast_reg_key(desc->data_mr, ++key);
> +		key = (u8)(mr->rkey & 0x000000FF);
> +		ib_update_fast_reg_key(mr, ++key);
>  	}
>  
>  	/* Prepare FASTREG WR */
>  	memset(&fastreg_wr, 0, sizeof(fastreg_wr));
>  	fastreg_wr.wr_id = ISER_FRWR_LI_WRID;
>  	fastreg_wr.opcode = IB_WR_FAST_REG_MR;
> -	fastreg_wr.wr.fast_reg.iova_start = desc->data_frpl->page_list[0] + offset;
> -	fastreg_wr.wr.fast_reg.page_list = desc->data_frpl;
> +	fastreg_wr.wr.fast_reg.iova_start = frpl->page_list[0] + offset;
> +	fastreg_wr.wr.fast_reg.page_list = frpl;
>  	fastreg_wr.wr.fast_reg.page_list_len = plen;
>  	fastreg_wr.wr.fast_reg.page_shift = SHIFT_4K;
>  	fastreg_wr.wr.fast_reg.length = size;
> -	fastreg_wr.wr.fast_reg.rkey = desc->data_mr->rkey;
> +	fastreg_wr.wr.fast_reg.rkey = mr->rkey;
>  	fastreg_wr.wr.fast_reg.access_flags = (IB_ACCESS_LOCAL_WRITE  |
>  					       IB_ACCESS_REMOTE_WRITE |
>  					       IB_ACCESS_REMOTE_READ);

This one did not apply on v3.14-rc2 either.  Fixed up the context
change.

Please verify this patch in target-pending/rdma-dif is what you expect.

--nab

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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux