[Pkg-ofed-commits] [srptools] 01/02: Imported Upstream version 1.0.3
Ana Beatriz Guerrero López
ana at moszumanska.debian.org
Thu Jul 23 10:35:08 UTC 2015
This is an automated email from the git hooks/post-receive script.
ana pushed a commit to branch master
in repository srptools.
commit 3f405373a69e3396b7c8446845ce81d7061adc5a
Author: Ana Guerrero López <ana at ekaia.org>
Date: Thu Jul 23 12:31:37 2015 +0200
Imported Upstream version 1.0.3
---
Makefile.am | 1 +
Makefile.in | 107 +++++++++--------
autogen.sh | 7 ++
build-deb.sh | 68 +++++++++++
configure | 20 ++--
configure.ac | 4 +-
srp_daemon/srp_daemon.c | 259 +++++++++++++++++++++++++++++++-----------
srp_daemon/srp_daemon.h | 11 +-
srp_daemon/srp_handle_traps.c | 36 +++---
srp_daemon/srp_sync.c | 4 +-
srptools.spec | 21 +++-
srptools.spec.in | 19 +++-
12 files changed, 400 insertions(+), 157 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index e43eab0..7efea9d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,6 +15,7 @@ sbin_SCRIPTS = \
srp_daemon/srp_daemon.sh
EXTRA_DIST = \
+ autogen.sh build-deb.sh debian \
srp_daemon/srp_daemon.h \
srp_daemon/srp_ib_types.h \
srp_daemon/srp_daemon.sh \
diff --git a/Makefile.in b/Makefile.in
index f7d1288..2fbda69 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -101,15 +101,15 @@ CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sbindir)" \
"$(DESTDIR)$(man1dir)"
PROGRAMS = $(sbin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
am_srp_daemon_srp_daemon_OBJECTS = \
- srp_daemon_srp_daemon-srp_daemon.$(OBJEXT) \
- srp_daemon_srp_daemon-srp_handle_traps.$(OBJEXT) \
- srp_daemon_srp_daemon-srp_sync.$(OBJEXT)
+ srp_daemon/srp_daemon_srp_daemon-srp_daemon.$(OBJEXT) \
+ srp_daemon/srp_daemon_srp_daemon-srp_handle_traps.$(OBJEXT) \
+ srp_daemon/srp_daemon_srp_daemon-srp_sync.$(OBJEXT)
srp_daemon_srp_daemon_OBJECTS = $(am_srp_daemon_srp_daemon_OBJECTS)
srp_daemon_srp_daemon_DEPENDENCIES =
srp_daemon_srp_daemon_LINK = $(CCLD) $(srp_daemon_srp_daemon_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am__dirstamp = $(am__leading_dot)dirstamp
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -320,6 +320,7 @@ sbin_SCRIPTS = \
srp_daemon/srp_daemon.sh
EXTRA_DIST = \
+ autogen.sh build-deb.sh debian \
srp_daemon/srp_daemon.h \
srp_daemon/srp_ib_types.h \
srp_daemon/srp_daemon.sh \
@@ -432,6 +433,18 @@ clean-sbinPROGRAMS:
srp_daemon/$(am__dirstamp):
@$(MKDIR_P) srp_daemon
@: > srp_daemon/$(am__dirstamp)
+srp_daemon/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) srp_daemon/$(DEPDIR)
+ @: > srp_daemon/$(DEPDIR)/$(am__dirstamp)
+srp_daemon/srp_daemon_srp_daemon-srp_daemon.$(OBJEXT): \
+ srp_daemon/$(am__dirstamp) \
+ srp_daemon/$(DEPDIR)/$(am__dirstamp)
+srp_daemon/srp_daemon_srp_daemon-srp_handle_traps.$(OBJEXT): \
+ srp_daemon/$(am__dirstamp) \
+ srp_daemon/$(DEPDIR)/$(am__dirstamp)
+srp_daemon/srp_daemon_srp_daemon-srp_sync.$(OBJEXT): \
+ srp_daemon/$(am__dirstamp) \
+ srp_daemon/$(DEPDIR)/$(am__dirstamp)
srp_daemon/srp_daemon$(EXEEXT): $(srp_daemon_srp_daemon_OBJECTS) $(srp_daemon_srp_daemon_DEPENDENCIES) $(EXTRA_srp_daemon_srp_daemon_DEPENDENCIES) srp_daemon/$(am__dirstamp)
@rm -f srp_daemon/srp_daemon$(EXEEXT)
@@ -474,69 +487,72 @@ uninstall-sbinSCRIPTS:
mostlyclean-compile:
-rm -f *.$(OBJEXT)
+ -rm -f srp_daemon/*.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/srp_daemon_srp_daemon-srp_daemon.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/srp_daemon_srp_daemon-srp_handle_traps.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/srp_daemon_srp_daemon-srp_sync.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at srp_daemon/$(DEPDIR)/srp_daemon_srp_daemon-srp_daemon.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at srp_daemon/$(DEPDIR)/srp_daemon_srp_daemon-srp_handle_traps.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at srp_daemon/$(DEPDIR)/srp_daemon_srp_daemon-srp_sync.Po at am__quote@
.c.o:
- at am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+ at am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(COMPILE) -c $<
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
- at am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+ at am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-srp_daemon_srp_daemon-srp_daemon.o: srp_daemon/srp_daemon.c
- at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -MT srp_daemon_srp_daemon-srp_daemon.o -MD -MP -MF $(DEPDIR)/srp_daemon_srp_daemon-srp_daemon.Tpo -c -o srp_daemon_srp_daemon-srp_daemon.o `test -f 'srp_daemon/srp_daemon.c' || echo '$(srcdir)/'`srp_daemon/srp_daemon.c
- at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/srp_daemon_srp_daemon-srp_daemon.Tpo $(DEPDIR)/srp_daemon_srp_daemon-srp_daemon.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='srp_daemon/srp_daemon.c' object='srp_daemon_srp_daemon-srp_daemon.o' libtool=no @AMDEPBACKSLASH@
+srp_daemon/srp_daemon_srp_daemon-srp_daemon.o: srp_daemon/srp_daemon.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -MT srp_daemon/srp_daemon_srp_daemon-srp_daemon.o -MD -MP -MF srp_daemon/$(DEPDIR)/srp_daemon_srp_daemon-srp_daemon.Tpo -c -o srp_daemon/srp_daemon_srp_daemon-srp_daemon.o `test -f 'srp_daemon/srp_daemon.c' || echo '$(srcdir)/'`srp_daemon/srp_daemon.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) srp_daemon/$(DEPDIR)/srp_daemon_srp_daemon-srp_daemon.Tpo srp_daemon/$(DEPDIR)/srp_daemon_srp_daemon-srp_daemon.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='srp_daemon/srp_daemon.c' object='srp_daemon/srp_daemon_srp_daemon-srp_daemon.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -c -o srp_daemon_srp_daemon-srp_daemon.o `test -f 'srp_daemon/srp_daemon.c' || echo '$(srcdir)/'`srp_daemon/srp_daemon.c
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -c -o srp_daemon/srp_daemon_srp_daemon-srp_daemon.o `test -f 'srp_daemon/srp_daemon.c' || echo '$(srcdir)/'`srp_daemon/srp_daemon.c
-srp_daemon_srp_daemon-srp_daemon.obj: srp_daemon/srp_daemon.c
- at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -MT srp_daemon_srp_daemon-srp_daemon.obj -MD -MP -MF $(DEPDIR)/srp_daemon_srp_daemon-srp_daemon.Tpo -c -o srp_daemon_srp_daemon-srp_daemon.obj `if test -f 'srp_daemon/srp_daemon.c'; then $(CYGPATH_W) 'srp_daemon/srp_daemon.c'; else $(CYGPATH_W) '$(srcdir)/srp_daemon/srp_daemon.c'; fi`
- at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/srp_daemon_srp_daemon-srp_daemon.Tpo $(DEPDIR)/srp_daemon_srp_daemon-srp_daemon.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='srp_daemon/srp_daemon.c' object='srp_daemon_srp_daemon-srp_daemon.obj' libtool=no @AMDEPBACKSLASH@
+srp_daemon/srp_daemon_srp_daemon-srp_daemon.obj: srp_daemon/srp_daemon.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -MT srp_daemon/srp_daemon_srp_daemon-srp_daemon.obj -MD -MP -MF srp_daemon/$(DEPDIR)/srp_daemon_srp_daemon-srp_daemon.Tpo -c -o srp_daemon/srp_daemon_srp_daemon-srp_daemon.obj `if test -f 'srp_daemon/srp_daemon.c'; then $(CYGPATH_W) 'srp_daemon/srp_daemon.c'; else $(CYGPATH_W) '$(srcdir)/srp_daemon/srp_daemon.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) srp_daemon/$(DEPDIR)/srp_daemon_srp_daemon-srp_daemon.Tpo srp_daemon/$(DEPDIR)/srp_daemon_srp_daemon-srp_daemon.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='srp_daemon/srp_daemon.c' object='srp_daemon/srp_daemon_srp_daemon-srp_daemon.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -c -o srp_daemon_srp_daemon-srp_daemon.obj `if test -f 'srp_daemon/srp_daemon.c'; then $(CYGPATH_W) 'srp_daemon/srp_daemon.c'; else $(CYGPATH_W) '$(srcdir)/srp_daemon/srp_daemon.c'; fi`
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -c -o srp_daemon/srp_daemon_srp_daemon-srp_daemon.obj `if test -f 'srp_daemon/srp_daemon.c'; then $(CYGPATH_W) 'srp_daemon/srp_daemon.c'; else $(CYGPATH_W) '$(srcdir)/srp_daemon/srp_daemon.c'; fi`
-srp_daemon_srp_daemon-srp_handle_traps.o: srp_daemon/srp_handle_traps.c
- at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -MT srp_daemon_srp_daemon-srp_handle_traps.o -MD -MP -MF $(DEPDIR)/srp_daemon_srp_daemon-srp_handle_traps.Tpo -c -o srp_daemon_srp_daemon-srp_handle_traps.o `test -f 'srp_daemon/srp_handle_traps.c' || echo '$(srcdir)/'`srp_daemon/srp_handle_traps.c
- at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/srp_daemon_srp_daemon-srp_handle_traps.Tpo $(DEPDIR)/srp_daemon_srp_daemon-srp_handle_traps.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='srp_daemon/srp_handle_traps.c' object='srp_daemon_srp_daemon-srp_handle_traps.o' libtool=no @AMDEPBACKSLASH@
+srp_daemon/srp_daemon_srp_daemon-srp_handle_traps.o: srp_daemon/srp_handle_traps.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -MT srp_daemon/srp_daemon_srp_daemon-srp_handle_traps.o -MD -MP -MF srp_daemon/$(DEPDIR)/srp_daemon_srp_daemon-srp_handle_traps.Tpo -c -o srp_daemon/srp_daemon_srp_daemon-srp_handle_traps.o `test -f 'srp_daemon/srp_handle_traps.c' || echo '$(srcdir)/'`srp_daemon/srp_handle_traps.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) srp_daemon/$(DEPDIR)/srp_daemon_srp_daemon-srp_handle_traps.Tpo srp_daemon/$(DEPDIR)/srp_daemon_srp_daemon-srp_handle_traps.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='srp_daemon/srp_handle_traps.c' object='srp_daemon/srp_daemon_srp_daemon-srp_handle_traps.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -c -o srp_daemon_srp_daemon-srp_handle_traps.o `test -f 'srp_daemon/srp_handle_traps.c' || echo '$(srcdir)/'`srp_daemon/srp_handle_traps.c
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -c -o srp_daemon/srp_daemon_srp_daemon-srp_handle_traps.o `test -f 'srp_daemon/srp_handle_traps.c' || echo '$(srcdir)/'`srp_daemon/srp_handle_traps.c
-srp_daemon_srp_daemon-srp_handle_traps.obj: srp_daemon/srp_handle_traps.c
- at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -MT srp_daemon_srp_daemon-srp_handle_traps.obj -MD -MP -MF $(DEPDIR)/srp_daemon_srp_daemon-srp_handle_traps.Tpo -c -o srp_daemon_srp_daemon-srp_handle_traps.obj `if test -f 'srp_daemon/srp_handle_traps.c'; then $(CYGPATH_W) 'srp_daemon/srp_handle_traps.c'; else $(CYGPATH_W) '$(srcdir)/srp_daemon/srp_handle_traps.c'; fi`
- at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/srp_daemon_srp_daemon-srp_handle_traps.Tpo $(DEPDIR)/srp_daemon_srp_daemon-srp_handle_traps.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='srp_daemon/srp_handle_traps.c' object='srp_daemon_srp_daemon-srp_handle_traps.obj' libtool=no @AMDEPBACKSLASH@
+srp_daemon/srp_daemon_srp_daemon-srp_handle_traps.obj: srp_daemon/srp_handle_traps.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -MT srp_daemon/srp_daemon_srp_daemon-srp_handle_traps.obj -MD -MP -MF srp_daemon/$(DEPDIR)/srp_daemon_srp_daemon-srp_handle_traps.Tpo -c -o srp_daemon/srp_daemon_srp_daemon-srp_handle_traps.obj `if test -f 'srp_daemon/srp_handle_traps.c'; then $(CYGPATH_W) 'srp_daemon/srp_handle_traps.c'; else $(CYGPATH_W) '$(srcdir)/srp_daemon/srp_handle_traps [...]
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) srp_daemon/$(DEPDIR)/srp_daemon_srp_daemon-srp_handle_traps.Tpo srp_daemon/$(DEPDIR)/srp_daemon_srp_daemon-srp_handle_traps.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='srp_daemon/srp_handle_traps.c' object='srp_daemon/srp_daemon_srp_daemon-srp_handle_traps.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -c -o srp_daemon_srp_daemon-srp_handle_traps.obj `if test -f 'srp_daemon/srp_handle_traps.c'; then $(CYGPATH_W) 'srp_daemon/srp_handle_traps.c'; else $(CYGPATH_W) '$(srcdir)/srp_daemon/srp_handle_traps.c'; fi`
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -c -o srp_daemon/srp_daemon_srp_daemon-srp_handle_traps.obj `if test -f 'srp_daemon/srp_handle_traps.c'; then $(CYGPATH_W) 'srp_daemon/srp_handle_traps.c'; else $(CYGPATH_W) '$(srcdir)/srp_daemon/srp_handle_traps.c'; fi`
-srp_daemon_srp_daemon-srp_sync.o: srp_daemon/srp_sync.c
- at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -MT srp_daemon_srp_daemon-srp_sync.o -MD -MP -MF $(DEPDIR)/srp_daemon_srp_daemon-srp_sync.Tpo -c -o srp_daemon_srp_daemon-srp_sync.o `test -f 'srp_daemon/srp_sync.c' || echo '$(srcdir)/'`srp_daemon/srp_sync.c
- at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/srp_daemon_srp_daemon-srp_sync.Tpo $(DEPDIR)/srp_daemon_srp_daemon-srp_sync.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='srp_daemon/srp_sync.c' object='srp_daemon_srp_daemon-srp_sync.o' libtool=no @AMDEPBACKSLASH@
+srp_daemon/srp_daemon_srp_daemon-srp_sync.o: srp_daemon/srp_sync.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -MT srp_daemon/srp_daemon_srp_daemon-srp_sync.o -MD -MP -MF srp_daemon/$(DEPDIR)/srp_daemon_srp_daemon-srp_sync.Tpo -c -o srp_daemon/srp_daemon_srp_daemon-srp_sync.o `test -f 'srp_daemon/srp_sync.c' || echo '$(srcdir)/'`srp_daemon/srp_sync.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) srp_daemon/$(DEPDIR)/srp_daemon_srp_daemon-srp_sync.Tpo srp_daemon/$(DEPDIR)/srp_daemon_srp_daemon-srp_sync.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='srp_daemon/srp_sync.c' object='srp_daemon/srp_daemon_srp_daemon-srp_sync.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -c -o srp_daemon_srp_daemon-srp_sync.o `test -f 'srp_daemon/srp_sync.c' || echo '$(srcdir)/'`srp_daemon/srp_sync.c
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -c -o srp_daemon/srp_daemon_srp_daemon-srp_sync.o `test -f 'srp_daemon/srp_sync.c' || echo '$(srcdir)/'`srp_daemon/srp_sync.c
-srp_daemon_srp_daemon-srp_sync.obj: srp_daemon/srp_sync.c
- at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -MT srp_daemon_srp_daemon-srp_sync.obj -MD -MP -MF $(DEPDIR)/srp_daemon_srp_daemon-srp_sync.Tpo -c -o srp_daemon_srp_daemon-srp_sync.obj `if test -f 'srp_daemon/srp_sync.c'; then $(CYGPATH_W) 'srp_daemon/srp_sync.c'; else $(CYGPATH_W) '$(srcdir)/srp_daemon/srp_sync.c'; fi`
- at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/srp_daemon_srp_daemon-srp_sync.Tpo $(DEPDIR)/srp_daemon_srp_daemon-srp_sync.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='srp_daemon/srp_sync.c' object='srp_daemon_srp_daemon-srp_sync.obj' libtool=no @AMDEPBACKSLASH@
+srp_daemon/srp_daemon_srp_daemon-srp_sync.obj: srp_daemon/srp_sync.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -MT srp_daemon/srp_daemon_srp_daemon-srp_sync.obj -MD -MP -MF srp_daemon/$(DEPDIR)/srp_daemon_srp_daemon-srp_sync.Tpo -c -o srp_daemon/srp_daemon_srp_daemon-srp_sync.obj `if test -f 'srp_daemon/srp_sync.c'; then $(CYGPATH_W) 'srp_daemon/srp_sync.c'; else $(CYGPATH_W) '$(srcdir)/srp_daemon/srp_sync.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) srp_daemon/$(DEPDIR)/srp_daemon_srp_daemon-srp_sync.Tpo srp_daemon/$(DEPDIR)/srp_daemon_srp_daemon-srp_sync.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='srp_daemon/srp_sync.c' object='srp_daemon/srp_daemon_srp_daemon-srp_sync.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -c -o srp_daemon_srp_daemon-srp_sync.obj `if test -f 'srp_daemon/srp_sync.c'; then $(CYGPATH_W) 'srp_daemon/srp_sync.c'; else $(CYGPATH_W) '$(srcdir)/srp_daemon/srp_sync.c'; fi`
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srp_daemon_srp_daemon_CFLAGS) $(CFLAGS) -c -o srp_daemon/srp_daemon_srp_daemon-srp_sync.obj `if test -f 'srp_daemon/srp_sync.c'; then $(CYGPATH_W) 'srp_daemon/srp_sync.c'; else $(CYGPATH_W) '$(srcdir)/srp_daemon/srp_sync.c'; fi`
install-man1: $(man_MANS)
@$(NORMAL_INSTALL)
@list1=''; \
@@ -832,6 +848,7 @@ clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -rm -f srp_daemon/$(DEPDIR)/$(am__dirstamp)
-rm -f srp_daemon/$(am__dirstamp)
maintainer-clean-generic:
@@ -843,7 +860,7 @@ clean-am: clean-generic clean-sbinPROGRAMS mostlyclean-am
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf ./$(DEPDIR)
+ -rm -rf srp_daemon/$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-tags
@@ -893,7 +910,7 @@ installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
- -rm -rf ./$(DEPDIR)
+ -rm -rf srp_daemon/$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..3dd3326
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+mkdir -p config
+aclocal -I config
+autoheader
+automake --foreign --add-missing --copy
+autoconf
diff --git a/build-deb.sh b/build-deb.sh
new file mode 100755
index 0000000..481fa18
--- /dev/null
+++ b/build-deb.sh
@@ -0,0 +1,68 @@
+#!/bin/bash
+#
+# Copyright (C) 2012 Roi Dayan <roid at mellanox.com>
+#
+
+TARGET=$1
+DIR=$(cd `dirname $0`; pwd)
+BASE=`cd $DIR ; pwd`
+_TOP="$BASE/pkg"
+
+
+ver=`grep -E "^AC_INIT\(srptools," configure.ac | cut -d, -f 2`
+version=`echo $ver`
+release="1"
+
+echo "Building version: $version-$release"
+
+
+cp_src() {
+ local dest=$1
+ cp -a man $dest
+ cp -a autogen.sh $dest
+ cp -a configure.ac $dest
+ cp -a Makefile.am $dest
+ cp -a srptools.spec.in $dest
+ cp -a srp_daemon $dest
+}
+
+check() {
+ local rc=$?
+ local msg="$1"
+ if (( rc )) ; then
+ echo $msg
+ exit 1
+ fi
+}
+
+build_deb() {
+ if ! which debuild >/dev/null 2>&1 ; then
+ echo "Missing debuild. Please install devscripts package."
+ exit 1
+ fi
+ name=srptools_$version
+ TARBALL=$name.orig.tar.gz
+
+ # fix dependency with libibumad-devel instead of libibumad-dev
+ if dpkg-query -s libibumad-devel >/dev/null 2>&1 ; then
+ sed -i "s/\blibibumad-dev\b/libibumad-devel/g" debian/control
+ fi
+
+ echo "Building under $_TOP/$name"
+ mkdir -p $_TOP/$name
+ cp_src $_TOP/$name
+ tar -czf $_TOP/$TARBALL -C $_TOP $name
+
+ mkdir -p $_TOP/$name/debian
+ cp -a debian/* $_TOP/$name/debian
+ cd $_TOP/$name
+ sed -i -r "s/^srptools \(([0-9.-]+)\) (.*)/srptools \($version-$release\) \2/" debian/changelog
+ debuild -uc -us
+ check "Failed building deb package."
+ cd ../..
+ ls -l $_TOP/$name*.deb
+}
+
+cd $BASE
+build_deb
+echo "Done."
diff --git a/configure b/configure
index e9dfc53..304c559 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for srptools 1.0.2.
+# Generated by GNU Autoconf 2.69 for srptools 1.0.3.
#
# Report bugs to <users at lists.openfabrics.org>.
#
@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='srptools'
PACKAGE_TARNAME='srptools'
-PACKAGE_VERSION='1.0.2'
-PACKAGE_STRING='srptools 1.0.2'
+PACKAGE_VERSION='1.0.3'
+PACKAGE_STRING='srptools 1.0.3'
PACKAGE_BUGREPORT='users at lists.openfabrics.org'
PACKAGE_URL=''
@@ -1271,7 +1271,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures srptools 1.0.2 to adapt to many kinds of systems.
+\`configure' configures srptools 1.0.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1337,7 +1337,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of srptools 1.0.2:";;
+ short | recursive ) echo "Configuration of srptools 1.0.3:";;
esac
cat <<\_ACEOF
@@ -1438,7 +1438,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-srptools configure 1.0.2
+srptools configure 1.0.3
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1861,7 +1861,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by srptools $as_me 1.0.2, which was
+It was created by srptools $as_me 1.0.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2727,7 +2727,7 @@ fi
# Define the identity of the package.
PACKAGE='srptools'
- VERSION='1.0.2'
+ VERSION='1.0.3'
cat >>confdefs.h <<_ACEOF
@@ -5582,7 +5582,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by srptools $as_me 1.0.2, which was
+This file was extended by srptools $as_me 1.0.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -5648,7 +5648,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-srptools config.status 1.0.2
+srptools config.status 1.0.3
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index 4bcd8fd..c3ce076 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,11 +2,11 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
-AC_INIT(srptools, 1.0.2, users at lists.openfabrics.org)
+AC_INIT(srptools, 1.0.3, users at lists.openfabrics.org)
AC_CONFIG_SRCDIR(srp_daemon/srp_daemon.c)
AC_CONFIG_AUX_DIR(config)
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE([-Wall -Werror foreign])
+AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
AC_ARG_ENABLE(libcheck, [ --disable-libcheck do not test for presence of ib libraries],
[ if test x$enableval = xno ; then
diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c
index 4096ec9..dfc976b 100644
--- a/srp_daemon/srp_daemon.c
+++ b/srp_daemon/srp_daemon.c
@@ -84,22 +84,46 @@ static int get_lid(struct umad_resources *umad_res, ib_gid_t *gid, uint16_t *lid
static const int node_table_response_size = 1 << 18;
static char *sysfs_path = "/sys";
static enum log_dest s_log_dest = log_to_syslog;
-static int received_signal, wakeup_pipe[2] = { -1, -1 };
+static int wakeup_pipe[2] = { -1, -1 };
-void wake_up_main_loop(void)
+void wake_up_main_loop(char ch)
{
int res;
assert(wakeup_pipe[1] >= 0);
- res = write(wakeup_pipe[1], ".", 1);
+ res = write(wakeup_pipe[1], &ch, 1);
IGNORE(res);
}
static void signal_handler(int signo)
{
- received_signal = signo;
- wake_up_main_loop();
+ wake_up_main_loop(signo);
+}
+
+/*
+ * Return either the received signal (SIGINT, SIGTERM, ...) or 0 if no signal
+ * has been received before the timeout has expired.
+ */
+static int get_received_signal(time_t tv_sec, suseconds_t tv_usec)
+{
+ int fd, ret, received_signal = 0;
+ fd_set rset;
+ struct timeval timeout;
+ char buf[16];
+
+ fd = wakeup_pipe[0];
+ FD_ZERO(&rset);
+ FD_SET(fd, &rset);
+ timeout.tv_sec = tv_sec;
+ timeout.tv_usec = tv_usec;
+ ret = select(fd + 1, &rset, NULL, NULL, &timeout);
+ if (ret < 0)
+ assert(errno == EINTR);
+ while ((ret = read(fd, buf, sizeof(buf))) > 0)
+ received_signal = buf[ret - 1];
+
+ return received_signal;
}
static int check_process_uniqueness(struct config_t *conf)
@@ -252,6 +276,18 @@ void pr_cmd(char *target_str, int not_connected)
}
}
+void pr_debug(const char *fmt, ...)
+{
+ va_list args;
+
+ if (!config->debug_verbose)
+ return;
+
+ va_start(args, fmt);
+ vprintf(fmt, args);
+ va_end(args);
+}
+
void pr_err(const char *fmt, ...)
{
va_list args;
@@ -635,6 +671,9 @@ static int translate_umad_to_ibdev_and_port(char *umad_dev, char **ibdev,
char *umad_dev_name;
int ret;
+ *ibdev = NULL;
+ *ibport = NULL;
+
umad_dev_name = rindex(umad_dev, '/');
if (!umad_dev_name) {
pr_err("Couldn't find device name in '%s'\n",
@@ -679,7 +718,12 @@ static int translate_umad_to_ibdev_and_port(char *umad_dev, char **ibdev,
ret = 0;
end:
+ if (ret) {
+ free(*ibport);
+ free(*ibdev);
+ }
free(class_dev_path);
+
return ret;
}
@@ -1370,10 +1414,13 @@ static char *parse_main_option(struct rule *rule, char *ptr)
static int parse_other_option(struct rule *rule, char *ptr)
{
static const char *const opt[] = {
+ "allow_ext_sg=",
+ "cmd_sg_entries=",
"comp_vector=",
"max_cmd_per_lun=",
"max_sect=",
"queue_size=",
+ "sg_tablesize=",
"tl_retry_count=",
};
@@ -1505,11 +1552,59 @@ out:
return ret;
}
+static int set_conf_dev_and_port(char *umad_dev, struct config_t *conf)
+{
+ int ret;
+
+ if (umad_dev) {
+ char *ibport;
+
+ ret = translate_umad_to_ibdev_and_port(umad_dev,
+ &conf->dev_name,
+ &ibport);
+ if (ret) {
+ pr_err("Fail to translate umad to ibdev and port\n");
+ goto out;
+ }
+ conf->port_num = atoi(ibport);
+ if (conf->port_num == 0) {
+ pr_err("Bad port number %s\n", ibport);
+ ret = -1;
+ }
+ free(ibport);
+ } else {
+ umad_ca_t ca;
+ umad_port_t port;
+
+ ret = umad_get_ca(NULL, &ca);
+ if (ret) {
+ pr_err("Failed to get default CA\n");
+ goto out;
+ }
+
+ ret = umad_get_port(ca.ca_name, 0, &port);
+ if (ret) {
+ pr_err("Failed to get default port for CA %s\n",
+ ca.ca_name);
+ umad_release_ca(&ca);
+ goto out;
+ }
+ conf->dev_name = strdup(ca.ca_name);
+ conf->port_num = port.portnum;
+ umad_release_port(&port);
+ umad_release_ca(&ca);
+ pr_debug("Using device %s port %d\n", conf->dev_name,
+ conf->port_num);
+ }
+out:
+ return ret;
+}
+
+
static int get_config(struct config_t *conf, int argc, char *argv[])
{
/* set defaults */
- char* umad_dev = "/dev/infiniband/umad0";
- char *ibport;
+ char* umad_dev = NULL;
int ret;
conf->port_num = 1;
@@ -1628,19 +1723,11 @@ static int get_config(struct config_t *conf, int argc, char *argv[])
initialize_sysfs();
if (conf->dev_name == NULL) {
- if (translate_umad_to_ibdev_and_port(umad_dev, &conf->dev_name, &ibport)) {
- pr_err(
- "Fail to translate umad to ibdev and port\n");
- return -1;
- }
- conf->port_num = atoi(ibport);
- if (conf->port_num == 0) {
- pr_err("Bad port number %s\n", ibport);
- free(conf->dev_name);
- free(ibport);
- return -1;
- }
- free(ibport);
+ ret = set_conf_dev_and_port(umad_dev, conf);
+ if (ret) {
+ pr_err("Failed to build config\n");
+ return ret;
+ }
}
ret = asprintf(&conf->add_target_file,
"%s/class/infiniband_srp/srp-%s-%d/add_target", sysfs_path,
@@ -1656,11 +1743,12 @@ static int get_config(struct config_t *conf, int argc, char *argv[])
return 0;
}
-static void config_destroy(struct config_t *conf)
+static void free_config(struct config_t *conf)
{
free(conf->dev_name);
free(conf->add_target_file);
free(conf->rules);
+ free(conf);
}
static void umad_resources_init(struct umad_resources *umad_res)
@@ -1727,7 +1815,8 @@ void *run_thread_retry_to_connect(void *res_in)
if (retry_list_is_empty(res->sync_res))
pthread_cond_wait(&res->sync_res->retry_cond,
&res->sync_res->retry_mutex);
- while ((target = pop_from_retry_list(res->sync_res))) {
+ while (!res->sync_res->stop_threads &&
+ (target = pop_from_retry_list(res->sync_res)) != NULL) {
pthread_mutex_unlock(&res->sync_res->retry_mutex);
sleep_time = target->retry_time - time(NULL);
@@ -1860,8 +1949,7 @@ static void ts_sub(const struct timespec *a, const struct timespec *b,
static int ibsrpdm(int argc, char *argv[])
{
- char* umad_dev = "/dev/infiniband/umad0";
- char* ibport;
+ char* umad_dev = NULL;
struct resources *res;
int ret;
@@ -1872,6 +1960,7 @@ static int ibsrpdm(int argc, char *argv[])
config->timeout = 5000;
config->mad_retries = 3;
config->all = 1;
+ config->once = 1;
while (1) {
int c;
@@ -1901,13 +1990,11 @@ static int ibsrpdm(int argc, char *argv[])
initialize_sysfs();
- if (translate_umad_to_ibdev_and_port(umad_dev, &config->dev_name,
- &ibport)) {
- pr_err("Fail to translate umad to ibdev and port\n");
+ ret = set_conf_dev_and_port(umad_dev, config);
+ if (ret) {
+ pr_err("Failed to build config\n");
return 1;
}
- config->port_num = atoi(ibport);
- free(ibport);
umad_init();
res = alloc_res();
@@ -1930,7 +2017,7 @@ static int ibsrpdm(int argc, char *argv[])
umad_done:
umad_done();
- free(config);
+ free_config(config);
return ret;
}
@@ -1944,8 +2031,9 @@ int main(int argc, char *argv[])
ib_gid_t gid;
struct target_details *target;
struct sigaction sa;
- int subscribed = 0;
- int lockfd;
+ int subscribed;
+ int lockfd = -1;
+ int received_signal = 0;
STATIC_ASSERT(sizeof(struct srp_dm_mad) == 256);
STATIC_ASSERT(sizeof(struct srp_dm_rmpp_sa_mad) == 256);
@@ -1962,31 +2050,33 @@ int main(int argc, char *argv[])
}
for (i = 0; i < 2; i++) {
flags = fcntl(wakeup_pipe[i], F_GETFL);
- fcntl(wakeup_pipe[i], F_SETFL, flags | O_NONBLOCK);
- }
+ if (flags < 0) {
+ pr_err("fcntl F_GETFL failed for %d\n", wakeup_pipe[i]);
+ goto close_pipe;
+ }
+ if (fcntl(wakeup_pipe[i], F_SETFL, flags | O_NONBLOCK) < 0) {
+ pr_err("fcntl F_SETFL failed for %d\n", wakeup_pipe[i]);
+ goto close_pipe;
+ }
- /*
- * signal_handler() may be invoked on the context of any thread.
- * Avoid that data race detection tools complain about this.
- */
- ANNOTATE_BENIGN_RACE_SIZED(&received_signal, sizeof(received_signal),
- "");
+ }
memset(&sa, 0, sizeof(sa));
sigemptyset(&sa.sa_mask);
sa.sa_handler = signal_handler;
sigaction(SIGINT, &sa, 0);
sigaction(SIGTERM, &sa, 0);
+ sigaction(SRP_CATAS_ERR, &sa, 0);
if (strcmp(argv[0] + max_t(int, 0, strlen(argv[0]) - strlen("ibsrpdm")),
"ibsrpdm") == 0) {
ret = ibsrpdm(argc, argv);
- goto close_pipe;
+ goto restore_sig;
}
openlog("srp_daemon", LOG_PID | LOG_PERROR, LOG_DAEMON);
- config = malloc(sizeof(*config));
+ config = calloc(1, sizeof(*config));
if (!config) {
pr_err("out of memory\n");
ret = ENOMEM;
@@ -2001,24 +2091,41 @@ int main(int argc, char *argv[])
if (config->verbose)
print_config(config);
+ if (!config->once) {
+ lockfd = check_process_uniqueness(config);
+ if (lockfd < 0) {
+ ret = EPERM;
+ goto free_config;
+ }
+ }
+
+catas_start:
+ subscribed = 0;
+
ret = umad_init();
if (ret < 0) {
pr_err("umad_init failed\n");
- goto clean_config;
+ goto close_lockfd;
}
res = alloc_res();
+ if (!res && received_signal == SRP_CATAS_ERR)
+ pr_err("Device has not yet recovered from catas error\n");
if (!res)
goto clean_umad;
- if (config->once) {
- ret = recalc(res);
- goto free_res;
+ /*
+ * alloc_res() fails while the HCA is recovering from a catastrophic
+ * error. Clear 'received_signal' after alloc_res() has succeeded to
+ * finish the alloc_res() retry loop.
+ */
+ if (received_signal == SRP_CATAS_ERR) {
+ pr_err("Device recovered from catastrophic error\n");
+ received_signal = 0;
}
- lockfd = check_process_uniqueness(config);
- if (lockfd < 0) {
- ret = EPERM;
+ if (config->once) {
+ ret = recalc(res);
goto free_res;
}
@@ -2038,8 +2145,10 @@ int main(int argc, char *argv[])
res->ud_res->ah = NULL;
}
ret = create_ah(res->ud_res);
- if (ret)
+ if (ret) {
+ received_signal = get_received_signal(10, 0);
goto kill_threads;
+ }
}
if (res->ud_res->ah) {
@@ -2085,9 +2194,6 @@ int main(int argc, char *argv[])
}
}
} else {
- int fd;
- fd_set rset;
- char buf[16];
struct timespec now, delta;
struct timeval timeout;
@@ -2103,14 +2209,10 @@ int main(int argc, char *argv[])
timeout.tv_sec = 0;
timeout.tv_usec = 0;
}
- fd = wakeup_pipe[0];
- FD_ZERO(&rset);
- FD_SET(fd, &rset);
- ret = select(fd + 1, &rset, NULL, NULL, &timeout);
- if (ret < 0)
- assert(errno == EINTR);
- while (read(fd, buf, sizeof(buf)) > 0)
- ;
+
+ received_signal = get_received_signal(timeout.tv_sec,
+ timeout.tv_usec) ? :
+ received_signal;
}
}
@@ -2124,6 +2226,9 @@ kill_threads:
case SIGTERM:
pr_err("Got SIGTERM\n");
break;
+ case SRP_CATAS_ERR:
+ pr_err("Got SIG SRP_CATAS_ERR\n");
+ break;
case 0:
break;
default:
@@ -2131,24 +2236,42 @@ kill_threads:
break;
}
- if (subscribed)
- /* Traps deregistration before exiting */
+ if (subscribed && received_signal != SRP_CATAS_ERR) {
+ pr_err("Deregistering traps ...\n");
register_to_traps(res, 0);
- close(lockfd);
+ pr_err("Finished trap deregistration.\n");
+ }
free_res:
free_res(res);
+ /* Discard the SIGINT triggered by the free_res() implementation. */
+ get_received_signal(0, 0);
clean_umad:
umad_done();
-clean_config:
- config_destroy(config);
+ if (received_signal == SRP_CATAS_ERR) {
+ /*
+ * Device got a catastrophic error. Let's wait a grace
+ * period and try to probe the device by attempting to
+ * allocate IB resources. Once it recovers, we will
+ * start all over again.
+ */
+ received_signal = get_received_signal(10, 0) ? :
+ received_signal;
+ if (received_signal == SRP_CATAS_ERR)
+ goto catas_start;
+ }
+close_lockfd:
+ if (lockfd >= 0)
+ close(lockfd);
free_config:
- free(config);
+ free_config(config);
close_log:
closelog();
-close_pipe:
+restore_sig:
sa.sa_handler = SIG_DFL;
sigaction(SIGINT, &sa, 0);
sigaction(SIGTERM, &sa, 0);
+ sigaction(SRP_CATAS_ERR, &sa, 0);
+close_pipe:
close(wakeup_pipe[1]);
close(wakeup_pipe[0]);
wakeup_pipe[0] = -1;
diff --git a/srp_daemon/srp_daemon.h b/srp_daemon/srp_daemon.h
index 069578c..6d15755 100644
--- a/srp_daemon/srp_daemon.h
+++ b/srp_daemon/srp_daemon.h
@@ -37,6 +37,7 @@
#define SRP_DM_H
#include <stdint.h>
+#include <signal.h>
#include <endian.h>
#include <byteswap.h>
#include <infiniband/verbs.h>
@@ -75,6 +76,7 @@ template <bool b> struct vki_static_assert { int m_bitfield:(2*b-1); };
((a)->tv_nsec CMP (b)->tv_nsec) : \
((a)->tv_sec CMP (b)->tv_sec))
+#define SRP_CATAS_ERR SIGUSR1
enum {
SRP_MGMT_CLASS_SA = 3,
@@ -419,12 +421,7 @@ typedef struct {
printf(arg); \
} while (0)
-#define pr_debug(arg...) \
- do { \
- if (config->debug_verbose) \
- printf(arg); \
- } while (0)
-
+void pr_debug(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
void pr_err(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
int pkey_index_to_pkey(struct umad_resources *umad_res, int pkey_index,
@@ -455,7 +452,7 @@ int sync_resources_init(struct sync_resources *res);
void sync_resources_cleanup(struct sync_resources *res);
int modify_qp_to_err(struct ibv_qp *qp);
void srp_sleep(time_t sec, time_t usec);
-void wake_up_main_loop(void);
+void wake_up_main_loop(char ch);
void __schedule_rescan(struct sync_resources *res, int when);
void schedule_rescan(struct sync_resources *res, int when);
int __rescan_scheduled(struct sync_resources *res);
diff --git a/srp_daemon/srp_handle_traps.c b/srp_daemon/srp_handle_traps.c
index 77e198d..01cc544 100644
--- a/srp_daemon/srp_handle_traps.c
+++ b/srp_daemon/srp_handle_traps.c
@@ -152,25 +152,20 @@ int modify_qp_to_err(struct ibv_qp *qp)
*****************************************************************************/
static int fill_rq_entry(struct ud_resources *res, int cur_receive)
{
- static struct ibv_recv_wr rr;
- static struct ibv_sge sg;
- static int first = 1;
+ struct ibv_recv_wr rr;
+ struct ibv_sge sg;
struct ibv_recv_wr *_bad_wr = NULL;
struct ibv_recv_wr **bad_wr = &_bad_wr;
int ret;
- /* prepare the RR */
- if (first) {
- first = 0;
- memset(&rr, 0, sizeof(rr));
+ memset(&rr, 0, sizeof(rr));
- sg.length = RECV_BUF_SIZE;
- sg.lkey = res->mr->lkey;
+ sg.length = RECV_BUF_SIZE;
+ sg.lkey = res->mr->lkey;
- rr.next = NULL;
- rr.sg_list = &sg;
- rr.num_sge = 1;
- }
+ rr.next = NULL;
+ rr.sg_list = &sg;
+ rr.num_sge = 1;
sg.addr = (((unsigned long)res->recv_buf) + RECV_BUF_SIZE * cur_receive);
rr.wr_id = cur_receive;
@@ -277,7 +272,7 @@ int ud_resources_create(struct ud_resources *res)
size = cq_size * RECV_BUF_SIZE + SEND_SIZE;
res->recv_buf = malloc(size);
if (!res->recv_buf) {
- pr_err("failed to malloc %Zu bytes to memory buffer\n", size);
+ pr_err("failed to malloc %zu bytes to memory buffer\n", size);
return -ENOMEM;
}
@@ -730,7 +725,7 @@ static int get_trap_notices(struct resources *res)
if (ret) {
pr_err("get_trap_notices: Got Bad pkey_index (%d)\n",
pkey_index);
- wake_up_main_loop();
+ wake_up_main_loop(0);
break;
}
@@ -753,7 +748,7 @@ static int get_trap_notices(struct resources *res)
ret = fill_rq_entry(res->ud_res, cur_receive);
if (ret < 0) {
- wake_up_main_loop();
+ wake_up_main_loop(0);
break;
}
}
@@ -818,7 +813,7 @@ void *run_thread_listen_to_events(void *res_in)
if (event.element.port_num == config->port_num) {
pthread_mutex_lock(&res->sync_res->mutex);
__schedule_rescan(res->sync_res, 0);
- wake_up_main_loop();
+ wake_up_main_loop(0);
pthread_mutex_unlock(&res->sync_res->mutex);
}
break;
@@ -827,9 +822,10 @@ void *run_thread_listen_to_events(void *res_in)
case IBV_EVENT_CQ_ERR:
case IBV_EVENT_QP_FATAL:
/* clean and restart */
- pr_err("Critical event %d, ending\n", event.event_type);
- exit(EAGAIN);
-
+ pr_err("Critical event %d, raising catastrophic "
+ "error signal\n", event.event_type);
+ raise(SRP_CATAS_ERR);
+ break;
/*
diff --git a/srp_daemon/srp_sync.c b/srp_daemon/srp_sync.c
index 1ab8fcc..369cf70 100644
--- a/srp_daemon/srp_sync.c
+++ b/srp_daemon/srp_sync.c
@@ -151,7 +151,7 @@ void push_gid_to_list(struct sync_resources *res, ib_gid_t *gid, uint16_t pkey)
++res->next_task;
}
- wake_up_main_loop();
+ wake_up_main_loop(0);
pthread_mutex_unlock(&res->mutex);
}
@@ -189,7 +189,7 @@ void push_lid_to_list(struct sync_resources *res, uint16_t lid, uint16_t pkey)
++res->next_task;
}
- wake_up_main_loop();
+ wake_up_main_loop(0);
pthread_mutex_unlock(&res->mutex);
}
diff --git a/srptools.spec b/srptools.spec
index b4e687d..3dada1d 100644
--- a/srptools.spec
+++ b/srptools.spec
@@ -1,6 +1,6 @@
Name: srptools
-Version: 1.0.2
+Version: 1.0.3
Release: 1%{?dist}
Summary: Tools for SRP/IB
@@ -58,7 +58,10 @@ fi
%preun
if [ $1 = 0 ]; then
- /etc/init.d/srpd stop
+ pidfile=/var/run/srp_daemon.sh.pid
+ if [[ -f "$pidfile" && -e "/proc/$(cat $pidfile)" ]]; then
+ /etc/init.d/srpd stop
+ fi
if [ -e /sbin/chkconfig ]; then
/sbin/chkconfig --del srpd
elif [ -e /usr/sbin/update-rc.d ]; then
@@ -83,6 +86,20 @@ fi
%doc README NEWS ChangeLog COPYING
%changelog
+* Wed Feb 11 2015 Bart Van Assche <bart.vanassche at sandisk.com> - 1.0.3
+- srp_daemon: Survive catastrophic HCA errors.
+- srp_daemon: Fix ib_dev name and port assignments for non-default umad devices.
+- srp_daemon: Add support for allow_ext_sg, cmd_sg_entries and sg_tablesize
+ in /etc/srp_daemon.conf.
+- srp_daemon: Reduce time needed to stop.
+- srp_daemon: Log start and end of trap deregistration.
+- srp_daemon: Avoid that clang complains about an invalid conversion specifier.
+- srp_daemon: Fix memory leaks in error paths.
+- ibsrpdm: Do not start trap threads in ibsrpdm.
+- configure.ac: Add subdir-objects to AM_INIT_AUTOMAKE.
+- srptools.spec: Avoid redundant stop in pre-uninstall.
+- Debian: Fix build-deb.sh to read version from configure.ac.
+- Debian: Fix package build.
* Thu Feb 20 2014 Bart Van Assche <bvanassche at acm.org> - 1.0.2
- Added support for specifying tl_retry_count in srp_daemon.conf. Changed
default behavior for tl_retry_timeout parameter from setting it to 2 into
diff --git a/srptools.spec.in b/srptools.spec.in
index d770b40..750cab3 100644
--- a/srptools.spec.in
+++ b/srptools.spec.in
@@ -58,7 +58,10 @@ fi
%preun
if [ $1 = 0 ]; then
- /etc/init.d/srpd stop
+ pidfile=/var/run/srp_daemon.sh.pid
+ if [[ -f "$pidfile" && -e "/proc/$(cat $pidfile)" ]]; then
+ /etc/init.d/srpd stop
+ fi
if [ -e /sbin/chkconfig ]; then
/sbin/chkconfig --del srpd
elif [ -e /usr/sbin/update-rc.d ]; then
@@ -83,6 +86,20 @@ fi
%doc README NEWS ChangeLog COPYING
%changelog
+* Wed Feb 11 2015 Bart Van Assche <bart.vanassche at sandisk.com> - 1.0.3
+- srp_daemon: Survive catastrophic HCA errors.
+- srp_daemon: Fix ib_dev name and port assignments for non-default umad devices.
+- srp_daemon: Add support for allow_ext_sg, cmd_sg_entries and sg_tablesize
+ in /etc/srp_daemon.conf.
+- srp_daemon: Reduce time needed to stop.
+- srp_daemon: Log start and end of trap deregistration.
+- srp_daemon: Avoid that clang complains about an invalid conversion specifier.
+- srp_daemon: Fix memory leaks in error paths.
+- ibsrpdm: Do not start trap threads in ibsrpdm.
+- configure.ac: Add subdir-objects to AM_INIT_AUTOMAKE.
+- srptools.spec: Avoid redundant stop in pre-uninstall.
+- Debian: Fix build-deb.sh to read version from configure.ac.
+- Debian: Fix package build.
* Thu Feb 20 2014 Bart Van Assche <bvanassche at acm.org> - 1.0.2
- Added support for specifying tl_retry_count in srp_daemon.conf. Changed
default behavior for tl_retry_timeout parameter from setting it to 2 into
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ofed/srptools.git
More information about the Pkg-ofed-commits
mailing list