From patchwork Tue Apr 4 19:40:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mitch Williams X-Patchwork-Id: 746930 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3vyK8R2mQNz9s85 for ; Wed, 5 Apr 2017 05:40:55 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="XtzeQ49A"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753243AbdDDTku (ORCPT ); Tue, 4 Apr 2017 15:40:50 -0400 Received: from mga14.intel.com ([192.55.52.115]:16820 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752477AbdDDTku (ORCPT ); Tue, 4 Apr 2017 15:40:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491334849; x=1522870849; h=from:to:cc:subject:date:message-id; bh=xJN1J9tND+tnom1ME6U7EDd5C1DCzyAAXo0zzIKB48M=; b=XtzeQ49AYg56ejaWCSO5UgYgIP9C5jZwGPo/FxHxv7Z4ATJE6I1q0cdF Yqe6Ti8mFy5HiyQpUhIAE4/ChSIE7A==; Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Apr 2017 12:40:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,275,1486454400"; d="scan'208";a="1130940446" Received: from nsmiller-mobl1.amr.corp.intel.com (HELO mawilli1-desk.amr.corp.intel.com) ([10.254.4.147]) by fmsmga001.fm.intel.com with ESMTP; 04 Apr 2017 12:40:49 -0700 From: Mitch Williams To: intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org, sassmann@kpanic.de, Mitch Williams Subject: [PATCH] i40e: only register client on iWarp-capable devices Date: Tue, 4 Apr 2017 12:40:16 -0700 Message-Id: <1491334816-27356-1-git-send-email-mitch.a.williams@intel.com> X-Mailer: git-send-email 2.7.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Reported-by: Stefan Assmann --- 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 */