[ofa-general] [PATCH][RFC] dapl v1.2: change packaging to modify OFA provider contents of dat.conf instead of file replacement.

Davis, Arlin R arlin.r.davis at intel.com
Mon Apr 14 15:38:02 PDT 2008


Change the packaging to update only the OFA provider contents in
dat.conf. This allows other
dapl providers, other then OFA, to co-exist and configure properly.
Adding man page to explain
syntax of static configuration file since there will no longer be
comments in dat.conf.

Signed-off by: Arlin Davis ardavis at ichips.intel.com
---
 Makefile.am    |   23 +++++++++++++++++---
 dapl.spec.in   |   25 +++++++++++++++++++---
 doc/dat.conf   |   26 -----------------------
 man/dat.conf.5 |   62
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 102 insertions(+), 34 deletions(-)
 delete mode 100644 doc/dat.conf
 create mode 100644 man/dat.conf.5

diff --git a/Makefile.am b/Makefile.am
index 5621768..079ad7f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,8 +17,6 @@ else
 DBGFLAGS = -g
 endif
 
-sysconf_DATA = doc/dat.conf
-
 datlibdir = $(libdir)
 dapllibcmadir = $(libdir)
 
@@ -183,7 +181,7 @@ libdatinclude_HEADERS = dat/include/dat/dat.h \
 			dat/include/dat/udat_redirection.h \
 			dat/include/dat/udat_vendor_specific.h 
 		
-man_MANS = man/dtest.1 man/dapltest.1 
+man_MANS = man/dtest.1 man/dapltest.1 man/dat.conf.5 
     	
 EXTRA_DIST = dat/common/dat_dictionary.h \
 	     dat/common/dat_dr.h \
@@ -231,7 +229,6 @@ EXTRA_DIST = dat/common/dat_dictionary.h \
 	     dapl/openib_scm/dapl_ib_dto.h \
 	     dapl/openib_scm/dapl_ib_util.h \
 	     dat/udat/libdat.map \
-	     doc/dat.conf \
 	     dapl/udapl/libdaplcma.map \
 	     dapl.spec.in \
 	     $(man_MANS) \
@@ -265,5 +262,23 @@ EXTRA_DIST = dat/common/dat_dictionary.h \
 	 
 dist-hook: dapl.spec 
 	cp dapl.spec $(distdir)
+
+install-exec-hook:
+	if test -e $(sysconfdir)/dat.conf; then \
+		echo "exec-hook"; \
+		sed -e '/OpenIB-.* u1/d' < $(sysconfdir)/dat.conf >
/tmp/$$$$OpenIBdapl; \
+		cp /tmp/$$$$OpenIBdapl $(sysconfdir)/dat.conf; \
+	fi; \
+	echo OpenIB-cma u1.2 nonthreadsafe default libdaplcma.so.1
dapl.1.2 '"ib0 0" ""' >> $(sysconfdir)/dat.conf; \
+	echo OpenIB-cma-1 u1.2 nonthreadsafe default libdaplcma.so.1
dapl.1.2 '"ib1 0" ""' >> $(sysconfdir)/dat.conf; \
+	echo OpenIB-cma-2 u1.2 nonthreadsafe default libdaplcma.so.1
dapl.1.2 '"ib2 0" ""' >> $(sysconfdir)/dat.conf; \
+	echo OpenIB-cma-3 u1.2 nonthreadsafe default libdaplcma.so.1
dapl.1.2 '"ib3 0" ""' >> $(sysconfdir)/dat.conf; \
+	echo OpenIB-bond u1.2 nonthreadsafe default libdaplcma.so.1
dapl.1.2 '"bond0 0" ""' >> $(sysconfdir)/dat.conf;
+
+uninstall-hook:
+	if test -e $(sysconfdir)/dat.conf; then \
+		sed -e '/OpenIB-.* u1/d' < $(sysconfdir)/dat.conf >
/tmp/$$$$OpenIBdapl; \
+		cp /tmp/$$$$OpenIBdapl $(sysconfdir)/dat.conf; \
+	fi;
 	
 SUBDIRS = . test/dtest test/dapltest
diff --git a/dapl.spec.in b/dapl.spec.in
index e3875a1..239e285 100644
--- a/dapl.spec.in
+++ b/dapl.spec.in
@@ -87,13 +87,29 @@ rm -f %{buildroot}%{_libdir}/*.la
 %clean
 rm -rf %{buildroot}
 
-%post -p /sbin/ldconfig
-%postun -p /sbin/ldconfig
+%post
+/sbin/ldconfig
+if [ -e %{_sysconfdir}/dat.conf ]; then
+    sed -e '/OpenIB-.* u1/d' < %{_sysconfdir}/dat.conf > /tmp/$$ofadapl
+    mv /tmp/$$ofadapl %{_sysconfdir}/dat.conf
+fi
+echo OpenIB-cma u1.2 nonthreadsafe default libdaplcma.so.1 dapl.1.2
'"ib0 0" ""'  >> %{_sysconfdir}/dat.conf
+echo OpenIB-cma-1 u1.2 nonthreadsafe default libdaplcma.so.1 dapl.1.2
'"ib1 0" ""'  >> %{_sysconfdir}/dat.conf
+echo OpenIB-cma-2 u1.2 nonthreadsafe default libdaplcma.so.1 dapl.1.2
'"ib2 0" ""'  >> %{_sysconfdir}/dat.conf
+echo OpenIB-cma-3 u1.2 nonthreadsafe default libdaplcma.so.1 dapl.1.2
'"ib3 0" ""'  >> %{_sysconfdir}/dat.conf
+echo OpenIB-bond u1.2 nonthreadsafe default libdaplcma.so.1 dapl.1.2
'"bond0 0" ""'  >> %{_sysconfdir}/dat.conf
+
+
+%postun
+/sbin/ldconfig
+if [ -e %{_sysconfdir}/dat.conf ]; then
+    sed -e '/OpenIB-.* u1/d' < %{_sysconfdir}/dat.conf >
/tmp/$$OpenIBdapl
+    mv /tmp/$$OpenIBdapl %{_sysconfdir}/dat.conf
+fi
 
 %files
 %defattr(-,root,root,-)
 %{_libdir}/libda*.so.*
-%config(noreplace) %{_sysconfdir}/dat.conf
 %doc AUTHORS README ChangeLog
 
 %files devel
@@ -109,7 +125,8 @@ rm -rf %{buildroot}
 %files utils
 %defattr(-,root,root,-)
 %{_bindir}/*
-%{_mandir}/man1/*
+%{_mandir}/man1/*.1*
+%{_mandir}/man5/*.5*
 
 %changelog
 * Thu Feb 14 2008 Arlin Davis <ardavis at ichips.intel.com> - 1.2.5
diff --git a/doc/dat.conf b/doc/dat.conf
deleted file mode 100644
index 06142f8..0000000
--- a/doc/dat.conf
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# DAT 1.2 and 2.0 configuration file
-#
-# Each entry should have the following fields:
-#
-# <ia_name> <api_version> <threadsafety> <default> <lib_path> \
-#           <provider_version> <ia_params> <platform_params>
-#
-# For the uDAPL cma provder, specify <ia_params> as one of the
following:
-#       network address, network hostname, or netdev name and 0 for
port
-#
-# Simple (OpenIB-cma) default with netdev name provided first on list
-# to enable use of same dat.conf version on all nodes
-#
-# 1.2 and 2.0 examples for multiple interfaces, IPoIB HA failover,
bonding:
-#
-OpenIB-cma u1.2 nonthreadsafe default libdaplcma.so.1 dapl.1.2 "ib0 0"
""
-OpenIB-cma-1 u1.2 nonthreadsafe default libdaplcma.so.1 dapl.1.2 "ib1
0" ""
-OpenIB-cma-2 u1.2 nonthreadsafe default libdaplcma.so.1 dapl.1.2 "ib2
0" ""
-OpenIB-cma-3 u1.2 nonthreadsafe default libdaplcma.so.1 dapl.1.2 "ib3
0" ""
-OpenIB-bond u1.2 nonthreadsafe default libdaplcma.so.1 dapl.1.2 "bond0
0" ""
-ofa-v2-ib0 u2.0 nonthreadsafe default libdaplofa.so.2 dapl.2.0 "ib0 0"
""
-ofa-v2-ib1 u2.0 nonthreadsafe default libdaplofa.so.2 dapl.2.0 "ib1 0"
""
-ofa-v2-ib2 u2.0 nonthreadsafe default libdaplofa.so.2 dapl.2.0 "ib2 0"
""
-ofa-v2-ib3 u2.0 nonthreadsafe default libdaplofa.so.2 dapl.2.0 "ib3 0"
""
-ofa-v2-bond u2.0 nonthreadsafe default libdaplofa.so.2 dapl.2.0 "bond0
0" ""
diff --git a/man/dat.conf.5 b/man/dat.conf.5
new file mode 100644
index 0000000..6dee668
--- /dev/null
+++ b/man/dat.conf.5
@@ -0,0 +1,62 @@
+.TH "DAT.CONF" "5" "25 March 2008" "" ""
+.SH NAME
+dat.conf \- configuration file for static registration of user-level
DAT rdma providers
+.SH "DESCRIPTION"
+.PP
+The DAT (direct access transport) architecture supports the use of 
+multiple DAT providers within a single consumer application. 
+Consumers implicitly select a provider using the Interface Adapter 
+name parameter passed to dat_ia_open().
+.PP
+The subsystem that maps Interface Adapter names to provider
+implementations is known as the DAT registry. When a consumer calls
+dat_ia_open(), the appropriate provider is found and notified of the
+consumer's request to access the IA. After this point, all DAT API
+calls acting on DAT objects are automatically directed to the
+appropriate provider entry points.
+.PP
+A persistent, administratively configurable database is used to store
+mappings from IA names to provider information. This provider
+information includes: the file system path to the provider library
+object, version information, and thread safety information. The
+location and format of the registry is platform dependent. This
+database is known as the Static Registry (SR) and is provided via
+entries in the \fIdat.conf\fR file. The process of adding a provider 
+entry is termed Static Registration.
+.PP
+.SH "Registry File Format"
+\br 
+    * All characters after # on a line are ignored (comments).
+    * Lines on which there are no characters other than whitespace
+      and comments are considered blank lines and are ignored.
+    * Non-blank lines must have seven whitespace separated fields.
+      These fields may contain whitespace if the field is quoted
+      with double quotes. Within fields quoated with double quotes,
+      the backslash or qoute are valid escape sequences:
+    * Each non-blank line will contain the following fields:
+        - The IA Name.
+        - The API version of the library:
+          [k|u]major.minor where "major" and "minor" are both integers
+          in decimal format. User-level examples: "u1.2", and "u2.0".
+        - Whether the library is thread-safe:
[threadsafe|nonthreadsafe]
+        - Whether this is the default section: [default|nondefault]
+        - The library image, version included, to be loaded.
+        - The vendor id and version of DAPL provider: id.major.minor  
+        - ia params, IA specific parameters - device name and port
+        - platform params, (not used) 
+.PP
+.SH Example netdev entries for OpenFabrics rdma_cm providers, both v1.2
and v2.0 
+\br 
+        OpenIB-cma u1.2 nonthreadsafe default libdaplcma.so.1 dapl.1.2
"ib0 0" ""
+        ofa-v2-ib0 u2.0 nonthreadsafe default libdaplofa.so.2 dapl.2.0
"ib0 0" ""
+
+        NOTE: The OpenFabrics providers use <ia_params> to specify the
device with one of the following:
+              network address, network hostname, or netdev name; along
with port number.
+
+              The OpenIB- and ofa-v2- IA names are unique mappings.
Reserved for OpenFabrics providers. 
+.PP
+The default location for this configuration file is /etc/dat.conf. 
+The file location may be overridden with the environment variable
DAT_OVERRIDE=/your_own_directory/your_dat.conf. 
+.PP
+.SH "SEE ALSO"
+.PP
-- 
1.5.2.5




More information about the general mailing list