public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagig@dev.mellanox.co.il>
To: Or Gerlitz <or.gerlitz@gmail.com>, Sagi Grimberg <sagig@mellanox.com>
Cc: target-devel <target-devel@vger.kernel.org>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	linux-rdma <linux-rdma@vger.kernel.org>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"Nicholas A. Bellinger" <nab@linux-iscsi.org>,
	"oren@mellanox.com" <oren@mellanox.com>
Subject: Re: [PATCH 06/11] IB/isert: Initialize T10-PI resources
Date: Sun, 12 Jan 2014 14:41:58 +0200	[thread overview]
Message-ID: <52D28D96.9000207@dev.mellanox.co.il> (raw)
In-Reply-To: <CAJZOPZLXNkf9XYFsDa3NcYKyySg2H_ARyrVzomYmbYQVqNRPLQ@mail.gmail.com>

On 1/11/2014 11:09 PM, Or Gerlitz wrote:
> On Thu, Jan 9, 2014 at 6:40 PM, Sagi Grimberg <sagig@mellanox.com> wrote:
>> @@ -557,8 +629,14 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
>>                  goto out_mr;
>>          }
>>
>> +       if (pi_support && !device->pi_capable) {
>> +               pr_err("Protection information requested but not supported\n");
>> +               ret = -EINVAL;
>> +               goto out_mr;
>> +       }
>> +
>>          if (device->use_fastreg) {
>> -               ret = isert_conn_create_fastreg_pool(isert_conn);
>> +               ret = isert_conn_create_fastreg_pool(isert_conn, pi_support);
> just a nit, the pi_support bit can be looked up from the isert_conn
> struct, isn't it?
>
>>                  if (ret) {
>>                          pr_err("Conn: %p failed to create fastreg pool\n",
>>                                 isert_conn);
>> @@ -566,7 +644,7 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
>>                  }
>>          }
>>
>> -       ret = isert_conn_setup_qp(isert_conn, cma_id);
>> +       ret = isert_conn_setup_qp(isert_conn, cma_id, pi_support);
>>          if (ret)
>>                  goto out_conn_dev;
>>
>> @@ -2193,7 +2271,7 @@ isert_fast_reg_mr(struct fast_reg_descriptor *fr_desc,
>>          pagelist_len = isert_map_fr_pagelist(ib_dev, sg_start, sg_nents,
>>                                               &fr_desc->data_frpl->page_list[0]);
>>
>> -       if (!fr_desc->valid) {
>> +       if (!fr_desc->data_key_valid) {
>>                  memset(&inv_wr, 0, sizeof(inv_wr));
>>                  inv_wr.opcode = IB_WR_LOCAL_INV;
>>                  inv_wr.ex.invalidate_rkey = fr_desc->data_mr->rkey;
>> @@ -2225,7 +2303,7 @@ isert_fast_reg_mr(struct fast_reg_descriptor *fr_desc,
>>                  pr_err("fast registration failed, ret:%d\n", ret);
>>                  return ret;
>>          }
>> -       fr_desc->valid = false;
>> +       fr_desc->data_key_valid = false;
>>
>>          ib_sge->lkey = fr_desc->data_mr->lkey;
>>          ib_sge->addr = fr_desc->data_frpl->page_list[0] + page_off;
>> diff --git a/drivers/infiniband/ulp/isert/ib_isert.h b/drivers/infiniband/ulp/isert/ib_isert.h
>> index 708a069..fab8b50 100644
>> --- a/drivers/infiniband/ulp/isert/ib_isert.h
>> +++ b/drivers/infiniband/ulp/isert/ib_isert.h
>> @@ -48,11 +48,21 @@ struct iser_tx_desc {
>>          struct ib_send_wr send_wr;
>>   } __packed;
>>
>> +struct pi_context {
>> +       struct ib_mr                   *prot_mr;
>> +       bool                            prot_key_valid;
>> +       struct ib_fast_reg_page_list   *prot_frpl;
>> +       struct ib_mr                   *sig_mr;
>> +       bool                            sig_key_valid;
>> +};
>> +
>>   struct fast_reg_descriptor {
>> -       struct list_head        list;
>> -       struct ib_mr            *data_mr;
>> -       struct ib_fast_reg_page_list    *data_frpl;
>> -       bool                    valid;
>> +       struct list_head                list;
>> +       struct ib_mr                   *data_mr;
>> +       bool                            data_key_valid;
>> +       struct ib_fast_reg_page_list   *data_frpl;
>> +       bool                            protected;
> no need for many bools in one structure... each one needs a bit,
> correct? so embed them in one variable

I figured it will be more explicit this way.
protected boolean indicates if we should check the data-integrity 
status, and the other 3 indicates if the relevant MR is valid (no need 
to execute local invalidation).
Do you think I should compact it somehow? usually xxx_valid booleans 
will align together although not always.

>
>> +       struct pi_context              *pi_ctx;
>>   };
>
>
>>   struct isert_rdma_wr {
>> @@ -140,6 +150,7 @@ struct isert_cq_desc {
>>
>>   struct isert_device {
>>          int                     use_fastreg;
>> +       bool                    pi_capable;
> this one (and its such) is/are derived from the ib device
> capabilities, so I would suggest to keep a copy of the caps instead of
> derived bools

Yes, I'll keep the device capabilities instead.

>
>>          int                     cqs_used;
>>          int                     refcount;
>>          int                     cq_active_qps[ISERT_MAX_CQ];
> --
> To unsubscribe from this list: send the line "unsubscribe target-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2014-01-12 12:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-09 16:40 [PATCH 00/11] iSER target initial support for T10-DIF offload Sagi Grimberg
2014-01-09 16:40 ` [PATCH 01/11] Target/core: Fixes for isert compilation Sagi Grimberg
2014-01-09 16:40 ` [PATCH 04/11] IB/isert: Move fastreg descriptor creation to a function Sagi Grimberg
     [not found]   ` <1389285658-7037-5-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2014-01-13 19:45     ` Nicholas A. Bellinger
2014-01-09 16:40 ` [PATCH 06/11] IB/isert: Initialize T10-PI resources Sagi Grimberg
2014-01-11 21:09   ` Or Gerlitz
2014-01-12 12:41     ` Sagi Grimberg [this message]
2014-01-12 14:12       ` Or Gerlitz
2014-01-09 16:40 ` [PATCH 07/11] IB/isert: pass scatterlist instead of cmd to fast_reg_mr routine Sagi Grimberg
2014-01-13 19:45   ` Nicholas A. Bellinger
     [not found] ` <1389285658-7037-1-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2014-01-09 16:40   ` [PATCH 02/11] IB/isert: seperate connection protection domains and dma MRs Sagi Grimberg
2014-01-13 19:44     ` Nicholas A. Bellinger
2014-01-09 16:40   ` [PATCH 03/11] IB/isert: Avoid frwr notation, user fastreg Sagi Grimberg
2014-01-13 19:44     ` Nicholas A. Bellinger
2014-01-09 16:40   ` [PATCH 05/11] Target/iscsi: Add T10-PI indication for iscsi_portal_group Sagi Grimberg
2014-01-09 16:40   ` [PATCH 08/11] IB/isert: pass mr and frpl to isert_fast_reg_mr routine Sagi Grimberg
2014-01-09 16:40 ` [PATCH 09/11] IB/isert: Accept RDMA_WRITE completions Sagi Grimberg
2014-01-11 21:14   ` Or Gerlitz
2014-01-12 12:32     ` Sagi Grimberg
2014-01-09 16:40 ` [PATCH 10/11] IB/isert: Support T10-PI protected transactions Sagi Grimberg
2014-01-09 16:40 ` [PATCH 11/11] Target/configfs: Expose iSCSI network portal group T10-PI support Sagi Grimberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52D28D96.9000207@dev.mellanox.co.il \
    --to=sagig@dev.mellanox.co.il \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=nab@linux-iscsi.org \
    --cc=or.gerlitz@gmail.com \
    --cc=oren@mellanox.com \
    --cc=sagig@mellanox.com \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox