netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mlx4_en: added pci_device_id table
@ 2009-06-09 12:53 Yevgeny Petrilin
  2009-06-10  4:37 ` Roland Dreier
  2009-06-11 10:05 ` David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Yevgeny Petrilin @ 2009-06-09 12:53 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Tziporet Koren

This is required to ensure that mlx4_en module loads on boot when
there are ConnectX devices installed.
The driver is compound from two modules: mlx4_core, the low level module
and mlx4_en. Currently mlx4_core is the only module that is loaded on boot,
this is not enough to enable the ConnectX Ethernet interfaces.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
---
 drivers/net/mlx4/en_main.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/drivers/net/mlx4/en_main.c b/drivers/net/mlx4/en_main.c
index 9ed4a15..862696f 100644
--- a/drivers/net/mlx4/en_main.c
+++ b/drivers/net/mlx4/en_main.c
@@ -266,6 +266,22 @@ static struct mlx4_interface mlx4_en_interface = {
 	.event	= mlx4_en_event,
 };
 
+static struct pci_device_id mlx4_en_pci_table[] = {
+	{ PCI_VDEVICE(MELLANOX, 0x6340) }, /* MT25408 "Hermon" SDR */
+	{ PCI_VDEVICE(MELLANOX, 0x634a) }, /* MT25408 "Hermon" DDR */
+	{ PCI_VDEVICE(MELLANOX, 0x6354) }, /* MT25408 "Hermon" QDR */
+	{ PCI_VDEVICE(MELLANOX, 0x6732) }, /* MT25408 "Hermon" DDR PCIe gen2 */
+	{ PCI_VDEVICE(MELLANOX, 0x673c) }, /* MT25408 "Hermon" QDR PCIe gen2 */
+	{ PCI_VDEVICE(MELLANOX, 0x6368) }, /* MT25408 "Hermon"EN 10GigE */
+	{ PCI_VDEVICE(MELLANOX, 0x6750) }, /* MT25408 "Hermon"EN 10GigE + Gen2 */
+	{ PCI_VDEVICE(MELLANOX, 0x6372) }, /* MT25408 "YATIR" EN 10GigE */
+	{ PCI_VDEVICE(MELLANOX, 0x675a) }, /* MT25408 "YATIR" EN 10GigE + Gen2 */
+	{ 0, }
+};
+
+MODULE_DEVICE_TABLE(pci, mlx4_en_pci_table);
+
+
 static int __init mlx4_en_init(void)
 {
 	return mlx4_register_interface(&mlx4_en_interface);
-- 
1.6.0


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

* Re: [PATCH] mlx4_en: added pci_device_id table
  2009-06-09 12:53 [PATCH] mlx4_en: added pci_device_id table Yevgeny Petrilin
@ 2009-06-10  4:37 ` Roland Dreier
  2009-06-10  6:37   ` Yevgeny Petrilin
  2009-06-11 10:05 ` David Miller
  1 sibling, 1 reply; 6+ messages in thread
From: Roland Dreier @ 2009-06-10  4:37 UTC (permalink / raw)
  To: Yevgeny Petrilin; +Cc: David Miller, netdev, Tziporet Koren

Interesting approach...

 > +	{ PCI_VDEVICE(MELLANOX, 0x6340) }, /* MT25408 "Hermon" SDR */
 > +	{ PCI_VDEVICE(MELLANOX, 0x634a) }, /* MT25408 "Hermon" DDR */
 > +	{ PCI_VDEVICE(MELLANOX, 0x6354) }, /* MT25408 "Hermon" QDR */
 > +	{ PCI_VDEVICE(MELLANOX, 0x6732) }, /* MT25408 "Hermon" DDR PCIe gen2 */
 > +	{ PCI_VDEVICE(MELLANOX, 0x673c) }, /* MT25408 "Hermon" QDR PCIe gen2 */

does it make sense to load mlx4_en for these IB devices?

 - R.

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

* Re: [PATCH] mlx4_en: added pci_device_id table
  2009-06-10  4:37 ` Roland Dreier
@ 2009-06-10  6:37   ` Yevgeny Petrilin
  0 siblings, 0 replies; 6+ messages in thread
From: Yevgeny Petrilin @ 2009-06-10  6:37 UTC (permalink / raw)
  To: Roland Dreier; +Cc: David Miller, netdev, Tziporet Koren

Roland Dreier wrote:
> Interesting approach...
> 
>  > +	{ PCI_VDEVICE(MELLANOX, 0x6340) }, /* MT25408 "Hermon" SDR */
>  > +	{ PCI_VDEVICE(MELLANOX, 0x634a) }, /* MT25408 "Hermon" DDR */
>  > +	{ PCI_VDEVICE(MELLANOX, 0x6354) }, /* MT25408 "Hermon" QDR */
>  > +	{ PCI_VDEVICE(MELLANOX, 0x6732) }, /* MT25408 "Hermon" DDR PCIe gen2 */
>  > +	{ PCI_VDEVICE(MELLANOX, 0x673c) }, /* MT25408 "Hermon" QDR PCIe gen2 */
> 
> does it make sense to load mlx4_en for these IB devices?
> 
>  - R.
> 
These are not "IB only" devices.
They are all "Multi protocol" devices and can function both as IB or Ethernet

Yevgeny

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

* Re: [PATCH] mlx4_en: added pci_device_id table
  2009-06-09 12:53 [PATCH] mlx4_en: added pci_device_id table Yevgeny Petrilin
  2009-06-10  4:37 ` Roland Dreier
@ 2009-06-11 10:05 ` David Miller
  2009-06-11 14:40   ` Yevgeny Petrilin
  1 sibling, 1 reply; 6+ messages in thread
From: David Miller @ 2009-06-11 10:05 UTC (permalink / raw)
  To: yevgenyp; +Cc: netdev, tziporet

From: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Date: Tue, 09 Jun 2009 15:53:47 +0300

> This is required to ensure that mlx4_en module loads on boot when
> there are ConnectX devices installed.
> The driver is compound from two modules: mlx4_core, the low level module
> and mlx4_en. Currently mlx4_core is the only module that is loaded on boot,
> this is not enough to enable the ConnectX Ethernet interfaces.
> 
> Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>

This is pretty ugly.

Two modules with the same exact module ID table smells like bad
design.  I see no harm in you combining all of this code into one
final module object.

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

* Re: [PATCH] mlx4_en: added pci_device_id table
  2009-06-11 10:05 ` David Miller
@ 2009-06-11 14:40   ` Yevgeny Petrilin
  2009-06-11 23:17     ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Yevgeny Petrilin @ 2009-06-11 14:40 UTC (permalink / raw)
  To: David Miller, Roland Dreier; +Cc: netdev, tziporet

David Miller wrote:
> From: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
> Date: Tue, 09 Jun 2009 15:53:47 +0300
> 
>> This is required to ensure that mlx4_en module loads on boot when
>> there are ConnectX devices installed.
>> The driver is compound from two modules: mlx4_core, the low level module
>> and mlx4_en. Currently mlx4_core is the only module that is loaded on boot,
>> this is not enough to enable the ConnectX Ethernet interfaces.
>>
>> Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
> 
> This is pretty ugly.
> 
> Two modules with the same exact module ID table smells like bad
> design.  I see no harm in you combining all of this code into one
> final module object.
> 

I can make some changes like defining the table once and both the modules using the same table.

As for combining the modules, it is not something we would like to do.
mlx4_en module is not the only "customer" of mlx4_core, there is also mlx4_ib and mlx4_fc (in the near future).
According to our design, the mlx4_core module is protocol independent and gives services (like command interface and HW
resources management) to the modules mentioned above.

Roland, what do you think? 

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

* Re: [PATCH] mlx4_en: added pci_device_id table
  2009-06-11 14:40   ` Yevgeny Petrilin
@ 2009-06-11 23:17     ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2009-06-11 23:17 UTC (permalink / raw)
  To: yevgenyp; +Cc: rdreier, netdev, tziporet

From: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Date: Thu, 11 Jun 2009 17:40:05 +0300

> As for combining the modules, it is not something we would like to
> do.  mlx4_en module is not the only "customer" of mlx4_core, there
> is also mlx4_ib and mlx4_fc (in the near future).  According to our
> design, the mlx4_core module is protocol independent and gives
> services (like command interface and HW resources management) to the
> modules mentioned above.

Other drivers handle this IB usage of a networking device core more
elegantly, I'm pretty sure.

There is nothing that prevents you from making the mlx4_en networking
device driver be one module and export symbols that the IB driver can
make use of.

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

end of thread, other threads:[~2009-06-11 23:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-09 12:53 [PATCH] mlx4_en: added pci_device_id table Yevgeny Petrilin
2009-06-10  4:37 ` Roland Dreier
2009-06-10  6:37   ` Yevgeny Petrilin
2009-06-11 10:05 ` David Miller
2009-06-11 14:40   ` Yevgeny Petrilin
2009-06-11 23:17     ` David Miller

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