Re: [PATCH v2 02/15] lpfc: Fix auto sli_mode and its effect on CONFIG_PORT for SLI3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/7/2021 4:06 AM, Daniel Wagner wrote:
Hi James,

On Mon, Jan 04, 2021 at 10:02:27AM -0800, James Smart wrote:
A very long time ago, there was a feature: auto sli mode. It gave the
user the ability to auto select the SLI mode (SLI2 or SLI3) to run the
port in, or even force SLI2 mode if configured.  Because of the
convoluted logic, the CONFIG_PORT mbox command ends up being called 2 or
3 times. It should have been called only once.  Additionally, the driver
no longer supports SLI-2, so only SLI-3 mode should be allowed.

The following changes were made:
- Force module parameter to SLI3 only.
- Rip out redundant CONFIG_PORT mbox commands.
- Force CONFIG_PORT mbox command to be in beginning of enable ISR routine.
- Added changes for offline to online behavior

We got a regression report for this patch. The problem seems to be
related with older Emulex HBAs. The symptom is in this case one port is
not enabled. A revert of this patch fixed the problem. This was
observed with:

   Emulex LPe11000 FV2.72X2 DV12.8.0.7 HN:FR2AS6AP2-0001 OS:Linux

Here some ramblings from my debugging:

In the logs I found:

0000:0b:00.0: 0:0431 Failed to enable interrupt.
0000:0b:00.0: 0:0431 Failed to enable interrupt.
0000:0b:00.0: 0:0431 Failed to enable interrupt.

cfg_sli_mode used to be 0 (auto) and the config port setup
used to try first mode = 3 and then fall back to mode = 2

-       rc = lpfc_sli_config_port(phba, mode);
-
-       if (rc && phba->cfg_sli_mode == 3)
-               lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
-                               "1820 Unable to select SLI-3.  "
-                               "Not supported by adapter.\n");
-       if (rc && mode != 2)
-               rc = lpfc_sli_config_port(phba, 2);

the port config is now in lpfc_sli_enable_intr which is hardcoded
to LPFC_SLI_REV3 and I think this fails and the HBA_NEEDS_CFG_PORT
flag is not resetted, hence in lpfc_sli_hba_setup() the new
code tries to enable the port again with:

+       /* Enable ISR already does config_port because of config_msi mbx */
+       if (phba->hba_flag & HBA_NEEDS_CFG_PORT) {
+               rc = lpfc_sli_config_port(phba, LPFC_SLI_REV3);
+               if (rc)
+                       return -EIO;
+               phba->hba_flag &= ~HBA_NEEDS_CFG_PORT;

Though I think this should something like

    lpfc_sli_config_port(phba, LPFC_SLI_REV2);

for the specific case.

HTH!

Thanks,
Daniel


ouch - What you are describing is likely true, but sli-2 firmware is *extremely* old - 2 decades or more. If a change wont work first shot, it likely won't be worth the effort to try to fix it. Other functionality may be hanging on by a thread. That adapter certainly runs SLI-3 (even that is 10-15 yrs old), so the best solution is a fw upgrade that picks up the sli3 interface. Is that possible?

Given that the error message you quoted was a failure of interrupt, that may be a clue. It may well be the adapter has sli3 firmware and it's failing on setting the interrupt vector type. The older adapters supported MSI and INTx. SLI-2 may have been limited to INTx only. There used to be hiccups in some platforms with MSI support (platform said it did, but was broken) which is why the driver had "set it, test it, revert it" logic. I believe the driver has a lpfc_use_msi module parameter that when set to 0 should use only INTx, which may be what the sli2 downgrade is effectively doing. Try setting that and seeing if the card loads the sli3 image and runs.


-- james



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux