[v1,1/2] Allow Mellanox network vendor to be configured if only I2C bus is configured

Message ID 1502385112-103765-1-git-send-email-ohado@mellanox.com
State Deferred
Delegated to: David Miller
Headers show

Commit Message

Ohad Oz Aug. 10, 2017, 5:11 p.m.
Patch allows Mellanox devices on system with no PCI, but with I2C only.

Signed-off-by: Ohad Oz <ohado@mellanox.com>
---
 drivers/net/ethernet/mellanox/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Leon Romanovsky Aug. 12, 2017, 2:37 p.m. | #1
On Thu, Aug 10, 2017 at 05:11:51PM +0000, Ohad Oz wrote:
> Patch allows Mellanox devices on system with no PCI, but with I2C only.
>

Did you test mlx5 device on such system? Did it work for you?

What is the changelog between v0 and v1 of these patches?


> Signed-off-by: Ohad Oz <ohado@mellanox.com>
> ---
>  drivers/net/ethernet/mellanox/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/Kconfig b/drivers/net/ethernet/mellanox/Kconfig
> index 84a2007..0949741 100644
> --- a/drivers/net/ethernet/mellanox/Kconfig
> +++ b/drivers/net/ethernet/mellanox/Kconfig
> @@ -5,7 +5,7 @@
>  config NET_VENDOR_MELLANOX
>  	bool "Mellanox devices"
>  	default y
> -	depends on PCI
> +	depends on PCI || I2C
>  	---help---
>  	  If you have a network (Ethernet) card belonging to this class, say Y.
>
> --
> 2.8.0
>
Ohad Oz Aug. 13, 2017, 3:26 p.m. | #2
> -----Original Message-----
> From: Leon Romanovsky [mailto:leon@kernel.org]
> Sent: Saturday, August 12, 2017 5:37 PM
> To: Ohad Oz <ohado@mellanox.com>
> Cc: davem@davemloft.net; netdev@vger.kernel.org; jiri@resnulli.us; Saeed
> Mahameed <saeedm@mellanox.com>; Vadim Pasternak
> <vadimp@mellanox.com>; system-sw-low-level <system-sw-low-
> level@mellanox.com>
> Subject: Re: [patch v1 1/2] Allow Mellanox network vendor to be configured
> if only I2C bus is configured
> 
> On Thu, Aug 10, 2017 at 05:11:51PM +0000, Ohad Oz wrote:
> > Patch allows Mellanox devices on system with no PCI, but with I2C only.
> >
> 
> Did you test mlx5 device on such system? Did it work for you?

Yes, I did. With PCI config set to disable mlx5 drivers are not built. 
Only the following: 
/build/drivers/net/Ethernet/mellanox/mlxsw/mlxsw_core.ko
/build/drivers/net/Ethernet/mellanox /mlxsw/mlxsw_i2c.ko
/build/drivers/net/Ethernet/mellanox /mlxsw/mlxsw_minimal.ko

While with both options on all drivers are built inc mlx5.


> What is the changelog between v0 and v1 of these patches?

No changelog, I've started with v1.

> 
> > Signed-off-by: Ohad Oz <ohado@mellanox.com>
> > ---
> >  drivers/net/ethernet/mellanox/Kconfig | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/mellanox/Kconfig
> b/drivers/net/ethernet/mellanox/Kconfig
> > index 84a2007..0949741 100644
> > --- a/drivers/net/ethernet/mellanox/Kconfig
> > +++ b/drivers/net/ethernet/mellanox/Kconfig
> > @@ -5,7 +5,7 @@
> >  config NET_VENDOR_MELLANOX
> >  	bool "Mellanox devices"
> >  	default y
> > -	depends on PCI
> > +	depends on PCI || I2C
> >  	---help---
> >  	  If you have a network (Ethernet) card belonging to this class, say Y.
> >
> > --
> > 2.8.0
> >
David Miller Aug. 14, 2017, 12:25 a.m. | #3
From: Ohad Oz <ohado@mellanox.com>
Date: Sun, 13 Aug 2017 15:26:56 +0000

> 
> 
>> -----Original Message-----
>> From: Leon Romanovsky [mailto:leon@kernel.org]
>> Sent: Saturday, August 12, 2017 5:37 PM
>> To: Ohad Oz <ohado@mellanox.com>
>> Cc: davem@davemloft.net; netdev@vger.kernel.org; jiri@resnulli.us; Saeed
>> Mahameed <saeedm@mellanox.com>; Vadim Pasternak
>> <vadimp@mellanox.com>; system-sw-low-level <system-sw-low-
>> level@mellanox.com>
>> Subject: Re: [patch v1 1/2] Allow Mellanox network vendor to be configured
>> if only I2C bus is configured
>> 
>> On Thu, Aug 10, 2017 at 05:11:51PM +0000, Ohad Oz wrote:
>> > Patch allows Mellanox devices on system with no PCI, but with I2C only.
>> >
>> 
>> Did you test mlx5 device on such system? Did it work for you?
> 
> Yes, I did. With PCI config set to disable mlx5 drivers are not built. 
> Only the following: 
> /build/drivers/net/Ethernet/mellanox/mlxsw/mlxsw_core.ko
> /build/drivers/net/Ethernet/mellanox /mlxsw/mlxsw_i2c.ko
> /build/drivers/net/Ethernet/mellanox /mlxsw/mlxsw_minimal.ko
> 
> While with both options on all drivers are built inc mlx5.

I'm not so sure he's interested if things build or not.

He's asking you if you actually used a Mellanox device with this
driver with PCI disabled and only I2C available.
Leon Romanovsky Aug. 14, 2017, 5:20 a.m. | #4
On Sun, Aug 13, 2017 at 05:25:21PM -0700, David Miller wrote:
> From: Ohad Oz <ohado@mellanox.com>
> Date: Sun, 13 Aug 2017 15:26:56 +0000
>
> >
> >
> >> -----Original Message-----
> >> From: Leon Romanovsky [mailto:leon@kernel.org]
> >> Sent: Saturday, August 12, 2017 5:37 PM
> >> To: Ohad Oz <ohado@mellanox.com>
> >> Cc: davem@davemloft.net; netdev@vger.kernel.org; jiri@resnulli.us; Saeed
> >> Mahameed <saeedm@mellanox.com>; Vadim Pasternak
> >> <vadimp@mellanox.com>; system-sw-low-level <system-sw-low-
> >> level@mellanox.com>
> >> Subject: Re: [patch v1 1/2] Allow Mellanox network vendor to be configured
> >> if only I2C bus is configured
> >>
> >> On Thu, Aug 10, 2017 at 05:11:51PM +0000, Ohad Oz wrote:
> >> > Patch allows Mellanox devices on system with no PCI, but with I2C only.
> >> >
> >>
> >> Did you test mlx5 device on such system? Did it work for you?
> >
> > Yes, I did. With PCI config set to disable mlx5 drivers are not built.
> > Only the following:
> > /build/drivers/net/Ethernet/mellanox/mlxsw/mlxsw_core.ko
> > /build/drivers/net/Ethernet/mellanox /mlxsw/mlxsw_i2c.ko
> > /build/drivers/net/Ethernet/mellanox /mlxsw/mlxsw_minimal.ko
> >
> > While with both options on all drivers are built inc mlx5.
>
> I'm not so sure he's interested if things build or not.
>
> He's asking you if you actually used a Mellanox device with this
> driver with PCI disabled and only I2C available.

Thanks David, you are absolutely right.

The commit message and more important, Kconfig entry, is misleading the potential
users by promising them that all devices under drivers/net/ethernet/mellanox
folder are working with i2c.

I have no technical objection to the idea of this patch, but it needs to be resubmitted after
Ohad ensures that mlx4/mlx5 are not visible in menuconfig for i2c
systems and he fixes Kconfig description together with commit log.

Thanks
Jiri Pirko Aug. 14, 2017, 7 a.m. | #5
Sat, Aug 12, 2017 at 04:37:15PM CEST, leon@kernel.org wrote:
>On Thu, Aug 10, 2017 at 05:11:51PM +0000, Ohad Oz wrote:
>> Patch allows Mellanox devices on system with no PCI, but with I2C only.
>>
>
>Did you test mlx5 device on such system? Did it work for you?

$ git grep i2c_add_driver drivers/net/ethernet/mellanox/
drivers/net/ethernet/mellanox/mlxsw/i2c.c:      return i2c_add_driver(i2c_driver);

That is the only driver that would probe on i2c, non-pci system.
mlx5 just would not probe, so there is nothing to test.



>
>What is the changelog between v0 and v1 of these patches?
>
>
>> Signed-off-by: Ohad Oz <ohado@mellanox.com>
>> ---
>>  drivers/net/ethernet/mellanox/Kconfig | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/mellanox/Kconfig b/drivers/net/ethernet/mellanox/Kconfig
>> index 84a2007..0949741 100644
>> --- a/drivers/net/ethernet/mellanox/Kconfig
>> +++ b/drivers/net/ethernet/mellanox/Kconfig
>> @@ -5,7 +5,7 @@
>>  config NET_VENDOR_MELLANOX
>>  	bool "Mellanox devices"
>>  	default y
>> -	depends on PCI
>> +	depends on PCI || I2C
>>  	---help---
>>  	  If you have a network (Ethernet) card belonging to this class, say Y.
>>
>> --
>> 2.8.0
>>

Patch

diff --git a/drivers/net/ethernet/mellanox/Kconfig b/drivers/net/ethernet/mellanox/Kconfig
index 84a2007..0949741 100644
--- a/drivers/net/ethernet/mellanox/Kconfig
+++ b/drivers/net/ethernet/mellanox/Kconfig
@@ -5,7 +5,7 @@ 
 config NET_VENDOR_MELLANOX
 	bool "Mellanox devices"
 	default y
-	depends on PCI
+	depends on PCI || I2C
 	---help---
 	  If you have a network (Ethernet) card belonging to this class, say Y.