All of lore.kernel.org
 help / color / mirror / Atom feed
From: jsmart2021@gmail.com (James Smart)
Subject: [PATCH 04/17] lpfc: NVME Initiator: Base modifications Part C
Date: Wed, 18 Jan 2017 18:54:37 -0800	[thread overview]
Message-ID: <784acc16-b284-6159-4399-dfd39ae1a8bd@gmail.com> (raw)
In-Reply-To: <20170118110304.GD3514@linux-x5ow.site>



On 1/18/2017 3:03 AM, Johannes Thumshirn wrote:
>
>> +	/* maximum number of xris available for nvme buffers */
>> +	els_xri_cnt = lpfc_sli4_get_els_iocb_cnt(phba);
>> +	phba->sli4_hba.nvme_xri_max = phba->sli4_hba.max_cfg_param.max_xri -
>> +				      els_xri_cnt;
>> +	phba->sli4_hba.nvme_xri_max -= phba->sli4_hba.scsi_xri_max;
> 	nvme_xri_max = phba->sli4_hba.max_cfg_param.max_xri - els_xri_cnt;
> 	nvme_xri_max -= phba->sli4_hba.scsi_xri_max;
> 	phba->sli4_hba.nvme_xri_max = nvme_xri_max;
>
> Low hanging anti line-break fruit.

ok - but I didn't think that a style change like this is a mandate.   As 
I'm addressing your other comments, I'll do so.


>>   		}
>> @@ -4273,13 +4489,13 @@ lpfc_sli4_async_sli_evt(struct lpfc_hba *phba, struct lpfc_acqe_sli *acqe_sli)
>>   			sprintf(message, "Unqualified optics - Replace with "
>>   				"Avago optics for Warranty and Technical "
> Is Avago still correct, or should it read Broadcom?

It's right - Avago.


>> @@ -4854,17 +5070,20 @@ static int
>>   lpfc_enable_pci_dev(struct lpfc_hba *phba)
>>   {
>>   	struct pci_dev *pdev;
>> +	int bars = 0;
>>   
>>   	/* Obtain PCI device reference */
>>   	if (!phba->pcidev)
>>   		goto out_error;
>>   	else
>>   		pdev = phba->pcidev;
>> +	/* Select PCI BARs */
>> +	bars = pci_select_bars(pdev, IORESOURCE_MEM);
>>   	/* Enable PCI device */
>>   	if (pci_enable_device_mem(pdev))
>>   		goto out_error;
>>   	/* Request PCI resource for the device */
>> -	if (pci_request_mem_regions(pdev, LPFC_DRIVER_NAME))
>> +	if (pci_request_selected_regions(pdev, bars, LPFC_DRIVER_NAME))
>>   		goto out_disable_device;
>>   	/* Set up device as PCI master and save state for EEH */
>>   	pci_set_master(pdev);
>> @@ -4881,7 +5100,7 @@ lpfc_enable_pci_dev(struct lpfc_hba *phba)
>>   	pci_disable_device(pdev);
>>   out_error:
>>   	lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
>> -			"1401 Failed to enable pci device\n");
>> +			"1401 Failed to enable pci device, bars:x%x\n", bars);
>>   	return -ENODEV;
>>   }
> I don't get this change. pci_request_mem_regions does
>
> pci_request_selected_regions(pdev,
> 		pci_select_bars(pdev, IORESOURCE_MEM), name);
>
> if you want to have the bars in the error log please do:
>    	lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
> 			"1401 Failed to enable pci device, bars:x%x\n",
> 			pci_select_regions(pdev, IORESOURCE_MEM));

I agree - this is weird.  I'll track why it was ever changed and address it.

Other comments are good. I'll address them.

-- james

WARNING: multiple messages have this Message-ID (diff)
From: James Smart <jsmart2021@gmail.com>
To: Johannes Thumshirn <jthumshirn@suse.de>
Cc: linux-nvme@lists.infradead.org, sagi@grimberg.me,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH 04/17] lpfc: NVME Initiator: Base modifications Part C
Date: Wed, 18 Jan 2017 18:54:37 -0800	[thread overview]
Message-ID: <784acc16-b284-6159-4399-dfd39ae1a8bd@gmail.com> (raw)
In-Reply-To: <20170118110304.GD3514@linux-x5ow.site>



On 1/18/2017 3:03 AM, Johannes Thumshirn wrote:
>
>> +	/* maximum number of xris available for nvme buffers */
>> +	els_xri_cnt = lpfc_sli4_get_els_iocb_cnt(phba);
>> +	phba->sli4_hba.nvme_xri_max = phba->sli4_hba.max_cfg_param.max_xri -
>> +				      els_xri_cnt;
>> +	phba->sli4_hba.nvme_xri_max -= phba->sli4_hba.scsi_xri_max;
> 	nvme_xri_max = phba->sli4_hba.max_cfg_param.max_xri - els_xri_cnt;
> 	nvme_xri_max -= phba->sli4_hba.scsi_xri_max;
> 	phba->sli4_hba.nvme_xri_max = nvme_xri_max;
>
> Low hanging anti line-break fruit.

ok - but I didn't think that a style change like this is a mandate.   As 
I'm addressing your other comments, I'll do so.


>>   		}
>> @@ -4273,13 +4489,13 @@ lpfc_sli4_async_sli_evt(struct lpfc_hba *phba, struct lpfc_acqe_sli *acqe_sli)
>>   			sprintf(message, "Unqualified optics - Replace with "
>>   				"Avago optics for Warranty and Technical "
> Is Avago still correct, or should it read Broadcom?

It's right - Avago.


>> @@ -4854,17 +5070,20 @@ static int
>>   lpfc_enable_pci_dev(struct lpfc_hba *phba)
>>   {
>>   	struct pci_dev *pdev;
>> +	int bars = 0;
>>   
>>   	/* Obtain PCI device reference */
>>   	if (!phba->pcidev)
>>   		goto out_error;
>>   	else
>>   		pdev = phba->pcidev;
>> +	/* Select PCI BARs */
>> +	bars = pci_select_bars(pdev, IORESOURCE_MEM);
>>   	/* Enable PCI device */
>>   	if (pci_enable_device_mem(pdev))
>>   		goto out_error;
>>   	/* Request PCI resource for the device */
>> -	if (pci_request_mem_regions(pdev, LPFC_DRIVER_NAME))
>> +	if (pci_request_selected_regions(pdev, bars, LPFC_DRIVER_NAME))
>>   		goto out_disable_device;
>>   	/* Set up device as PCI master and save state for EEH */
>>   	pci_set_master(pdev);
>> @@ -4881,7 +5100,7 @@ lpfc_enable_pci_dev(struct lpfc_hba *phba)
>>   	pci_disable_device(pdev);
>>   out_error:
>>   	lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
>> -			"1401 Failed to enable pci device\n");
>> +			"1401 Failed to enable pci device, bars:x%x\n", bars);
>>   	return -ENODEV;
>>   }
> I don't get this change. pci_request_mem_regions does
>
> pci_request_selected_regions(pdev,
> 		pci_select_bars(pdev, IORESOURCE_MEM), name);
>
> if you want to have the bars in the error log please do:
>    	lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
> 			"1401 Failed to enable pci device, bars:x%x\n",
> 			pci_select_regions(pdev, IORESOURCE_MEM));

I agree - this is weird.  I'll track why it was ever changed and address it.

Other comments are good. I'll address them.

-- james


  reply	other threads:[~2017-01-19  2:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-18  1:20 [PATCH 04/17] lpfc: NVME Initiator: Base modifications Part C James Smart
2017-01-18  1:20 ` James Smart
2017-01-18  7:17 ` Hannes Reinecke
2017-01-18  7:17   ` Hannes Reinecke
2017-01-19  2:08   ` James Smart
2017-01-19  2:08     ` James Smart
2017-01-18 11:03 ` Johannes Thumshirn
2017-01-18 11:03   ` Johannes Thumshirn
2017-01-19  2:54   ` James Smart [this message]
2017-01-19  2:54     ` James Smart
2017-01-19  8:14     ` Johannes Thumshirn
2017-01-19  8:14       ` Johannes Thumshirn

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=784acc16-b284-6159-4399-dfd39ae1a8bd@gmail.com \
    --to=jsmart2021@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.