Commit 3fced535 authored by Anjali Singhai Jain's avatar Anjali Singhai Jain Committed by Jeff Kirsher

i40e: X722 is on the IOSF bus and does not report the PCI bus info

X722 will report Gen 1x1 in the PCI config space as it is on
IOSF bus, so skip the PCI bus link/speed check.

Change-ID: Icd5f5751dc7fb00dccf0d5dc5a0a644948e7062e
Signed-off-by: default avatarAnjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 3ac67d7b
...@@ -333,6 +333,7 @@ struct i40e_pf { ...@@ -333,6 +333,7 @@ struct i40e_pf {
#define I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE BIT_ULL(38) #define I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE BIT_ULL(38)
#define I40E_FLAG_LINK_POLLING_ENABLED BIT_ULL(39) #define I40E_FLAG_LINK_POLLING_ENABLED BIT_ULL(39)
#define I40E_FLAG_VEB_MODE_ENABLED BIT_ULL(40) #define I40E_FLAG_VEB_MODE_ENABLED BIT_ULL(40)
#define I40E_FLAG_NO_PCI_LINK_CHECK BIT_ULL(42)
/* tracks features that get auto disabled by errors */ /* tracks features that get auto disabled by errors */
u64 auto_disable_flags; u64 auto_disable_flags;
......
...@@ -10308,27 +10308,56 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -10308,27 +10308,56 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
i40e_fcoe_vsi_setup(pf); i40e_fcoe_vsi_setup(pf);
#endif #endif
/* Get the negotiated link width and speed from PCI config space */ #define PCI_SPEED_SIZE 8
pcie_capability_read_word(pf->pdev, PCI_EXP_LNKSTA, &link_status); #define PCI_WIDTH_SIZE 8
/* Devices on the IOSF bus do not have this information
* and will report PCI Gen 1 x 1 by default so don't bother
* checking them.
*/
if (!(pf->flags & I40E_FLAG_NO_PCI_LINK_CHECK)) {
char speed[PCI_SPEED_SIZE] = "Unknown";
char width[PCI_WIDTH_SIZE] = "Unknown";
/* Get the negotiated link width and speed from PCI config
* space
*/
pcie_capability_read_word(pf->pdev, PCI_EXP_LNKSTA,
&link_status);
i40e_set_pci_config_data(hw, link_status); i40e_set_pci_config_data(hw, link_status);
dev_info(&pdev->dev, "PCI-Express: %s %s\n", switch (hw->bus.speed) {
(hw->bus.speed == i40e_bus_speed_8000 ? "Speed 8.0GT/s" : case i40e_bus_speed_8000:
hw->bus.speed == i40e_bus_speed_5000 ? "Speed 5.0GT/s" : strncpy(speed, "8.0", PCI_SPEED_SIZE); break;
hw->bus.speed == i40e_bus_speed_2500 ? "Speed 2.5GT/s" : case i40e_bus_speed_5000:
"Unknown"), strncpy(speed, "5.0", PCI_SPEED_SIZE); break;
(hw->bus.width == i40e_bus_width_pcie_x8 ? "Width x8" : case i40e_bus_speed_2500:
hw->bus.width == i40e_bus_width_pcie_x4 ? "Width x4" : strncpy(speed, "2.5", PCI_SPEED_SIZE); break;
hw->bus.width == i40e_bus_width_pcie_x2 ? "Width x2" : default:
hw->bus.width == i40e_bus_width_pcie_x1 ? "Width x1" : break;
"Unknown")); }
switch (hw->bus.width) {
case i40e_bus_width_pcie_x8:
strncpy(width, "8", PCI_WIDTH_SIZE); break;
case i40e_bus_width_pcie_x4:
strncpy(width, "4", PCI_WIDTH_SIZE); break;
case i40e_bus_width_pcie_x2:
strncpy(width, "2", PCI_WIDTH_SIZE); break;
case i40e_bus_width_pcie_x1:
strncpy(width, "1", PCI_WIDTH_SIZE); break;
default:
break;
}
dev_info(&pdev->dev, "PCI-Express: Speed %sGT/s Width x%s\n",
speed, width);
if (hw->bus.width < i40e_bus_width_pcie_x8 || if (hw->bus.width < i40e_bus_width_pcie_x8 ||
hw->bus.speed < i40e_bus_speed_8000) { hw->bus.speed < i40e_bus_speed_8000) {
dev_warn(&pdev->dev, "PCI-Express bandwidth available for this device may be insufficient for optimal performance.\n"); dev_warn(&pdev->dev, "PCI-Express bandwidth available for this device may be insufficient for optimal performance.\n");
dev_warn(&pdev->dev, "Please move the device to a different PCI-e link with more lanes and/or higher transfer rate.\n"); dev_warn(&pdev->dev, "Please move the device to a different PCI-e link with more lanes and/or higher transfer rate.\n");
} }
}
/* get the requested speeds from the fw */ /* get the requested speeds from the fw */
err = i40e_aq_get_phy_capabilities(hw, false, false, &abilities, NULL); err = i40e_aq_get_phy_capabilities(hw, false, false, &abilities, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment