[openib-general] [PATCH] gen2: Only include CM and DM client in kernel build when needed

Hal Rosenstock halr at voltaire.com
Sat Aug 7 12:01:11 PDT 2004


On Roland's gen2 branch, the following patch causes CM and DM client to
be included in the kernel build only when needed. One example of this is
when only building for IPoIB.

Index: src/linux-kernel/infiniband/ulp/Kconfig
===================================================================
--- src/linux-kernel/infiniband/ulp/Kconfig	(revision 595)
+++ src/linux-kernel/infiniband/ulp/Kconfig	(working copy)
@@ -2,7 +2,7 @@
 	tristate "IP-over-InfiniBand"
 	depends on INFINIBAND && NETDEVICES && INET
 	---help---
-	  Support for the IP-over-InfiniBand protocol (IPoIB).	This
+	  Support for the IETF IP-over-InfiniBand protocol (IPoIB). This
 	  transports IP packets over InfiniBand so you can use your IB
 	  device as a fancy NIC.  To configure interfaces on multiple
 	  InfiniBand partitions (P_Keys) you will need the ipoibcfg
@@ -14,6 +14,7 @@
 config INFINIBAND_SDP
 	tristate "Sockets Direct Protocol"
 	depends on INFINIBAND && INFINIBAND_IPOIB
+	select INFINIBAND_CM
 	---help---
 	  Support for Sockets Direct Protocol (SDP).  This provides
 	  sockets semantics over InfiniBand via address family
@@ -24,7 +25,9 @@
 config INFINIBAND_SRP
 	tristate "SCSI RDMA Protocol"
 	depends on INFINIBAND && SCSI
-	---help---
+	select INFINIBAND_CM
+	select INFINIBAND_DM_CLIENT
+		---help---
 	  Support for SCSI RDMA Protocol (SRP).	 This transports SCSI
 	  commands over InfiniBand and allows you to access storage
 	  connected via IB.
@@ -33,6 +36,7 @@
 	tristate "uDAPL helper"
 	depends on (BROKEN || m) && INFINIBAND && INFINIBAND_MELLANOX_HCA
 	select INFINIBAND_USER_CM
+	select INFINIBAND_CM
 	---help---
 	  Kernel space helper for uDAPL.  Select this and use the uDAPL
 	  library from <http://openib.org> to run uDAPL applications.
Index: src/linux-kernel/infiniband/Kconfig
===================================================================
--- src/linux-kernel/infiniband/Kconfig	(revision 595)
+++ src/linux-kernel/infiniband/Kconfig	(working copy)
@@ -17,6 +17,21 @@
 	  This allows userspace protocols such as uDAPL or MPI to use
 	  the kernel's services for establishing connections.
 
+config INFINIBAND_CM
+	bool "CM"
+	depends on INFINIBAND 
+	default y if (INFINIBAND_USER_CM || INFINIBAND_SRP || INFINIBAND_SDP)
+	---help---
+	Kernel communication manager. Needed for connection oriented protocols
+	such as SRP, SDP, DAPL, or MPI.
+
+config INFINIBAND_DM_CLIENT
+	bool "DM client"
+	depends on INFINIBAND 
+	default y if INFINIBAND_SRP
+	---help---
+	Device Manager (DM) client. Needed for SRP.
+
 source "drivers/infiniband/ulp/Kconfig"
 source "drivers/infiniband/hw/Kconfig"
 
Index: src/linux-kernel/infiniband/core/Makefile
===================================================================
--- src/linux-kernel/infiniband/core/Makefile	(revision 595)
+++ src/linux-kernel/infiniband/core/Makefile	(working copy)
@@ -9,11 +9,19 @@
 
 obj-$(CONFIG_INFINIBAND) += \
     ib_core.o \
-    ib_mad.o \
-    ib_cm.o \
+    ib_mad.o
+ifdef CONFIG_INFINIBAND_CM
+obj-$(CONFIG_INFINIBAND) +=  \
+    ib_cm.o
+endif 
+obj-$(CONFIG_INFINIBAND) +=  \
     ib_client_query.o \
-    ib_sa_client.o \
-    ib_dm_client.o \
+    ib_sa_client.o
+ifdef CONFIG_INFINIBAND_DM_CLIENT
+obj-$(CONFIG_INFINIBAND) +=  \
+    ib_dm_client.o 
+endif
+obj-$(CONFIG_INFINIBAND) +=  \
     ib_useraccess.o
 
 obj-$(CONFIG_INFINIBAND_USER_CM) += \
@@ -54,6 +62,7 @@
     mad_proc.o \
     mad_export.o
 
+ifdef CONFIG_INFINIBAND_CM
 ib_cm-objs := \
     cm_main.o \
     cm_api.o \
@@ -64,6 +73,7 @@
     cm_connection_table.o \
     cm_service_table.o \
     cm_proc.o
+endif
 
 ib_client_query-objs := \
     client_query.o \
@@ -81,6 +91,7 @@
     sa_client_export.o \
     sa_client_node_info.o
 
+ifdef CONFIG_INFINIBAND_DM_CLIENT
 ib_dm_client-objs := \
     dm_client_main.o \
     dm_client_query.o \
@@ -90,6 +101,7 @@
     dm_client_ioc_profile.o \
     dm_client_svc_entries.o \
     dm_client_host.o
+endif
 
 ib_useraccess-objs := \
     useraccess_main.o \
@@ -104,6 +116,7 @@
     $(obj)/pm_access.h $(obj)/pm_types.h 
 
 $(obj)/mad_static.o: $(obj)/smp_access.h $(obj)/smp_types.h
+
 $(ib_cm-objs:%=$(obj)/%): $(obj)/cm_packet.h
 
 quiet_cmd_gendecode = GEN     $@








More information about the general mailing list