[PATCH 3/7] nvme-fcloop: use IDA for port ids

Hannes Reinecke hare at suse.de
Fri Oct 9 09:57:09 EDT 2020


On 10/5/20 7:33 PM, James Smart wrote:
> On 9/22/2020 5:14 AM, Hannes Reinecke wrote:
>> Use an IDA to register port IDs to avoid duplicate port IDs. It
>> also will generate a unique port ID if none is specified.
> 
> I'd prefer a little more description as I didn't pick up what this 
> actually did from the comment.  Meaning: Add auto-address assignment if 
> one isn't specified. Use an ida for allocation for uniqueness. Use 
> user-supplied addresses as long as not in use and within range supported 
> for ida.
> 

Ok.

>> Signed-off-by: Hannes Reinecke <hare at suse.de>
>> ---
>>   drivers/nvme/target/fcloop.c | 51 
>> +++++++++++++++++++++++++++++++++++++-------
>>   1 file changed, 43 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/nvme/target/fcloop.c b/drivers/nvme/target/fcloop.c
>> index 082aa4dee406..e56f323fa7d4 100644
>> --- a/drivers/nvme/target/fcloop.c
>> +++ b/drivers/nvme/target/fcloop.c
>> @@ -12,6 +12,7 @@
>>   #include <linux/nvme-fc-driver.h>
>>   #include <linux/nvme-fc.h>
>> +#define FCLOOP_MAX_AL_PA 0xEF
> 
> This is odd - no reason to bring in ALPA's and arb loop.   Please rename 
> it to state it's the max address value allowed.  I'd prefer if this was 
> a 24 bit value, but that won't matter much and 255 is fine.
> 
Hehe; yeah, pulling in ALPA etc is probably not necessary.
But I wanted to restrict things to less than 255 to get alignment with 
real PtP Port IDs.

I'll be resending the patchset.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare at suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer



More information about the Linux-nvme mailing list