linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Manoj Kumar <manoj@linux.vnet.ibm.com>
To: wenxiong@linux.vnet.ibm.com, mrochs@linux.vnet.ibm.com,
	linux-scsi@vger.kernel.org,
	James.Bottomley@hansenpartnership.com, nab@linux-iscsi.org,
	brking@linux.vnet.ibm.com
Cc: hch@infradead.org, mikey@neuling.org, imunsie@au1.ibm.com,
	dja@ozlabs.au.ibm.com
Subject: Re: [PATCH v2 3/3] cxlflash: Virtual LUN support
Date: Thu, 30 Jul 2015 16:00:15 -0500	[thread overview]
Message-ID: <55BA905F.5030001@linux.vnet.ibm.com> (raw)
In-Reply-To: <20150729181309.Horde.6ofK41kNBwHDWXDMz0bHhw1@ltc.linux.ibm.com>

Wendy:

Thanks for taking the time to review this patch. Comments inline below.

- Manoj Kumar

On 7/29/2015 5:13 PM, wenxiong@linux.vnet.ibm.com wrote:
>> +    /* Update the free_curr_idx */
>> +    if (bit_pos == 63)
>> +        lun_info->free_curr_idx = bit_word + 1;
>
> Predefined Macros for 63 and 64?

Good point. We will add definitions to indicate that the bit_word is 8 
bytes.

>> +/**
>> + * ba_clone() - frees a block from the block allocator
>> + * @ba_lun:    Block allocator from which to allocate a block.
>> + * @to_free:    Block to free.
>> + *
>> + * Return: 0 on success, -1 on failure
>> + */
>
> More accurate description about ba_clone() function.

Good catch. Will correct in the next version of this patch (v3).

>> +    rc = ba_init(&blka->ba_lun);
>
> init_ba() and ba_init(). Probably one of them needs more accurate name.

Agreed. We will disambiguate in v3.

> free cmd_buf and sense_buf?

Same issue that Brian had pointed out. We had already corrected earlier. 
You will see it in our next submission.

>> +    mutex_unlock(&blka->mutex);
>> +
>
> Should hold the lock for lightwight sync?
>
>> +    /*
>> +     * The following sequence is prescribed in the SISlite spec
>> +     * for syncing up with the AFU when adding LXT entries.
>> +     */
>> +    dma_wmb(); /* Make LXT updates are visible */
>> +
>> +    rhte->lxt_start = lxt;
>> +    dma_wmb(); /* Make RHT entry's LXT table update visible */
>> +
>> +    rhte->lxt_cnt = my_new_size;
>> +    dma_wmb(); /* Make RHT entry's LXT table size update visible */
>> +
>> +    cxlflash_afu_sync(afu, ctxid, rhndl, AFU_LW_SYNC);
>> +

cxlflash_afu_sync() does ensure that only one of these SYNC commands is 
outstanding at one time. No additional serialization is required.

> Should hold the lock for lightwight sync?
>
>> +    cxlflash_afu_sync(afu, ctxid, rhndl, AFU_HW_SYNC);

Same issue as the one discussed above. No additional serialization 
should be necessary.

>> +        /* Setup the LUN table on the first call */
>> +        rc = init_lun_table(cfg, lli);
>> +        if (rc) {
>> +            pr_err("%s: call to init_lun_table failed rc=%d!\n",
>> +                   __func__, rc);
>> +            goto out;
>> +        }
>> +
>> +        rc = init_ba(lli);
>> +        if (rc) {
>> +            pr_err("%s: call to init_ba failed rc=%d!\n",
>> +                   __func__, rc);
>> +            rc = -ENOMEM;
>
> Do you need to remove the entry you create in init_lun_table() if
> init_ba() fails?

The LUN table is global to the adapter. If there are two threads 
creating two virtual LUNs concurrently, the first one inserts the LUN 
into the table. Cannot have that table entry be deleted, even if 
init_ba() fails, as the other thread could be using it.




      reply	other threads:[~2015-07-30 20:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-16 23:26 [PATCH v2 3/3] cxlflash: Virtual LUN support Matthew R. Ochs
2015-07-24 20:15 ` Brian King
2015-07-25 20:31   ` Matthew R. Ochs
     [not found] ` <55B13B1D.60804@linux.vnet.ibm.com>
2015-07-29 22:13   ` wenxiong
2015-07-30 21:00     ` Manoj Kumar [this message]

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=55BA905F.5030001@linux.vnet.ibm.com \
    --to=manoj@linux.vnet.ibm.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=brking@linux.vnet.ibm.com \
    --cc=dja@ozlabs.au.ibm.com \
    --cc=hch@infradead.org \
    --cc=imunsie@au1.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mikey@neuling.org \
    --cc=mrochs@linux.vnet.ibm.com \
    --cc=nab@linux-iscsi.org \
    --cc=wenxiong@linux.vnet.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).