RE: [PATCH v1] pci: Limit VPD length of Emulex adapters to the actual length supported.

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

 



Sorry for a delayed response.

> -----Original Message-----
> From: Bjorn Helgaas [mailto:bhelgaas@xxxxxxxxxx]
> Sent: Tuesday, November 04, 2014 11:05 PM
> To: Venkat Duvvuru
> Cc: linux-pci@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v1] pci: Limit VPD length of Emulex adapters to the
> actual length supported.
> 
> > In this case when the host reads 32k space, the adapter gets around 8K
> interrupts and sometimes gets overwhelmed with the interrupt storm. This
> could cause the adapter to stop functioning properly.
> > Limiting the VPD read to 1K causes only 256 interrupts (on the adapter) and
> the problem never seems to occur.
> > This has been the main motivation behind my patch.
> > I do agree that the timeout could still occur even when reading the 1K
> implemented space, but I feel it's highly improbable.
> 
> OK.  I would guess that something like
> 
>   while /bin/true; do
>     cat /sys/devices/pci0000:00/0000:00:00.0/vpd
>   done
> 
> could still overwhelm the adapter, even with the 1K limit in place.
Correct.

> 
> > As an alternative solution, would you be open to a fix in PCI -core to stop
> reading after the End-tag is detected?  (This logic is used by pci-utility (ls-
> vpd.c) while reading VPD data.)
> > I now feel that this is the *right* solution than my pci-quirks patch.
> 
> That's a possibility, and if we were implementing VPD support from
> scratch, I'd probably do it that way.
> 
> My only concern with changing now is that it could break existing
> users for devices where the VPD content doesn't have the structure
> specified by the spec.  There aren't *too* many users of
> pci_read_vpd() in the tree, so it might be feasible to just ask the
> bnx2x, tg3, cxgb4, sky2, and efx folks whether they think it's safe.
> 
> I took a quick look at those drivers, and it actually looks like most
> of them look for the tag structure, e.g., by using pci_vpd_find_tag()
> or doing something similar.  So maybe it actually would be safe to do
> this.  Maybe you could have a more thorough look at them and see if
> you agree?
If the devices doesn't follow the spec for the VPD contents, pci-core may endup requesting 32k data which probably will not break existing users.
I looked into all the pci_read_vpd users (drivers) and they seem to be doing pci_find_vpd_tag or pci_vpd_find_info_keyword to find a specific tag/keyword and not all the tags/keywords.
A safer approach probably is to look for the end tag in pci_read_vpd, if offset is "zero" because some drivers are doing "pci_read_vpd" with a non-zero offset.


/Venkat.
��.n��������+%������w��{.n�����{���"�)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥





[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux