netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Mitch Williams <mitch.a.williams@intel.com>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	jogreene@redhat.com, Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 01/12] i40e: only register client on iWarp-capable devices
Date: Sat,  8 Apr 2017 02:55:42 -0700	[thread overview]
Message-ID: <20170408095553.78307-2-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20170408095553.78307-1-jeffrey.t.kirsher@intel.com>

From: Mitch Williams <mitch.a.williams@intel.com>

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>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 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 d83430faaa41..1ee2759c38f7 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -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));
 
 	/* 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
@@ -11426,10 +11428,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.12.2

  reply	other threads:[~2017-04-08  9:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-08  9:55 [net-next 00/12][pull request] 40GbE Intel Wired LAN Driver Updates 2017-04-08 Jeff Kirsher
2017-04-08  9:55 ` Jeff Kirsher [this message]
2017-04-08  9:55 ` [net-next 02/12] i40e: update error message when trying to add invalid filters Jeff Kirsher
2017-04-08  9:55 ` [net-next 03/12] i40e: Swap use of pf->flags and pf->hw_disabled_flags for ATR Eviction Jeff Kirsher
2017-04-08  9:55 ` [net-next 04/12] i40e: Decrease the scope of rtnl lock Jeff Kirsher
2017-04-08  9:55 ` [net-next 05/12] i40e: Simplify i40e_detect_recover_hung_queue logic Jeff Kirsher
2017-04-08  9:55 ` [net-next 06/12] i40e: allow look-up of MAC address from Open Firmware or IDPROM Jeff Kirsher
2017-04-08  9:55 ` [net-next 07/12] i40e: remove extraneous loop in i40e_vsi_wait_queues_disabled Jeff Kirsher
2017-04-08  9:55 ` [net-next 08/12] i40e: remove I40E_FLAG_NEED_LINK_UPDATE Jeff Kirsher
2017-04-08  9:55 ` [net-next 09/12] i40e: clean up historic deprecated flag definitions Jeff Kirsher
2017-04-08  9:55 ` [net-next 10/12] i40e/i40evf: Add support for using order 1 pages with a 3K buffer Jeff Kirsher
2017-04-08  9:55 ` [net-next 11/12] i40e/i40evf: Add support for padding start of frames Jeff Kirsher
2017-04-08  9:55 ` [net-next 12/12] i40e/i40evf: Use build_skb to build frames Jeff Kirsher
2017-04-09 20:41 ` [net-next 00/12][pull request] 40GbE Intel Wired LAN Driver Updates 2017-04-08 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170408095553.78307-2-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=davem@davemloft.net \
    --cc=jogreene@redhat.com \
    --cc=mitch.a.williams@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=sassmann@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).