Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3455304imm; Mon, 6 Aug 2018 05:13:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeBTwQs6YZhW0irqcNUaRwUth6rCRfaTGZSuN+VUeCD9y65VDFmTptCQO90eeOxXsJkWTz3 X-Received: by 2002:a63:f657:: with SMTP id u23-v6mr14392849pgj.258.1533557620700; Mon, 06 Aug 2018 05:13:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533557620; cv=none; d=google.com; s=arc-20160816; b=eDnvrC/fIHT1fyCoBACPX9VpIq2aOvbscfYLZvG6A6j8qUNGMPNKbm/mvz7x/g7iGu Et0bgvglYyZadrp1GToZaEil+ndU8cPio/6v3IOp8gm0SlPczD60/v9GN7pkdTMRKQdq n83fbUKp84WJnNeAMMTu4NZfVhTTq3RZWIgpiXYY6HxcipFGpCOipV5zUk0/mm/kIM0o jCwep8s9d4oB4VQ4fA5fFRkn6Wi2BdWQMPfxfDSn7FKtPg4ajt/ZCsrUgUBP0wut2HHH dAsd0OldKD5WcL6DF9OXz5PybDKBvD0hCRJ4rKxfNhK0/+ABZjw+wYThZPk/dSkW/ng0 eP4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=smAgzaAHneVP7zgO/ghkjilMl7nBqlu529Nf1pgEKik=; b=NNRnD+htirysrWOw709h1xnObzmDkaDAe0gl4oVwipJMzimjCTdghIE5Hjj8kSwMvi JgsoBXd5/zz3uStWyH1/msreqyxhaPP+zg0iB+zYHxEg7OaeKEs3/Qiux1K8fLwkiWEb OOXIidNiRMqIcE63my476Cf8UsUHzZAijZFZ3OYTR2QJBiiOzDxA4a6/qSVW9EyBV8Qc eLn/TtkhKhJb3pOXCDRsDDTGYJtW7VLG2pGe+7m7ZsdtdpRVj2TRjrfxGEE5frkVFEwP SIqYILEZbP1PuGZrMu5wHAYegeJDCQPFHqnBrYjToM+koCD1ZdR0XWLf/iqz6ojT9E8l ATuQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b12-v6si12731404pgh.264.2018.08.06.05.13.25; Mon, 06 Aug 2018 05:13:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731934AbeHFOVW (ORCPT + 99 others); Mon, 6 Aug 2018 10:21:22 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:44420 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731081AbeHFOVW (ORCPT ); Mon, 6 Aug 2018 10:21:22 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5AEB040201A0; Mon, 6 Aug 2018 12:12:32 +0000 (UTC) Received: from hive.brq.redhat.com (unknown [10.43.2.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id EA7C62026D68; Mon, 6 Aug 2018 12:12:30 +0000 (UTC) From: Petr Oros To: netdev@vger.kernel.org Cc: ivecera@redhat.com, Sathya Perla , Ajit Khaparde , Sriharsha Basavapatna , Somnath Kotur , "David S. Miller" , linux-kernel@vger.kernel.org Subject: [PATCH] Use Kconfig flag to remove support of deprecated BE2/BE3 adapters Date: Mon, 6 Aug 2018 14:12:28 +0200 Message-Id: <20180806121230.23690-1-poros@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Mon, 06 Aug 2018 12:12:32 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Mon, 06 Aug 2018 12:12:32 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'poros@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add flags to remove support of deprecated BE2/BE3 adapters. BE2 disable will reduce .ko size by 2kb and BE3 by 3kb. Disable both will reduce .ko size by 9kb. With dissabled support is also removed coresponding PCI IDs and codepath with [BE2|BE3|BEx]_chip checks. New help style in Kconfig Signed-off-by: Petr Oros --- drivers/net/ethernet/emulex/benet/Kconfig | 20 ++++++++++++++++++-- drivers/net/ethernet/emulex/benet/be.h | 8 ++++++++ drivers/net/ethernet/emulex/benet/be_main.c | 6 +++++- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/emulex/benet/Kconfig b/drivers/net/ethernet/emulex/benet/Kconfig index b4853ec9de8d..68a9c40adc2a 100644 --- a/drivers/net/ethernet/emulex/benet/Kconfig +++ b/drivers/net/ethernet/emulex/benet/Kconfig @@ -1,7 +1,7 @@ config BE2NET tristate "ServerEngines' 10Gbps NIC - BladeEngine" depends on PCI - ---help--- + help This driver implements the NIC functionality for ServerEngines' 10Gbps network adapter - BladeEngine. @@ -10,6 +10,22 @@ config BE2NET_HWMON depends on BE2NET && HWMON depends on !(BE2NET=y && HWMON=m) default y - ---help--- + help Say Y here if you want to expose thermal sensor data on be2net network adapter. + +config BE2NET_BE2 + bool "Support for deprecated BE2 chipsets" + depends on BE2NET + default y + help + Say Y here if you want to use deprecated Emulex devices based + on BE2 chipsets. + +config BE2NET_BE3 + bool "Support for deprecated BE3 chipsets" + depends on BE2NET + default y + help + Say Y here if you want to use deprecated Emulex devices based + on BE3 chipsets. diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h index 382891f81e09..3038578ec7a7 100644 --- a/drivers/net/ethernet/emulex/benet/be.h +++ b/drivers/net/ethernet/emulex/benet/be.h @@ -779,11 +779,19 @@ static inline u16 be_max_any_irqs(struct be_adapter *adapter) #define skyhawk_chip(adapter) (adapter->pdev->device == OC_DEVICE_ID5 || \ adapter->pdev->device == OC_DEVICE_ID6) +#ifdef CONFIG_BE2NET_BE3 #define BE3_chip(adapter) (adapter->pdev->device == BE_DEVICE_ID2 || \ adapter->pdev->device == OC_DEVICE_ID2) +#else +#define BE3_chip(adapter) (0) +#endif /* CONFIG_BE2NET_BE3 */ +#ifdef CONFIG_BE2NET_BE2 #define BE2_chip(adapter) (adapter->pdev->device == BE_DEVICE_ID1 || \ adapter->pdev->device == OC_DEVICE_ID1) +#else +#define BE2_chip(adapter) (0) +#endif /* CONFIG_BE2NET_BE2 */ #define BEx_chip(adapter) (BE3_chip(adapter) || BE2_chip(adapter)) diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 8f755009ff38..d5b3f0139832 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c @@ -47,10 +47,14 @@ MODULE_PARM_DESC(rx_frag_size, "Size of a fragment that holds rcvd data."); static struct workqueue_struct *be_err_recovery_workq; static const struct pci_device_id be_dev_ids[] = { +#ifdef CONFIG_BE2NET_BE2 { PCI_DEVICE(BE_VENDOR_ID, BE_DEVICE_ID1) }, - { PCI_DEVICE(BE_VENDOR_ID, BE_DEVICE_ID2) }, { PCI_DEVICE(BE_VENDOR_ID, OC_DEVICE_ID1) }, +#endif /* CONFIG_BE2NET_BE2 */ +#ifdef CONFIG_BE2NET_BE3 + { PCI_DEVICE(BE_VENDOR_ID, BE_DEVICE_ID2) }, { PCI_DEVICE(BE_VENDOR_ID, OC_DEVICE_ID2) }, +#endif /* CONFIG_BE2NET_BE3 */ { PCI_DEVICE(EMULEX_VENDOR_ID, OC_DEVICE_ID3)}, { PCI_DEVICE(EMULEX_VENDOR_ID, OC_DEVICE_ID4)}, { PCI_DEVICE(EMULEX_VENDOR_ID, OC_DEVICE_ID5)}, -- 2.16.4