All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i40e: only register client on iWarp-capable devices
@ 2017-04-04 19:40 ` Mitch Williams
  0 siblings, 0 replies; 3+ messages in thread
From: Mitch Williams @ 2017-04-04 19:40 UTC (permalink / raw)
  To: intel-wired-lan; +Cc: netdev, sassmann, Mitch Williams

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: Mitch Williams <mitch.a.williams@intel.com>
Reported-by: Stefan Assmann <sassmann@kpanic.de>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 87d99fa..5e0e44e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -11828,10 +11828,12 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		  round_jiffies(jiffies + pf->service_timer_period));
 
 	/* add this PF to client device list and launch a client service task */
-	err = i40e_lan_add_device(pf);
-	if (err)
-		dev_info(&pdev->dev, "Failed to add PF to client API service list: %d\n",
-			 err);
+	if (pf->flags & I40E_FLAG_IWARP_ENABLED) {
+		err = i40e_lan_add_device(pf);
+		if (err)
+			dev_info(&pdev->dev, "Failed to add PF to client API service list: %d\n",
+				 err);
+	}
 
 #define PCI_SPEED_SIZE 8
 #define PCI_WIDTH_SIZE 8
@@ -12013,10 +12015,11 @@ static void i40e_remove(struct pci_dev *pdev)
 		i40e_vsi_release(pf->vsi[pf->lan_vsi]);
 
 	/* remove attached clients */
-	ret_code = i40e_lan_del_device(pf);
-	if (ret_code) {
-		dev_warn(&pdev->dev, "Failed to delete client device: %d\n",
-			 ret_code);
+	if (pf->flags & I40E_FLAG_IWARP_ENABLED) {
+		ret_code = i40e_lan_del_device(pf);
+		if (ret_code)
+			dev_warn(&pdev->dev, "Failed to delete client device: %d\n",
+				 ret_code);
 	}
 
 	/* shutdown and destroy the HMC */
-- 
2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Intel-wired-lan] [PATCH] i40e: only register client on iWarp-capable devices
@ 2017-04-04 19:40 ` Mitch Williams
  0 siblings, 0 replies; 3+ messages in thread
From: Mitch Williams @ 2017-04-04 19:40 UTC (permalink / raw)
  To: intel-wired-lan

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: Mitch Williams <mitch.a.williams@intel.com>
Reported-by: Stefan Assmann <sassmann@kpanic.de>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 87d99fa..5e0e44e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -11828,10 +11828,12 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		  round_jiffies(jiffies + pf->service_timer_period));
 
 	/* add this PF to client device list and launch a client service task */
-	err = i40e_lan_add_device(pf);
-	if (err)
-		dev_info(&pdev->dev, "Failed to add PF to client API service list: %d\n",
-			 err);
+	if (pf->flags & I40E_FLAG_IWARP_ENABLED) {
+		err = i40e_lan_add_device(pf);
+		if (err)
+			dev_info(&pdev->dev, "Failed to add PF to client API service list: %d\n",
+				 err);
+	}
 
 #define PCI_SPEED_SIZE 8
 #define PCI_WIDTH_SIZE 8
@@ -12013,10 +12015,11 @@ static void i40e_remove(struct pci_dev *pdev)
 		i40e_vsi_release(pf->vsi[pf->lan_vsi]);
 
 	/* remove attached clients */
-	ret_code = i40e_lan_del_device(pf);
-	if (ret_code) {
-		dev_warn(&pdev->dev, "Failed to delete client device: %d\n",
-			 ret_code);
+	if (pf->flags & I40E_FLAG_IWARP_ENABLED) {
+		ret_code = i40e_lan_del_device(pf);
+		if (ret_code)
+			dev_warn(&pdev->dev, "Failed to delete client device: %d\n",
+				 ret_code);
 	}
 
 	/* shutdown and destroy the HMC */
-- 
2.7.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Intel-wired-lan] [PATCH] i40e: only register client on iWarp-capable devices
  2017-04-04 19:40 ` [Intel-wired-lan] " Mitch Williams
  (?)
@ 2017-04-06 21:31 ` Bowers, AndrewX
  -1 siblings, 0 replies; 3+ messages in thread
From: Bowers, AndrewX @ 2017-04-06 21:31 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Mitch Williams
> Sent: Tuesday, April 4, 2017 12:40 PM
> To: intel-wired-lan at lists.osuosl.org
> Cc: netdev at vger.kernel.org; sassmann at kpanic.de
> Subject: [Intel-wired-lan] [PATCH] 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: Mitch Williams <mitch.a.williams@intel.com>
> Reported-by: Stefan Assmann <sassmann@kpanic.de>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 19 +++++++++++--------
>  1 file changed, 11 insertions(+), 8 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-06 21:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-04 19:40 [PATCH] i40e: only register client on iWarp-capable devices Mitch Williams
2017-04-04 19:40 ` [Intel-wired-lan] " Mitch Williams
2017-04-06 21:31 ` Bowers, AndrewX

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.