Commit 004eb614 authored by Mitch Williams's avatar Mitch Williams Committed by Jeff Kirsher

i40e: only register client on iWarp-capable devices

The client interface is only intended for use on devices that support
iWarp. Only register with the client if this is the case.

This fixes a panic when loading i40iw on X710 devices.
Signed-off-by: default avatarMitch Williams <mitch.a.williams@intel.com>
Reported-by: default avatarStefan Assmann <sassmann@kpanic.de>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 3a9024f5
...@@ -11245,10 +11245,12 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -11245,10 +11245,12 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
round_jiffies(jiffies + pf->service_timer_period)); round_jiffies(jiffies + pf->service_timer_period));
/* add this PF to client device list and launch a client service task */ /* add this PF to client device list and launch a client service task */
err = i40e_lan_add_device(pf); if (pf->flags & I40E_FLAG_IWARP_ENABLED) {
if (err) err = i40e_lan_add_device(pf);
dev_info(&pdev->dev, "Failed to add PF to client API service list: %d\n", if (err)
err); dev_info(&pdev->dev, "Failed to add PF to client API service list: %d\n",
err);
}
#define PCI_SPEED_SIZE 8 #define PCI_SPEED_SIZE 8
#define PCI_WIDTH_SIZE 8 #define PCI_WIDTH_SIZE 8
...@@ -11426,10 +11428,11 @@ static void i40e_remove(struct pci_dev *pdev) ...@@ -11426,10 +11428,11 @@ static void i40e_remove(struct pci_dev *pdev)
i40e_vsi_release(pf->vsi[pf->lan_vsi]); i40e_vsi_release(pf->vsi[pf->lan_vsi]);
/* remove attached clients */ /* remove attached clients */
ret_code = i40e_lan_del_device(pf); if (pf->flags & I40E_FLAG_IWARP_ENABLED) {
if (ret_code) { ret_code = i40e_lan_del_device(pf);
dev_warn(&pdev->dev, "Failed to delete client device: %d\n", if (ret_code)
ret_code); dev_warn(&pdev->dev, "Failed to delete client device: %d\n",
ret_code);
} }
/* shutdown and destroy the HMC */ /* shutdown and destroy the HMC */
......
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