public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Or Gerlitz <ogerlitz@mellanox.com>
To: Sagi Grimberg <sagig@dev.mellanox.co.il>,
	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 16:12:50 +0200	[thread overview]
Message-ID: <52D2A2E2.6040502@mellanox.com> (raw)
In-Reply-To: <52D28D96.9000207@dev.mellanox.co.il>

On 12/01/2014 14:41, Sagi Grimberg wrote:
>>> --- 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. 

I didn't note there are so many booleans there... sure, my personal 
preference is compaction, e.g have one field names flags and multiple 
bit locations marking the different flags e.g

FAST_REG_DESC_VALID
FAST_REG_DESC_DATA_KEY_VALID
FAST_REG_DESC_PROTECTED
etc

  reply	other threads:[~2014-01-12 14:12 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
     [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 06/11] IB/isert: Initialize T10-PI resources Sagi Grimberg
2014-01-11 21:09   ` Or Gerlitz
2014-01-12 12:41     ` Sagi Grimberg
2014-01-12 14:12       ` Or Gerlitz [this message]
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
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=52D2A2E2.6040502@mellanox.com \
    --to=ogerlitz@mellanox.com \
    --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@dev.mellanox.co.il \
    --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