Skip to contentSkip to conversation

mlx4_en: added pci_device_id table

PATCH In review Yevgeny Petrilin 3 participants 6 messages Jun 9, 2009 – Jun 11, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mlx4_en: added pci_device_id table

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.

---
 drivers/net/mlx4/en_main.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
drivers/net/mlx4/en_main.c +16 -0
index 9ed4a15..862696f 100644
@@ -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);
Signature · 1 line
1.6.0
#1 lore raw

Interesting approach...

drivers/net/mlx4/en_main.c static struct mlx4_interface mlx4_en_interface = { · line 274

Quoted 5 lines
drivers/net/mlx4/en_main.c +5 -0
+	{ 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.

#2 lore raw
Quoted 10 lines · Roland Dreier

Interesting approach...

drivers/net/mlx4/en_main.c static struct mlx4_interface mlx4_en_interface = { · line 274

Quoted 5 lines
drivers/net/mlx4/en_main.c +5 -0
+	{ 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?

Quoted 2 lines

- R.

These are not "IB only" devices.
They are all "Multi protocol" devices and can function both as IB or Ethernet

Yevgeny

maintainer
#3 lore raw
In reply to Yevgeny Petrilin

From: Yevgeny Petrilin <[email protected]>
Date: Tue, 09 Jun 2009 15:53:47 +0300

Quoted 7 lines

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.

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.

#4 lore raw
Quoted 9 lines · David Miller

From: Yevgeny Petrilin <[email protected]>
Date: Tue, 09 Jun 2009 15:53:47 +0300

Quoted 6 lines

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.

Quoted 8 lines
Quoted 1 line

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?

maintainer
#5 lore raw

From: Yevgeny Petrilin <[email protected]>
Date: Thu, 11 Jun 2009 17:40:05 +0300

Quoted 6 lines

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.