Activate kernel bypass logic
authorKanoj Sarcar' via Akaros <akaros@googlegroups.com>
Thu, 11 Feb 2016 01:11:53 +0000 (17:11 -0800)
committerBarret Rhoden <brho@cs.berkeley.edu>
Wed, 17 Feb 2016 22:23:14 +0000 (17:23 -0500)
Hook in mlx4/ driver to activate kernel bypass logic.

Signed-off-by: Kanoj Sarcar <kanoj@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/drivers/net/Kbuild
kern/drivers/net/Kconfig
kern/drivers/net/mlx4/main.c

index 4901efb..6b57bb7 100644 (file)
@@ -2,6 +2,8 @@
 obj-y                                                  += dummy.o
 obj-$(CONFIG_BNX2X)                            += bnx2x/
 obj-$(CONFIG_MLX4_CORE)                                        += mlx4/
+obj-$(CONFIG_MLX4_INFINIBAND)                          += mlx4u/
+obj-$(CONFIG_MLX4_INFINIBAND)                          += udrvr/
 obj-y                                                  += ether8139.o
 obj-y                                                  += ether8169.o
 obj-y                                                  += ether82563.o
index 1d43190..e0323de 100644 (file)
@@ -15,6 +15,7 @@ config BNX2X_SRIOV
 config MLX4_EN
        tristate "Mellanox Technologies 1/10/40Gbit Ethernet support"
        select MLX4_CORE
+       select MLX4_INFINIBAND
        help
                This driver supports Mellanox Technologies ConnectX Ethernet
                devices.
@@ -29,3 +30,7 @@ config MLX4_DEFAULT_MGM_LOG_ENTRY_SIZE
        default 10
        help
                To activate device managed flow steering when available, set to -1.
+
+config MLX4_INFINIBAND
+       tristate
+       default n
index 9b88c0a..a664d68 100644 (file)
@@ -3949,6 +3949,29 @@ static int mlx4_pnp(struct ether *edev)
        persist->edev = edev;
        mlx4_en_init();
 
+       /*
+        * In Linux, this is the module initialization vs device probe sequence:
+        * Core init routine mlx4_init() first executes, then EN/IB interface
+        * registration (mlx4_en_init(), mlx4_ib_init() invokes
+        * mlx4_register_interface()). Then, probe flow
+        * mlx4_pnp():mlx4_init_one():__mlx4_init_one():mlx4_load_one() does
+        * mlx4_register_device(). This causes all registered
+        * interface handlers (mlx4_en_add(), mlx4_ib_add()) to be invoked.
+        *
+        * In Akaros, the flow is different. Device probe flow first does
+        * mlx4_register_device(). Then core init mlx4_init() followed by
+        * interface registration. What should really happen is that
+        * mlx4_init(), mlx4_en_init() and mlx4_ib_init() should be invoked
+        * from ethermlx4_link() prior to device probe.
+        */
+#ifdef CONFIG_MLX4_INFINIBAND
+       extern int mlx4_ib_init();
+       extern int ib_uverbs_init();
+
+       ib_uverbs_init();
+       mlx4_ib_init();
+#endif
+
        // edev->ctlr is already initialized to struct mlx4_en_priv.
        pdev = persist->pdev;
        edev->irq = pdev->irqline;