linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Use Kconfig flag to remove support of deprecated BE2/BE3 adapters
@ 2018-08-06 12:12 Petr Oros
  2018-08-06 13:03 ` Ivan Vecera
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Petr Oros @ 2018-08-06 12:12 UTC (permalink / raw)
  To: netdev
  Cc: ivecera, Sathya Perla, Ajit Khaparde, Sriharsha Basavapatna,
	Somnath Kotur, David S. Miller, linux-kernel

  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 <poros@redhat.com>
---
 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


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

* Re: [PATCH] Use Kconfig flag to remove support of deprecated BE2/BE3 adapters
  2018-08-06 12:12 [PATCH] Use Kconfig flag to remove support of deprecated BE2/BE3 adapters Petr Oros
@ 2018-08-06 13:03 ` Ivan Vecera
  2018-08-06 16:21 ` Christoph Hellwig
  2018-08-06 20:46 ` David Miller
  2 siblings, 0 replies; 8+ messages in thread
From: Ivan Vecera @ 2018-08-06 13:03 UTC (permalink / raw)
  To: Petr Oros, netdev
  Cc: Sathya Perla, Ajit Khaparde, Sriharsha Basavapatna,
	Somnath Kotur, David S. Miller, linux-kernel

On 6.8.2018 14:12, Petr Oros wrote:
>   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 <poros@redhat.com>

Note that this should be placed to -next...

Reviewed-by: Ivan Vecera <ivecera@redhat.com>

> ---
>  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)},
> 


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

* Re: [PATCH] Use Kconfig flag to remove support of deprecated BE2/BE3 adapters
  2018-08-06 12:12 [PATCH] Use Kconfig flag to remove support of deprecated BE2/BE3 adapters Petr Oros
  2018-08-06 13:03 ` Ivan Vecera
@ 2018-08-06 16:21 ` Christoph Hellwig
  2018-08-07 11:35   ` Ivan Vecera
  2018-08-06 20:46 ` David Miller
  2 siblings, 1 reply; 8+ messages in thread
From: Christoph Hellwig @ 2018-08-06 16:21 UTC (permalink / raw)
  To: Petr Oros
  Cc: netdev, ivecera, Sathya Perla, Ajit Khaparde,
	Sriharsha Basavapatna, Somnath Kotur, David S. Miller,
	linux-kernel

On Mon, Aug 06, 2018 at 02:12:28PM +0200, Petr Oros wrote:
>   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.

deprecated seems like a really odd world for hardware.

Are they just old?  Did they never ship in large numbers?

If you just make some cards optional why not also add options
for families of newer cards for those who only have the older ones
in their systems?

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

* Re: [PATCH] Use Kconfig flag to remove support of deprecated BE2/BE3 adapters
  2018-08-06 12:12 [PATCH] Use Kconfig flag to remove support of deprecated BE2/BE3 adapters Petr Oros
  2018-08-06 13:03 ` Ivan Vecera
  2018-08-06 16:21 ` Christoph Hellwig
@ 2018-08-06 20:46 ` David Miller
  2018-08-07 11:44   ` Ivan Vecera
  2 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2018-08-06 20:46 UTC (permalink / raw)
  To: poros
  Cc: netdev, ivecera, sathya.perla, ajit.khaparde,
	sriharsha.basavapatna, somnath.kotur, linux-kernel

From: Petr Oros <poros@redhat.com>
Date: Mon,  6 Aug 2018 14:12:28 +0200

>   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 <poros@redhat.com>

Sorry, I'm not too hot about this.

Imagine being one of the people who has one of these cards.

Pulling out detection and working'ness of devices from a driver
is a big step backwards, and I'm sorry I will don't want to be
part of something that facilitates this.

The S390 folks tried something similar in the past and I reject
those changes too.

Thanks.

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

* Re: [PATCH] Use Kconfig flag to remove support of deprecated BE2/BE3 adapters
  2018-08-06 16:21 ` Christoph Hellwig
@ 2018-08-07 11:35   ` Ivan Vecera
  0 siblings, 0 replies; 8+ messages in thread
From: Ivan Vecera @ 2018-08-07 11:35 UTC (permalink / raw)
  To: Christoph Hellwig, Petr Oros
  Cc: netdev, Sathya Perla, Ajit Khaparde, Sriharsha Basavapatna,
	Somnath Kotur, David S. Miller, linux-kernel

On 6.8.2018 18:21, Christoph Hellwig wrote:
> On Mon, Aug 06, 2018 at 02:12:28PM +0200, Petr Oros wrote:
>>   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.
> 
> deprecated seems like a really odd world for hardware.
> 
> Are they just old?  Did they never ship in large numbers?
> 
> If you just make some cards optional why not also add options
> for families of newer cards for those who only have the older ones
> in their systems?
> 
This also makes sense.

I.

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

* Re: [PATCH] Use Kconfig flag to remove support of deprecated BE2/BE3 adapters
  2018-08-06 20:46 ` David Miller
@ 2018-08-07 11:44   ` Ivan Vecera
  2018-08-07 20:21     ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Ivan Vecera @ 2018-08-07 11:44 UTC (permalink / raw)
  To: David Miller, poros
  Cc: netdev, sathya.perla, ajit.khaparde, sriharsha.basavapatna,
	somnath.kotur, linux-kernel

On 6.8.2018 22:46, David Miller wrote:
> From: Petr Oros <poros@redhat.com>
> Date: Mon,  6 Aug 2018 14:12:28 +0200
> 
>>   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 <poros@redhat.com>
> 
> Sorry, I'm not too hot about this.

Why? This patch does not remove support for older chips, it just gives an
ability to disable support for certain chip families. In other words an user is
able to customize the driver for his/her needs - it could be fine to add this
ability also for the rest of chip families.

> Imagine being one of the people who has one of these cards.

Such people leave this configs as they are (enabled by default).

> Pulling out detection and working'ness of devices from a driver
> is a big step backwards, and I'm sorry I will don't want to be
> part of something that facilitates this.
> 
> The S390 folks tried something similar in the past and I reject
> those changes too.

This patch is practically the same as "a1b8714593b6 ("net/mlx4: Use Kconfig flag
to remove support of old gen2 Mellanox devices")" for mlx4 and that was accepted
without any objections.

Thanks,
Ivan

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

* Re: [PATCH] Use Kconfig flag to remove support of deprecated BE2/BE3 adapters
  2018-08-07 11:44   ` Ivan Vecera
@ 2018-08-07 20:21     ` David Miller
  2018-08-07 20:42       ` Ivan Vecera
  0 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2018-08-07 20:21 UTC (permalink / raw)
  To: ivecera
  Cc: poros, netdev, sathya.perla, ajit.khaparde,
	sriharsha.basavapatna, somnath.kotur, linux-kernel

From: Ivan Vecera <ivecera@redhat.com>
Date: Tue, 7 Aug 2018 13:44:52 +0200

> This patch is practically the same as "a1b8714593b6 ("net/mlx4: Use
> Kconfig flag to remove support of old gen2 Mellanox devices")" for
> mlx4 and that was accepted without any objections.

Ok, please resubmit this patch then.

Please add a proper Subject line subsystem prefix this time,
"be2net: Use Kconfig flag ..." f.e.e

Thanks.

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

* Re: [PATCH] Use Kconfig flag to remove support of deprecated BE2/BE3 adapters
  2018-08-07 20:21     ` David Miller
@ 2018-08-07 20:42       ` Ivan Vecera
  0 siblings, 0 replies; 8+ messages in thread
From: Ivan Vecera @ 2018-08-07 20:42 UTC (permalink / raw)
  To: poros
  Cc: David Miller, netdev, sathya.perla, ajit.khaparde,
	sriharsha.basavapatna, somnath.kotur, linux-kernel,
	Christoph Hellwig

On 7.8.2018 22:21, David Miller wrote:
> From: Ivan Vecera <ivecera@redhat.com>
> Date: Tue, 7 Aug 2018 13:44:52 +0200
> 
>> This patch is practically the same as "a1b8714593b6 ("net/mlx4: Use
>> Kconfig flag to remove support of old gen2 Mellanox devices")" for
>> mlx4 and that was accepted without any objections.
> 
> Ok, please resubmit this patch then.
> 
> Please add a proper Subject line subsystem prefix this time,
> "be2net: Use Kconfig flag ..." f.e.e
> 
I would extend the ability to configure the support also for the rest of chip
families (Lancer & Skyhawk) as Christoph suggested.

Ivan

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

end of thread, other threads:[~2018-08-07 20:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-06 12:12 [PATCH] Use Kconfig flag to remove support of deprecated BE2/BE3 adapters Petr Oros
2018-08-06 13:03 ` Ivan Vecera
2018-08-06 16:21 ` Christoph Hellwig
2018-08-07 11:35   ` Ivan Vecera
2018-08-06 20:46 ` David Miller
2018-08-07 11:44   ` Ivan Vecera
2018-08-07 20:21     ` David Miller
2018-08-07 20:42       ` Ivan Vecera

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).