Message ID | 1447691861-3796-5-git-send-email-sagig@mellanox.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
On 11/16/2015 6:37 PM, Sagi Grimberg wrote: > This parameter is described as "is mr valid indicator". > In other words, it indicates whether memory registration > is valid or not. So intuitive values would be: > mr_valid=True, when memory registration is valid and > mr_valid=False otherwise. and what was there before? the other way around? on what cases the indicator is false (with the new semantics)? Also, we have a convention of starting commit titles with capital letters, please follow on that "Set iser [...]" -- 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
On 17/11/2015 09:43, Or Gerlitz wrote: > On 11/16/2015 6:37 PM, Sagi Grimberg wrote: >> This parameter is described as "is mr valid indicator". >> In other words, it indicates whether memory registration >> is valid or not. So intuitive values would be: >> mr_valid=True, when memory registration is valid and >> mr_valid=False otherwise. > > and what was there before? the other way around? > > on what cases the indicator is false (with the new semantics)? This is just an attempt to fix the confusing semantics I gave these flags. If the MR is valid it needs invalidation, that's it... > > Also, we have a convention of starting commit titles with capital > letters, please follow on that "Set iser [...]" Will fix... -- 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 --git a/drivers/infiniband/ulp/iser/iser_memory.c b/drivers/infiniband/ulp/iser/iser_memory.c index e500d0df7b85..fb676ae25c42 100644 --- a/drivers/infiniband/ulp/iser/iser_memory.c +++ b/drivers/infiniband/ulp/iser/iser_memory.c @@ -446,7 +446,7 @@ iser_reg_sig_mr(struct iscsi_iser_task *iser_task, iser_set_prot_checks(iser_task->sc, &sig_attrs->check_mask); - if (!pi_ctx->sig_mr_valid) + if (pi_ctx->sig_mr_valid) iser_inv_rkey(iser_tx_next_wr(tx_desc), pi_ctx->sig_mr); wr = sig_handover_wr(iser_tx_next_wr(tx_desc)); @@ -464,7 +464,7 @@ iser_reg_sig_mr(struct iscsi_iser_task *iser_task, wr->access_flags = IB_ACCESS_LOCAL_WRITE | IB_ACCESS_REMOTE_READ | IB_ACCESS_REMOTE_WRITE; - pi_ctx->sig_mr_valid = 0; + pi_ctx->sig_mr_valid = 1; sig_reg->sge.lkey = pi_ctx->sig_mr->lkey; sig_reg->rkey = pi_ctx->sig_mr->rkey; @@ -488,7 +488,7 @@ static int iser_fast_reg_mr(struct iscsi_iser_task *iser_task, struct ib_reg_wr *wr; int n; - if (!rsc->mr_valid) + if (rsc->mr_valid) iser_inv_rkey(iser_tx_next_wr(tx_desc), mr); n = ib_map_mr_sg(mr, mem->sg, mem->size, SIZE_4K); @@ -509,7 +509,7 @@ static int iser_fast_reg_mr(struct iscsi_iser_task *iser_task, IB_ACCESS_REMOTE_WRITE | IB_ACCESS_REMOTE_READ; - rsc->mr_valid = 0; + rsc->mr_valid = 1; reg->sge.lkey = mr->lkey; reg->rkey = mr->rkey; diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index a66b9dea96d8..09121e774d14 100644 --- a/drivers/infiniband/ulp/iser/iser_verbs.c +++ b/drivers/infiniband/ulp/iser/iser_verbs.c @@ -299,7 +299,7 @@ iser_alloc_reg_res(struct ib_device *ib_device, iser_err("Failed to allocate ib_fast_reg_mr err=%d\n", ret); return ret; } - res->mr_valid = 1; + res->mr_valid = 0; return 0; } @@ -336,7 +336,7 @@ iser_alloc_pi_ctx(struct ib_device *ib_device, ret = PTR_ERR(pi_ctx->sig_mr); goto sig_mr_failure; } - pi_ctx->sig_mr_valid = 1; + pi_ctx->sig_mr_valid = 0; desc->pi_ctx->sig_protected = 0; return 0;