[Intel-wired-lan] [PATCH 5/6] fm10k: update fm10k_slot_warn to use pcie_get_minimum link

Keller, Jacob E jacob.e.keller at intel.com
Fri Jun 19 15:31:41 UTC 2015


On Thu, 2015-06-18 at 19:22 -0700, Alexander Duyck wrote:
> On 06/15/2015 03:00 PM, Jacob Keller wrote:
> > This is useful in cases where we connect to a slot at Gen3, but the 
> > slot
> > is behind a bus which only connected at Gen2. This generally only
> > happens when a PCIe switch is in the sequence of devices, and can 
> > be
> > very confusing when you see slow performance with no obvious cause.
> > 
> > I am aware this patch has a few lines that break 80 characters, but
> > there does not seem to be a readable way to format them to less 
> > than 80
> > characters. Suggestions welcome.
> > 
> > Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
> > ---
> >   drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 105 
> > +++++++++++++++++++--------
> >   1 file changed, 76 insertions(+), 29 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c 
> > b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
> > index 37cd78f3ce24..d8ab6cdca456 100644
> > --- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
> > +++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
> > @@ -1703,22 +1703,86 @@ static int fm10k_sw_init(struct fm10k_intfc 
> > *interface,
> >   
> >   static void fm10k_slot_warn(struct fm10k_intfc *interface)
> >   {
> > -   struct device *dev = &interface->pdev->dev;
> > +   enum pcie_link_width width = PCIE_LNK_WIDTH_UNKNOWN;
> > +   enum pci_bus_speed speed = PCI_SPEED_UNKNOWN;
> >     struct fm10k_hw *hw = &interface->hw;
> > +   int max_gts = 0, expected_gts = 0;
> >   
> > -   if (hw->mac.ops.is_slot_appropriate(hw))
> 
> If I am not mistaken I believe this is the only spot that uses the 
> is_slot_appropriate function in the upstream driver.  You could just 
> drop it from the code if that is the case.  I'll try to get to it in 
> a 
> couple of weeks when I get back from vacation otherwise.
> 
> - Alex

Makes sense.

Regards,
Jake


More information about the Intel-wired-lan mailing list