Hello community,
here is the log from the commit of package libibmad
checked in at Fri Sep 12 18:23:22 CEST 2008.
--------
--- libibmad/libibmad.changes 2008-03-04 05:38:49.000000000 +0100
+++ /mounts/work_src_done/STABLE/libibmad/libibmad.changes 2008-09-10 15:37:36.046079000 +0200
@@ -1,0 +2,5 @@
+Wed Sep 10 15:37:22 CEST 2008 - jjolly@suse.de
+
+- Updated to version 1.2.1 from the OFED 1.4 RC1
+
+-------------------------------------------------------------------
Old:
----
libibmad-1.1.6.tar.bz2
New:
----
libibmad-1.2.1.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libibmad.spec ++++++
--- /var/tmp/diff_new_pack.X16960/_old 2008-09-12 18:23:12.000000000 +0200
+++ /var/tmp/diff_new_pack.X16960/_new 2008-09-12 18:23:12.000000000 +0200
@@ -1,10 +1,17 @@
#
-# spec file for package libibmad (Version 1.1.6)
+# spec file for package libibmad (Version 1.2.1)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
-# This file and all modifications and additions to the pristine
-# package are under the same license as the package itself.
#
+# All modifications and additions to the file contributed by third parties
+# remain the property of their copyright owners, unless otherwise agreed
+# upon. The license for this file, and modifications and additions to the
+# file, is the same license as for the pristine package itself (unless the
+# license for the pristine package is not an Open Source License, in which
+# case the license is the MIT License). An "Open Source License" is a
+# license that conforms to the Open Source Definition (Version 1.9)
+# published by the Open Source Initiative.
+
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
@@ -13,7 +20,7 @@
Name: libibmad
Summary: Low layer Infiniband functions for use by diagnostic and management programs
-Version: 1.1.6
+Version: 1.2.1
Release: 1
License: BSD 3-Clause; GPL v2 or later
Group: System/Libraries
@@ -36,10 +43,11 @@
Sasha Khapyorsky
%package -n libibmad1
+License: BSD 3-Clause; GPL v2 or later
Summary: Low layer Infiniband diagnostic and management programs
Group: System/Libraries
Provides: %{name} = %{version}
-Obsoletes: %{name} <= 1.1.5
+Obsoletes: %{name} <= 1.1.6
%description -n libibmad1
libibmad provides low layer IB functions for use by the IB diagnostic
@@ -55,6 +63,7 @@
Sasha Khapyorsky
%package devel
+License: BSD 3-Clause; GPL v2 or later
Group: Development/Libraries/Other
Summary: Development files for the libibmad library.
Requires: libibmad1 = %{version} glibc-devel
@@ -98,6 +107,8 @@
%_libdir/libibmad.so
%changelog
+* Wed Sep 10 2008 jjolly@suse.de
+- Updated to version 1.2.1 from the OFED 1.4 RC1
* Tue Mar 04 2008 jjolly@suse.de
- Updated to version 1.1.6 from the OFED 1.3 GA release
* Sat Feb 09 2008 jjolly@suse.de
++++++ libibmad-1.1.6.tar.bz2 -> libibmad-1.2.1.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libibmad-1.1.6/autom4te.cache/output.0 new/libibmad-1.2.1/autom4te.cache/output.0
--- old/libibmad-1.1.6/autom4te.cache/output.0 2008-02-28 09:58:55.000000000 +0100
+++ new/libibmad-1.2.1/autom4te.cache/output.0 2008-09-08 13:54:59.000000000 +0200
@@ -1,6 +1,6 @@
@%:@! /bin/sh
@%:@ Guess values for system-dependent variables and create Makefiles.
-@%:@ Generated by GNU Autoconf 2.59 for libibmad 1.1.6.
+@%:@ Generated by GNU Autoconf 2.59 for libibmad 1.2.1.
@%:@
@%:@ Report bugs to .
@%:@
@@ -423,8 +423,8 @@
# Identity of this package.
PACKAGE_NAME='libibmad'
PACKAGE_TARNAME='libibmad'
-PACKAGE_VERSION='1.1.6'
-PACKAGE_STRING='libibmad 1.1.6'
+PACKAGE_VERSION='1.2.1'
+PACKAGE_STRING='libibmad 1.2.1'
PACKAGE_BUGREPORT='general@lists.openfabrics.org'
ac_unique_file="src/sa.c"
@@ -954,7 +954,7 @@
# 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 libibmad 1.1.6 to adapt to many kinds of systems.
+\`configure' configures libibmad 1.2.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1020,7 +1020,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libibmad 1.1.6:";;
+ short | recursive ) echo "Configuration of libibmad 1.2.1:";;
esac
cat <<\_ACEOF
@@ -1160,7 +1160,7 @@
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-libibmad configure 1.1.6
+libibmad configure 1.2.1
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1174,7 +1174,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libibmad $as_me 1.1.6, which was
+It was created by libibmad $as_me 1.2.1, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1820,7 +1820,7 @@
# Define the identity of the package.
PACKAGE='libibmad'
- VERSION='1.1.6'
+ VERSION='1.2.1'
cat >>confdefs.h <<_ACEOF
@@ -20910,7 +20910,7 @@
} >&5
cat >&5 <<_CSEOF
-This file was extended by libibmad $as_me 1.1.6, which was
+This file was extended by libibmad $as_me 1.2.1, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -20973,7 +20973,7 @@
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-libibmad config.status 1.1.6
+libibmad config.status 1.2.1
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libibmad-1.1.6/autom4te.cache/output.1 new/libibmad-1.2.1/autom4te.cache/output.1
--- old/libibmad-1.1.6/autom4te.cache/output.1 2008-02-28 09:58:59.000000000 +0100
+++ new/libibmad-1.2.1/autom4te.cache/output.1 2008-09-08 13:55:03.000000000 +0200
@@ -1,6 +1,6 @@
@%:@! /bin/sh
@%:@ Guess values for system-dependent variables and create Makefiles.
-@%:@ Generated by GNU Autoconf 2.59 for libibmad 1.1.6.
+@%:@ Generated by GNU Autoconf 2.59 for libibmad 1.2.1.
@%:@
@%:@ Report bugs to .
@%:@
@@ -423,8 +423,8 @@
# Identity of this package.
PACKAGE_NAME='libibmad'
PACKAGE_TARNAME='libibmad'
-PACKAGE_VERSION='1.1.6'
-PACKAGE_STRING='libibmad 1.1.6'
+PACKAGE_VERSION='1.2.1'
+PACKAGE_STRING='libibmad 1.2.1'
PACKAGE_BUGREPORT='general@lists.openfabrics.org'
ac_unique_file="src/sa.c"
@@ -954,7 +954,7 @@
# 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 libibmad 1.1.6 to adapt to many kinds of systems.
+\`configure' configures libibmad 1.2.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1020,7 +1020,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libibmad 1.1.6:";;
+ short | recursive ) echo "Configuration of libibmad 1.2.1:";;
esac
cat <<\_ACEOF
@@ -1160,7 +1160,7 @@
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-libibmad configure 1.1.6
+libibmad configure 1.2.1
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1174,7 +1174,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libibmad $as_me 1.1.6, which was
+It was created by libibmad $as_me 1.2.1, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1820,7 +1820,7 @@
# Define the identity of the package.
PACKAGE='libibmad'
- VERSION='1.1.6'
+ VERSION='1.2.1'
cat >>confdefs.h <<_ACEOF
@@ -20898,7 +20898,7 @@
} >&5
cat >&5 <<_CSEOF
-This file was extended by libibmad $as_me 1.1.6, which was
+This file was extended by libibmad $as_me 1.2.1, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -20961,7 +20961,7 @@
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-libibmad config.status 1.1.6
+libibmad config.status 1.2.1
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libibmad-1.1.6/autom4te.cache/traces.0 new/libibmad-1.2.1/autom4te.cache/traces.0
--- old/libibmad-1.1.6/autom4te.cache/traces.0 2008-02-28 09:58:55.000000000 +0100
+++ new/libibmad-1.2.1/autom4te.cache/traces.0 2008-09-08 13:54:59.000000000 +0200
@@ -6447,7 +6447,7 @@
AC_SUBST([am__tar])
AC_SUBST([am__untar])
])
-m4trace:configure.in:4: -1- AC_INIT([libibmad], [1.1.6], [general@lists.openfabrics.org])
+m4trace:configure.in:4: -1- AC_INIT([libibmad], [1.2.1], [general@lists.openfabrics.org])
m4trace:configure.in:4: -1- m4_pattern_forbid([^_?A[CHUM]_])
m4trace:configure.in:4: -1- m4_pattern_forbid([_AC_])
m4trace:configure.in:4: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libibmad-1.1.6/autom4te.cache/traces.1 new/libibmad-1.2.1/autom4te.cache/traces.1
--- old/libibmad-1.1.6/autom4te.cache/traces.1 2008-02-28 09:58:59.000000000 +0100
+++ new/libibmad-1.2.1/autom4te.cache/traces.1 2008-09-08 13:55:03.000000000 +0200
@@ -1,4 +1,4 @@
-m4trace:configure.in:4: -1- AC_INIT([libibmad], [1.1.6], [general@lists.openfabrics.org])
+m4trace:configure.in:4: -1- AC_INIT([libibmad], [1.2.1], [general@lists.openfabrics.org])
m4trace:configure.in:4: -1- m4_pattern_forbid([^_?A[CHUM]_])
m4trace:configure.in:4: -1- m4_pattern_forbid([_AC_])
m4trace:configure.in:4: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libibmad-1.1.6/ChangeLog new/libibmad-1.2.1/ChangeLog
--- old/libibmad-1.1.6/ChangeLog 2008-02-28 09:58:36.000000000 +0100
+++ new/libibmad-1.2.1/ChangeLog 2008-09-08 13:54:40.000000000 +0200
@@ -1,3 +1,8 @@
+2008-06-15 Max Matveev
+ * Add extra entry points for most functions to allow explicit
+ selection of HCA for MAD rpc.
+ * Constify MAD port pointer for mad_rpc, mad_rpc_rmpp, and sa_rpc_call
+
2007-07-10 Hal Rosenstock
* Release version 1.1.1.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libibmad-1.1.6/configure new/libibmad-1.2.1/configure
--- old/libibmad-1.1.6/configure 2008-02-28 09:59:00.000000000 +0100
+++ new/libibmad-1.2.1/configure 2008-09-08 13:55:04.000000000 +0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for libibmad 1.1.6.
+# Generated by GNU Autoconf 2.59 for libibmad 1.2.1.
#
# Report bugs to .
#
@@ -423,8 +423,8 @@
# Identity of this package.
PACKAGE_NAME='libibmad'
PACKAGE_TARNAME='libibmad'
-PACKAGE_VERSION='1.1.6'
-PACKAGE_STRING='libibmad 1.1.6'
+PACKAGE_VERSION='1.2.1'
+PACKAGE_STRING='libibmad 1.2.1'
PACKAGE_BUGREPORT='general@lists.openfabrics.org'
ac_unique_file="src/sa.c"
@@ -954,7 +954,7 @@
# 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 libibmad 1.1.6 to adapt to many kinds of systems.
+\`configure' configures libibmad 1.2.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1020,7 +1020,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libibmad 1.1.6:";;
+ short | recursive ) echo "Configuration of libibmad 1.2.1:";;
esac
cat <<\_ACEOF
@@ -1160,7 +1160,7 @@
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-libibmad configure 1.1.6
+libibmad configure 1.2.1
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1174,7 +1174,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libibmad $as_me 1.1.6, which was
+It was created by libibmad $as_me 1.2.1, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1820,7 +1820,7 @@
# Define the identity of the package.
PACKAGE='libibmad'
- VERSION='1.1.6'
+ VERSION='1.2.1'
cat >>confdefs.h <<_ACEOF
@@ -20898,7 +20898,7 @@
} >&5
cat >&5 <<_CSEOF
-This file was extended by libibmad $as_me 1.1.6, which was
+This file was extended by libibmad $as_me 1.2.1, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -20961,7 +20961,7 @@
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-libibmad config.status 1.1.6
+libibmad config.status 1.2.1
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libibmad-1.1.6/configure.in new/libibmad-1.2.1/configure.in
--- old/libibmad-1.1.6/configure.in 2008-02-28 09:58:36.000000000 +0100
+++ new/libibmad-1.2.1/configure.in 2008-09-08 13:54:40.000000000 +0200
@@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
-AC_INIT(libibmad, 1.1.6, general@lists.openfabrics.org)
+AC_INIT(libibmad, 1.2.1, general@lists.openfabrics.org)
AC_CONFIG_SRCDIR([src/sa.c])
AC_CONFIG_AUX_DIR(config)
AM_CONFIG_HEADER(config.h)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libibmad-1.1.6/include/infiniband/mad.h new/libibmad-1.2.1/include/infiniband/mad.h
--- old/libibmad-1.1.6/include/infiniband/mad.h 2008-02-28 09:58:36.000000000 +0100
+++ new/libibmad-1.2.1/include/infiniband/mad.h 2008-09-08 13:54:40.000000000 +0200
@@ -81,6 +81,7 @@
IB_SNMP_CLASS = 0x8,
IB_VENDOR_RANGE1_START_CLASS = 0x9,
IB_VENDOR_RANGE1_END_CLASS = 0x0f,
+ IB_CC_CLASS = 0x21,
IB_VENDOR_RANGE2_START_CLASS = 0x30,
IB_VENDOR_RANGE2_END_CLASS = 0x4f,
};
@@ -156,7 +157,10 @@
#define IB_VENDOR_OPENIB_SYSSTAT_CLASS (IB_VENDOR_RANGE2_START_CLASS + 3)
#define IB_OPENIB_OUI (0x001405)
-typedef uint8_t ib_gid_t[16];
+typedef uint8_t ibmad_gid_t[16];
+#ifdef USE_DEPRECATED_IB_GID_T
+typedef ibmad_gid_t ib_gid_t __attribute__((deprecated));
+#endif
typedef struct {
int cnt;
@@ -189,7 +193,7 @@
int lid; /* lid or 0 if directed route */
ib_dr_path_t drpath;
int grh_present; /* flag */
- ib_gid_t gid;
+ ibmad_gid_t gid;
uint32_t qp;
uint32_t qkey;
uint8_t sl;
@@ -619,6 +623,7 @@
char * portid2str(ib_portid_t *portid);
int portid2portnum(ib_portid_t *portid);
int str2drpath(ib_dr_path_t *path, char *routepath, int drslid, int drdlid);
+char * drpath2str(ib_dr_path_t *path, char *dstr, size_t dstr_size);
static inline int
ib_portid_set(ib_portid_t *portid, int lid, int qp, int qkey)
@@ -735,9 +740,9 @@
void * mad_rpc_open_port(char *dev_name, int dev_port, int *mgmt_classes,
int num_classes);
void mad_rpc_close_port(void *ibmad_port);
-void * mad_rpc(void *ibmad_port, ib_rpc_t *rpc, ib_portid_t *dport,
+void * mad_rpc(const void *ibmad_port, ib_rpc_t *rpc, ib_portid_t *dport,
void *payload, void *rcvdata);
-void * mad_rpc_rmpp(void *ibmad_port, ib_rpc_t *rpc, ib_portid_t *dport,
+void * mad_rpc_rmpp(const void *ibmad_port, ib_rpc_t *rpc, ib_portid_t *dport,
ib_rmpp_hdr_t *rmpp, void *data);
/* smp.c */
@@ -745,6 +750,10 @@
unsigned timeout);
uint8_t * smp_set(void *buf, ib_portid_t *id, unsigned attrid, unsigned mod,
unsigned timeout);
+uint8_t * smp_query_via(void *buf, ib_portid_t *id, unsigned attrid,
+ unsigned mod, unsigned timeout, const void *srcport);
+uint8_t * smp_set_via(void *buf, ib_portid_t *id, unsigned attrid, unsigned mod,
+ unsigned timeout, const void *srcport);
inline static uint8_t *
safe_smp_query(void *rcvbuf, ib_portid_t *portid, unsigned attrid, unsigned mod,
@@ -775,10 +784,12 @@
/* sa.c */
uint8_t * sa_call(void *rcvbuf, ib_portid_t *portid, ib_sa_call_t *sa,
unsigned timeout);
-uint8_t * sa_rpc_call(void *ibmad_port, void *rcvbuf, ib_portid_t *portid,
- ib_sa_call_t *sa, unsigned timeout);
-int ib_path_query(ib_gid_t srcgid, ib_gid_t destgid, ib_portid_t *sm_id,
+uint8_t * sa_rpc_call(const void *ibmad_port, void *rcvbuf, ib_portid_t *portid,
+ ib_sa_call_t *sa, unsigned timeout);
+int ib_path_query(ibmad_gid_t srcgid, ibmad_gid_t destgid, ib_portid_t *sm_id,
void *buf); /* returns lid */
+int ib_path_query_via(const void *srcport, ibmad_gid_t srcgid,
+ ibmad_gid_t destgid, ib_portid_t *sm_id, void *buf);
inline static uint8_t *
safe_sa_call(void *rcvbuf, ib_portid_t *portid, ib_sa_call_t *sa,
@@ -799,7 +810,18 @@
ib_portid_t *sm_id, int timeout);
int ib_resolve_portid_str(ib_portid_t *portid, char *addr_str,
int dest_type, ib_portid_t *sm_id);
-int ib_resolve_self(ib_portid_t *portid, int *portnum, ib_gid_t *gid);
+int ib_resolve_self(ib_portid_t *portid, int *portnum, ibmad_gid_t *gid);
+
+int ib_resolve_smlid_via(ib_portid_t *sm_id, int timeout,
+ const void *srcport);
+int ib_resolve_guid_via(ib_portid_t *portid, uint64_t *guid,
+ ib_portid_t *sm_id, int timeout,
+ const void *srcport);
+int ib_resolve_portid_str_via(ib_portid_t *portid, char *addr_str,
+ int dest_type, ib_portid_t *sm_id,
+ const void *srcport);
+int ib_resolve_self_via(ib_portid_t *portid, int *portnum, ibmad_gid_t *gid,
+ const void *srcport);
/* gs.c */
uint8_t *perf_classportinfo_query(void *rcvbuf, ib_portid_t *dest, int port,
@@ -817,6 +839,20 @@
uint8_t *port_samples_result_query(void *rcvbuf, ib_portid_t *dest, int port,
unsigned timeout);
+uint8_t *perf_classportinfo_query_via(void *rcvbuf, ib_portid_t *dest, int port,
+ unsigned timeout, const void *srcport);
+uint8_t *port_performance_query_via(void *rcvbuf, ib_portid_t *dest, int port,
+ unsigned timeout, const void *srcport);
+uint8_t *port_performance_reset_via(void *rcvbuf, ib_portid_t *dest, int port,
+ unsigned mask, unsigned timeout, const void *srcport);
+uint8_t *port_performance_ext_query_via(void *rcvbuf, ib_portid_t *dest, int port,
+ unsigned timeout, const void *srcport);
+uint8_t *port_performance_ext_reset_via(void *rcvbuf, ib_portid_t *dest, int port,
+ unsigned mask, unsigned timeout, const void *srcport);
+uint8_t *port_samples_control_query_via(void *rcvbuf, ib_portid_t *dest, int port,
+ unsigned timeout, const void *srcport);
+uint8_t *port_samples_result_query_via(void *rcvbuf, ib_portid_t *dest, int port,
+ unsigned timeout, const void *srcport);
/* dump.c */
ib_mad_dump_fn
mad_dump_int, mad_dump_uint, mad_dump_hex, mad_dump_rhex,
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libibmad-1.1.6/libibmad.spec new/libibmad-1.2.1/libibmad.spec
--- old/libibmad-1.1.6/libibmad.spec 2008-02-28 09:58:53.000000000 +0100
+++ new/libibmad-1.2.1/libibmad.spec 2008-09-08 13:55:04.000000000 +0200
@@ -4,12 +4,12 @@
Summary: OpenFabrics Alliance InfiniBand MAD library
Name: libibmad
-Version: 1.1.6
-Release: 1.ofed1.3
+Version: 1.2.1
+Release: 1.ofed1.4.rc1
License: GPLv2 or BSD
Group: System Environment/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Source: http://www.openfabrics.org/downloads/libibmad-1.1.6.tar.gz
+Source: http://www.openfabrics.org/downloads/libibmad-1.2.1.tar.gz
Url: http://openfabrics.org/
BuildRequires: libibumad-devel, libtool
Requires(post): /sbin/ldconfig
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libibmad-1.1.6/libibmad.ver new/libibmad-1.2.1/libibmad.ver
--- old/libibmad-1.1.6/libibmad.ver 2008-02-28 09:58:36.000000000 +0100
+++ new/libibmad-1.2.1/libibmad.ver 2008-09-08 13:54:40.000000000 +0200
@@ -6,4 +6,4 @@
# API_REV - advance on any added API
# RUNNING_REV - advance any change to the vendor files
# AGE - number of backward versions the API still supports
-LIBVERSION=3:0:2
+LIBVERSION=4:0:3
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libibmad-1.1.6/Makefile.am new/libibmad-1.2.1/Makefile.am
--- old/libibmad-1.1.6/Makefile.am 2008-02-28 09:58:36.000000000 +0100
+++ new/libibmad-1.2.1/Makefile.am 2008-09-08 13:54:40.000000000 +0200
@@ -32,7 +32,3 @@
if [ -x $(top_srcdir)/../gen_chlog.sh ] ; then \
$(top_srcdir)/../gen_chlog.sh $(PACKAGE) > $(distdir)/ChangeLog ; \
fi
- if [ -x $(top_srcdir)/../gen_ver.sh ] ; then \
- ver=`$(top_srcdir)/../gen_ver.sh $(PACKAGE)` ; \
- sed -e '/AC_INIT/s/$(PACKAGE), .*,/$(PACKAGE), '$$ver',/' $(top_srcdir)/configure.in > $(distdir)/configure.in ; \
- fi
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libibmad-1.1.6/Makefile.in new/libibmad-1.2.1/Makefile.in
--- old/libibmad-1.1.6/Makefile.in 2008-02-28 09:58:59.000000000 +0100
+++ new/libibmad-1.2.1/Makefile.in 2008-09-08 13:55:04.000000000 +0200
@@ -854,10 +854,6 @@
if [ -x $(top_srcdir)/../gen_chlog.sh ] ; then \
$(top_srcdir)/../gen_chlog.sh $(PACKAGE) > $(distdir)/ChangeLog ; \
fi
- if [ -x $(top_srcdir)/../gen_ver.sh ] ; then \
- ver=`$(top_srcdir)/../gen_ver.sh $(PACKAGE)` ; \
- sed -e '/AC_INIT/s/$(PACKAGE), .*,/$(PACKAGE), '$$ver',/' $(top_srcdir)/configure.in > $(distdir)/configure.in ; \
- fi
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libibmad-1.1.6/src/dump.c new/libibmad-1.2.1/src/dump.c
--- old/libibmad-1.1.6/src/dump.c 2008-02-28 09:58:36.000000000 +0100
+++ new/libibmad-1.2.1/src/dump.c 2008-09-08 13:54:40.000000000 +0200
@@ -193,21 +193,23 @@
static void
dump_linkwidth(char *buf, int bufsz, int width)
{
- char *s = buf, *e = s + bufsz;
+ int n = 0;
if (width & 0x1)
- s += snprintf(s, e - s, "1X or ");
- if (s < e && (width & 0x2))
- s += snprintf(s, e - s, "4X or ");
- if (s < e && (width & 0x4))
- s += snprintf(s, e - s, "8X or ");
- if (s < e && (width & 0x8))
- s += snprintf(s, e - s, "12X or ");
-
- if ((width >> 4) || s == buf)
- s += snprintf(s, e - s, "undefined (%d)", width);
- else
- s[-4] = 0;
+ n += snprintf(buf + n, bufsz - n, "1X or ");
+ if (n < bufsz && (width & 0x2))
+ n += snprintf(buf + n, bufsz - n, "4X or ");
+ if (n < bufsz && (width & 0x4))
+ n += snprintf(buf + n, bufsz - n, "8X or ");
+ if (n < bufsz && (width & 0x8))
+ n += snprintf(buf + n, bufsz - n, "12X or ");
+
+ if (n >= bufsz)
+ return;
+ else if (width == 0 || (width >> 4))
+ snprintf(buf + n, bufsz - n, "undefined (%d)", width);
+ else if (bufsz > 3)
+ buf[n-4] = '\0';
}
void
@@ -265,19 +267,25 @@
static void
dump_linkspeed(char *buf, int bufsz, int speed)
{
- char *s = buf, *e = s + bufsz;
+ int n = 0;
if (speed & 0x1)
- s += snprintf(s, e - s, "2.5 Gbps or ");
- if (s < e && (speed & 0x2))
- s += snprintf(s, e - s, "5.0 Gbps or ");
- if (s < e && (speed & 0x4))
- s += snprintf(s, e - s, "10.0 Gbps or ");
-
- if ((speed >> 3) || s == buf)
- s += snprintf(s, e - s, "undefined (%d)", speed);
- else
- s[-4] = 0;
+ n += snprintf(buf + n, bufsz - n, "2.5 Gbps or ");
+ if (n < bufsz && (speed & 0x2))
+ n += snprintf(buf + n, bufsz - n, "5.0 Gbps or ");
+ if (n < bufsz && (speed & 0x4))
+ n += snprintf(buf + n, bufsz - n, "10.0 Gbps or ");
+
+ if (n >= bufsz)
+ return;
+ else if (speed == 0 || (speed >> 3)) {
+ n += snprintf(buf + n, bufsz - n, "undefined (%d)", speed);
+ if (n >= bufsz)
+ return;
+ } else if (bufsz > 3) {
+ buf[n-4] = '\0';
+ n -= 4;
+ }
switch (speed) {
case 1:
@@ -287,7 +295,7 @@
break;
default:
if (!(speed >> 3))
- snprintf(s, e - s, " (IBA extension)");
+ snprintf(buf + n, bufsz - n, " (IBA extension)");
break;
}
}
@@ -588,35 +596,14 @@
*vl = (tbl->vl_by_sl_num[i >> 1] >> ((!(i&1)) << 2)) & 0xf;
}
-typedef struct _ib_vl_arb_element {
- uint8_t res_vl;
- uint8_t weight;
-} __attribute__((packed)) ib_vl_arb_element_t;
-
#define IB_NUM_VL_ARB_ELEMENTS_IN_BLOCK 32
-#define IB_NUM_VL_ARB_ELEMENTS_CONF_SUPPORT 8
-#define IB_NUM_VL_ARB_BLOCKS_IN_TBL 2
typedef struct _ib_vl_arb_table {
- ib_vl_arb_element_t vl_entry[IB_NUM_VL_ARB_ELEMENTS_IN_BLOCK];
-} ib_vl_arb_table_t;
-
-typedef struct _ib_vl_arb_table_two_blocks {
- ib_vl_arb_table_t tbl_blocks[IB_NUM_VL_ARB_BLOCKS_IN_TBL];
-} ib_vl_arb_table_two_blocks_t;
-
-static inline uint8_t
-ib_vl_arb_get_vl_entries_num_in_table(ib_vl_arb_table_t *tbl)
-{
- uint8_t i;
-
- for (i = 0; i < 32; i++) {
- if (!(tbl->vl_entry[i].res_vl || tbl->vl_entry[i].weight))
- break;
- }
-
- return i;
-}
+ struct {
+ uint8_t res_vl;
+ uint8_t weight;
+ } vl_entry[IB_NUM_VL_ARB_ELEMENTS_IN_BLOCK];
+} __attribute__((packed)) ib_vl_arb_table_t;
static inline void
ib_vl_arb_get_vl(uint8_t res_vl, uint8_t *const vl )
@@ -634,32 +621,42 @@
for (i = 0; i < 16; i++) {
ib_slvl_get_i(p_slvl_tbl, i, &vl);
n += snprintf(buf + n, bufsz - n, "%2u|", vl);
+ if (n >= bufsz)
+ break;
}
snprintf(buf + n, bufsz - n, "\n");
}
void
-mad_dump_vlarbitration(char *buf, int bufsz, void *val, int valsz)
+mad_dump_vlarbitration(char *buf, int bufsz, void *val, int num)
{
ib_vl_arb_table_t* p_vla_tbl = val;
- char buf_line1[1024];
- char buf_line2[1024];
+ unsigned i, n;
uint8_t vl;
- int i;
- buf_line1[0] = 0;
- buf_line2[0] = 0;
+ num /= sizeof(p_vla_tbl->vl_entry[0]);
- for (i = 0; i<8; i++) {
+ n = snprintf(buf, bufsz, "\nVL : |");
+ if (n >= bufsz)
+ return;
+ for (i = 0; i < num; i++) {
ib_vl_arb_get_vl(p_vla_tbl->vl_entry[i].res_vl, &vl);
- sprintf(buf_line1, "%s0x%-2X|", buf_line1, vl);
+ n += snprintf(buf + n, bufsz - n, "0x%-2X|", vl);
+ if (n >= bufsz)
+ return;
}
- for (i = 0; i<8; i++)
- sprintf(buf_line2, "%s0x%-2X|",
- buf_line2, p_vla_tbl->vl_entry[i].weight);
+ n += snprintf(buf + n, bufsz - n, "\nWEIGHT: |");
+ if (n >= bufsz)
+ return;
+ for (i = 0; i < num; i++) {
+ n += snprintf(buf + n, bufsz - n, "0x%-2X|",
+ p_vla_tbl->vl_entry[i].weight);
+ if (n >= bufsz)
+ return;
+ }
- snprintf(buf, bufsz, "\nVL : |%s\nWEIGHT: |%s\n", buf_line1, buf_line2);
+ snprintf(buf + n, bufsz - n, "\n");
}
static int
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libibmad-1.1.6/src/fields.c new/libibmad-1.2.1/src/fields.c
--- old/libibmad-1.1.6/src/fields.c 2008-02-28 09:58:36.000000000 +0100
+++ new/libibmad-1.2.1/src/fields.c 2008-09-08 13:54:40.000000000 +0200
@@ -366,13 +366,17 @@
void
_set_field64(void *buf, int base_offs, ib_field_t *f, uint64_t val)
{
- *(uint64_t *)((char *)buf + base_offs + f->bitoffs / 8) = htonll(val);
+ uint64_t nval;
+
+ nval = htonll(val);
+ memcpy((char *)buf + base_offs + f->bitoffs / 8, &nval, sizeof(uint64_t));
}
uint64_t
_get_field64(void *buf, int base_offs, ib_field_t *f)
{
- uint64_t val = *(uint64_t *)((char *)buf + base_offs + f->bitoffs / 8);
+ uint64_t val;
+ memcpy(&val, ((char *)buf + base_offs + f->bitoffs / 8), sizeof(uint64_t));
return ntohll(val);
}
@@ -439,7 +443,7 @@
void
_set_array(void *buf, int base_offs, ib_field_t *f, void *val)
{
- int bitoffs = f->bitoffs;;
+ int bitoffs = f->bitoffs;
if (f->bitlen < 32)
bitoffs = BE_TO_BITSOFFS(bitoffs, f->bitlen);
@@ -450,7 +454,7 @@
void
_get_array(void *buf, int base_offs, ib_field_t *f, void *val)
{
- int bitoffs = f->bitoffs;;
+ int bitoffs = f->bitoffs;
if (f->bitlen < 32)
bitoffs = BE_TO_BITSOFFS(bitoffs, f->bitlen);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libibmad-1.1.6/src/gs.c new/libibmad-1.2.1/src/gs.c
--- old/libibmad-1.1.6/src/gs.c 2008-02-28 09:58:36.000000000 +0100
+++ new/libibmad-1.2.1/src/gs.c 2008-09-08 13:54:40.000000000 +0200
@@ -48,8 +48,9 @@
#undef DEBUG
#define DEBUG if (ibdebug) IBWARN
-uint8_t *
-pma_query(void *rcvbuf, ib_portid_t *dest, int port, unsigned timeout, unsigned id)
+static uint8_t *
+pma_query_via(void *rcvbuf, ib_portid_t *dest, int port,
+ unsigned timeout, unsigned id, const void *srcport)
{
ib_rpc_t rpc = {0};
int lid = dest->lid;
@@ -76,7 +77,25 @@
if (!dest->qkey)
dest->qkey = IB_DEFAULT_QP1_QKEY;
- return madrpc(&rpc, dest, rcvbuf, rcvbuf);
+ if (srcport) {
+ return mad_rpc(srcport, &rpc, dest, rcvbuf, rcvbuf);
+ } else {
+ return madrpc(&rpc, dest, rcvbuf, rcvbuf);
+ }
+}
+
+uint8_t *
+pma_query(void *rcvbuf, ib_portid_t *dest, int port, unsigned timeout, unsigned id)
+{
+ return pma_query_via(rcvbuf, dest, port, timeout, id, NULL);
+}
+
+uint8_t *
+perf_classportinfo_query_via(void *rcvbuf, ib_portid_t *dest, int port,
+ unsigned timeout, const void *srcport)
+{
+ return pma_query_via(rcvbuf, dest, port, timeout, CLASS_PORT_INFO,
+ srcport);
}
uint8_t *
@@ -86,14 +105,22 @@
}
uint8_t *
+port_performance_query_via(void *rcvbuf, ib_portid_t *dest, int port,
+ unsigned timeout, const void *srcport)
+{
+ return pma_query_via(rcvbuf, dest, port, timeout,
+ IB_GSI_PORT_COUNTERS, srcport);
+}
+
+uint8_t *
port_performance_query(void *rcvbuf, ib_portid_t *dest, int port, unsigned timeout)
{
return pma_query(rcvbuf, dest, port, timeout, IB_GSI_PORT_COUNTERS);
}
static uint8_t *
-performance_reset(void *rcvbuf, ib_portid_t *dest, int port, unsigned mask,
- unsigned timeout, unsigned id)
+performance_reset_via(void *rcvbuf, ib_portid_t *dest, int port, unsigned mask,
+ unsigned timeout, unsigned id, const void *srcport)
{
ib_rpc_t rpc = {0};
int lid = dest->lid;
@@ -125,7 +152,27 @@
if (!dest->qkey)
dest->qkey = IB_DEFAULT_QP1_QKEY;
- return madrpc(&rpc, dest, rcvbuf, rcvbuf);
+ if (srcport) {
+ return mad_rpc(srcport, &rpc, dest, rcvbuf, rcvbuf);
+ } else {
+ return madrpc(&rpc, dest, rcvbuf, rcvbuf);
+ }
+}
+
+static uint8_t *
+performance_reset(void *rcvbuf, ib_portid_t *dest, int port, unsigned mask,
+ unsigned timeout, unsigned id)
+{
+ return performance_reset_via(rcvbuf, dest, port, mask, timeout,
+ id, NULL);
+}
+
+uint8_t *
+port_performance_reset_via(void *rcvbuf, ib_portid_t *dest, int port,
+ unsigned mask, unsigned timeout, const void *srcport)
+{
+ return performance_reset_via(rcvbuf, dest, port, mask, timeout,
+ IB_GSI_PORT_COUNTERS, srcport);
}
uint8_t *
@@ -136,12 +183,29 @@
}
uint8_t *
+port_performance_ext_query_via(void *rcvbuf, ib_portid_t *dest, int port,
+ unsigned timeout, const void *srcport)
+{
+ return pma_query_via(rcvbuf, dest, port, timeout,
+ IB_GSI_PORT_COUNTERS_EXT, srcport);
+}
+
+uint8_t *
port_performance_ext_query(void *rcvbuf, ib_portid_t *dest, int port, unsigned timeout)
{
return pma_query(rcvbuf, dest, port, timeout, IB_GSI_PORT_COUNTERS_EXT);
}
uint8_t *
+port_performance_ext_reset_via(void *rcvbuf, ib_portid_t *dest, int port,
+ unsigned mask, unsigned timeout,
+ const void *srcport)
+{
+ return performance_reset_via(rcvbuf, dest, port, mask, timeout,
+ IB_GSI_PORT_COUNTERS_EXT, srcport);
+}
+
+uint8_t *
port_performance_ext_reset(void *rcvbuf, ib_portid_t *dest, int port, unsigned mask,
unsigned timeout)
{
@@ -149,12 +213,28 @@
}
uint8_t *
+port_samples_control_query_via(void *rcvbuf, ib_portid_t *dest, int port,
+ unsigned timeout, const void *srcport)
+{
+ return pma_query_via(rcvbuf, dest, port, timeout,
+ IB_GSI_PORT_SAMPLES_CONTROL, srcport);
+}
+
+uint8_t *
port_samples_control_query(void *rcvbuf, ib_portid_t *dest, int port, unsigned timeout)
{
return pma_query(rcvbuf, dest, port, timeout, IB_GSI_PORT_SAMPLES_CONTROL);
}
uint8_t *
+port_samples_result_query_via(void *rcvbuf, ib_portid_t *dest, int port,
+ unsigned timeout, const void *srcport)
+{
+ return pma_query_via(rcvbuf, dest, port, timeout,
+ IB_GSI_PORT_SAMPLES_RESULT, srcport);
+}
+
+uint8_t *
port_samples_result_query(void *rcvbuf, ib_portid_t *dest, int port, unsigned timeout)
{
return pma_query(rcvbuf, dest, port, timeout, IB_GSI_PORT_SAMPLES_RESULT);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libibmad-1.1.6/src/libibmad.map new/libibmad-1.2.1/src/libibmad.map
--- old/libibmad-1.1.6/src/libibmad.map 2008-02-28 09:58:36.000000000 +0100
+++ new/libibmad-1.2.1/src/libibmad.map 2008-09-08 13:54:40.000000000 +0200
@@ -56,6 +56,7 @@
portid2portnum;
portid2str;
str2drpath;
+ drpath2str;
mad_agent_class;
mad_class_agent;
mad_register_client;
@@ -91,5 +92,19 @@
smp_query;
smp_set;
ib_vendor_call;
+ smp_query_via;
+ smp_set_via;
+ ib_path_query_via;
+ ib_resolve_smlid_via;
+ ib_resolve_guid_via;
+ ib_resolve_portid_str_via;
+ ib_resolve_self_via;
+ perf_classportinfo_query_via;
+ port_performance_query_via;
+ port_performance_reset_via;
+ port_performance_ext_query_via;
+ port_performance_ext_reset_via;
+ port_samples_control_query_via;
+ port_samples_result_query_via;
local: *;
};
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libibmad-1.1.6/src/portid.c new/libibmad-1.2.1/src/portid.c
--- old/libibmad-1.1.6/src/portid.c 2008-02-28 09:58:36.000000000 +0100
+++ new/libibmad-1.2.1/src/portid.c 2008-09-08 13:54:40.000000000 +0200
@@ -42,6 +42,7 @@
#include
#include
#include
+#include
#include
#include
@@ -65,29 +66,22 @@
portid2str(ib_portid_t *portid)
{
static char buf[1024] = "local";
- char *s = buf;
- int i;
+ int n = 0;
if (portid->lid > 0) {
- s += sprintf(s, "Lid %d", portid->lid);
+ n += sprintf(buf + n, "Lid %d", portid->lid);
if (portid->grh_present) {
- s += sprintf(s, " Gid 0x%" PRIx64 "%" PRIx64,
- ntohll(*(uint64_t *)portid->gid),
- ntohll(*(uint64_t *)(portid->gid+8)));
+ char gid[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"];
+ if (inet_ntop(AF_INET6, portid->gid, gid, sizeof(gid)))
+ n += sprintf(buf + n, " Gid %s", gid);
}
if (portid->drpath.cnt)
- s += sprintf(s, " ");
+ n += sprintf(buf + n, " ");
else
return buf;
}
- s += sprintf(s, "DR path ");
- for (i = 0; i < portid->drpath.cnt+1; i++) {
- if (i == 0)
- s += sprintf( s, "%d", portid->drpath.p[i] );
- else
- s += sprintf( s, ",%d", portid->drpath.p[i] );
- }
-
+ n += sprintf(buf + n, "DR path ");
+ drpath2str(&(portid->drpath), buf + n, sizeof(buf) - n);
return buf;
}
@@ -114,3 +108,19 @@
return path->cnt;
}
+
+char *
+drpath2str(ib_dr_path_t *path, char *dstr, size_t dstr_size)
+{
+ int i = 0;
+ int rc = snprintf(dstr, dstr_size, "slid %d; dlid %d; %d",
+ path->drslid, path->drdlid, path->p[0]);
+ if (rc >= dstr_size)
+ return dstr;
+ for (i = 1; i <= path->cnt; i++) {
+ rc += snprintf(dstr+rc, dstr_size-rc, ",%d", path->p[i]);
+ if (rc >= dstr_size)
+ break;
+ }
+ return (dstr);
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libibmad-1.1.6/src/register.c new/libibmad-1.2.1/src/register.c
--- old/libibmad-1.1.6/src/register.c 2008-02-28 09:58:36.000000000 +0100
+++ new/libibmad-1.2.1/src/register.c 2008-09-08 13:54:40.000000000 +0200
@@ -97,6 +97,8 @@
return 1;
case IB_DEVICE_MGMT_CLASS:
return 1;
+ case IB_CC_CLASS:
+ return 2;
}
return 0;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libibmad-1.1.6/src/resolve.c new/libibmad-1.2.1/src/resolve.c
--- old/libibmad-1.1.6/src/resolve.c 2008-02-28 09:58:36.000000000 +0100
+++ new/libibmad-1.2.1/src/resolve.c 2008-09-08 13:54:40.000000000 +0200
@@ -50,7 +50,7 @@
#define DEBUG if (ibdebug) IBWARN
int
-ib_resolve_smlid(ib_portid_t *sm_id, int timeout)
+ib_resolve_smlid_via(ib_portid_t *sm_id, int timeout, const void *srcport)
{
ib_portid_t self = {0};
uint8_t portinfo[64];
@@ -58,7 +58,8 @@
memset(sm_id, 0, sizeof(*sm_id));
- if (!smp_query(portinfo, &self, IB_ATTR_PORT_INFO, 0, 0))
+ if (!smp_query_via(portinfo, &self, IB_ATTR_PORT_INFO,
+ 0, 0, srcport))
return -1;
mad_decode_field(portinfo, IB_PORT_SMLID_F, &lid);
@@ -67,14 +68,20 @@
}
int
-ib_resolve_guid(ib_portid_t *portid, uint64_t *guid, ib_portid_t *sm_id, int timeout)
+ib_resolve_smlid(ib_portid_t *sm_id, int timeout)
+{
+ return ib_resolve_smlid_via(sm_id, timeout, NULL);
+}
+
+int
+ib_resolve_guid_via(ib_portid_t *portid, uint64_t *guid, ib_portid_t *sm_id, int timeout, const void *srcport)
{
ib_portid_t sm_portid;
char buf[IB_SA_DATA_SIZE] = {0};
if (!sm_id) {
sm_id = &sm_portid;
- if (ib_resolve_smlid(sm_id, timeout) < 0)
+ if (ib_resolve_smlid_via(sm_id, timeout, srcport) < 0)
return -1;
}
if (*(uint64_t*)&portid->gid == 0)
@@ -82,14 +89,14 @@
if (guid)
mad_set_field64(portid->gid, 0, IB_GID_GUID_F, *guid);
- if ((portid->lid = ib_path_query(portid->gid, portid->gid, sm_id, buf)) < 0)
+ if ((portid->lid = ib_path_query_via(srcport, portid->gid, portid->gid, sm_id, buf)) < 0)
return -1;
return 0;
}
int
-ib_resolve_portid_str(ib_portid_t *portid, char *addr_str, int dest_type, ib_portid_t *sm_id)
+ib_resolve_portid_str_via(ib_portid_t *portid, char *addr_str, int dest_type, ib_portid_t *sm_id, const void *srcport)
{
uint64_t guid;
int lid;
@@ -114,7 +121,7 @@
return -1;
/* keep guid in portid? */
- return ib_resolve_guid(portid, &guid, sm_id, 0);
+ return ib_resolve_guid_via(portid, &guid, sm_id, 0, srcport);
case IB_DEST_DRSLID:
lid = strtol(addr_str, &routepath, 0);
@@ -124,7 +131,7 @@
ib_portid_set(portid, lid, 0, 0);
/* handle DR parsing and set DrSLID to local lid */
- if (ib_resolve_self(&selfportid, &selfport, 0) < 0)
+ if (ib_resolve_self_via(&selfportid, &selfport, 0, srcport) < 0)
return -1;
if (str2drpath(&portid->drpath, routepath, selfportid.lid, 0) < 0)
return -1;
@@ -138,17 +145,25 @@
}
int
-ib_resolve_self(ib_portid_t *portid, int *portnum, ib_gid_t *gid)
+ib_resolve_portid_str(ib_portid_t *portid, char *addr_str, int dest_type, ib_portid_t *sm_id)
+{
+ return ib_resolve_portid_str_via(portid, addr_str, dest_type,
+ sm_id, NULL);
+}
+
+int
+ib_resolve_self_via(ib_portid_t *portid, int *portnum, ibmad_gid_t *gid,
+ const void *srcport)
{
ib_portid_t self = {0};
uint8_t portinfo[64];
uint8_t nodeinfo[64];
uint64_t guid, prefix;
- if (!smp_query(nodeinfo, &self, IB_ATTR_NODE_INFO, 0, 0))
+ if (!smp_query_via(nodeinfo, &self, IB_ATTR_NODE_INFO, 0, 0, srcport))
return -1;
- if (!smp_query(portinfo, &self, IB_ATTR_PORT_INFO, 0, 0))
+ if (!smp_query_via(portinfo, &self, IB_ATTR_PORT_INFO, 0, 0, srcport))
return -1;
mad_decode_field(portinfo, IB_PORT_LID_F, &portid->lid);
@@ -163,3 +178,9 @@
}
return 0;
}
+
+int
+ib_resolve_self(ib_portid_t *portid, int *portnum, ibmad_gid_t *gid)
+{
+ return ib_resolve_self_via (portid, portnum, gid, NULL);
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libibmad-1.1.6/src/rpc.c new/libibmad-1.2.1/src/rpc.c
--- old/libibmad-1.1.6/src/rpc.c 2008-02-28 09:58:36.000000000 +0100
+++ new/libibmad-1.2.1/src/rpc.c 2008-09-08 13:54:40.000000000 +0200
@@ -170,10 +170,10 @@
}
void *
-mad_rpc(void *port_id, ib_rpc_t *rpc, ib_portid_t *dport, void *payload,
+mad_rpc(const void *port_id, ib_rpc_t *rpc, ib_portid_t *dport, void *payload,
void *rcvdata)
{
- struct ibmad_port *p = port_id;
+ const struct ibmad_port *p = port_id;
int status, len;
uint8_t sndbuf[1024], rcvbuf[1024], *mad;
@@ -185,13 +185,16 @@
if ((len = _do_madrpc(p->port_id, sndbuf, rcvbuf,
p->class_agents[rpc->mgtclass],
- len, rpc->timeout)) < 0)
+ len, rpc->timeout)) < 0) {
+ IBWARN("_do_madrpc failed; dport (%s)", portid2str(dport));
return 0;
+ }
mad = umad_get_mad(rcvbuf);
if ((status = mad_get_field(mad, 0, IB_DRSMP_STATUS_F)) != 0) {
- ERRS("MAD completed with error status 0x%x", status);
+ ERRS("MAD completed with error status 0x%x; dport (%s)",
+ status, portid2str(dport));
return 0;
}
@@ -207,10 +210,10 @@
}
void *
-mad_rpc_rmpp(void *port_id, ib_rpc_t *rpc, ib_portid_t *dport,
+mad_rpc_rmpp(const void *port_id, ib_rpc_t *rpc, ib_portid_t *dport,
ib_rmpp_hdr_t *rmpp, void *data)
{
- struct ibmad_port *p = port_id;
+ const struct ibmad_port *p = port_id;
int status, len;
uint8_t sndbuf[1024], rcvbuf[1024], *mad;
@@ -223,13 +226,16 @@
if ((len = _do_madrpc(p->port_id, sndbuf, rcvbuf,
p->class_agents[rpc->mgtclass],
- len, rpc->timeout)) < 0)
+ len, rpc->timeout)) < 0) {
+ IBWARN("_do_madrpc failed; dport (%s)", portid2str(dport));
return 0;
+ }
mad = umad_get_mad(rcvbuf);
if ((status = mad_get_field(mad, 0, IB_MAD_STATUS_F)) != 0) {
- ERRS("MAD completed with error status 0x%x", status);
+ ERRS("MAD completed with error status 0x%x; dport (%s)",
+ status, portid2str(dport));
return 0;
}
@@ -314,7 +320,7 @@
if (mgmt == IB_SA_CLASS)
rmpp_version = 1;
if (mad_register_client(mgmt, rmpp_version) < 0)
- IBPANIC("client_register for mgmt %d failed", mgmt);
+ IBPANIC("client_register for mgmt class %d failed", mgmt);
}
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libibmad-1.1.6/src/sa.c new/libibmad-1.2.1/src/sa.c
--- old/libibmad-1.1.6/src/sa.c 2008-02-28 09:58:36.000000000 +0100
+++ new/libibmad-1.2.1/src/sa.c 2008-09-08 13:54:40.000000000 +0200
@@ -49,7 +49,7 @@
#define DEBUG if (ibdebug) IBWARN
uint8_t *
-sa_rpc_call(void *ibmad_port, void *rcvbuf, ib_portid_t *portid,
+sa_rpc_call(const void *ibmad_port, void *rcvbuf, ib_portid_t *portid,
ib_sa_call_t *sa, unsigned timeout)
{
ib_rpc_t rpc = {0};
@@ -112,7 +112,7 @@
IB_PR_COMPMASK_NUMBPATH)
int
-ib_path_query(ib_gid_t srcgid, ib_gid_t destgid, ib_portid_t *sm_id, void *buf)
+ib_path_query_via(const void *srcport, ibmad_gid_t srcgid, ibmad_gid_t destgid, ib_portid_t *sm_id, void *buf)
{
int npath;
ib_sa_call_t sa = {0};
@@ -132,7 +132,12 @@
mad_encode_field(buf, IB_SA_PR_DGID_F, destgid);
mad_encode_field(buf, IB_SA_PR_SGID_F, srcgid);
- if (!(p = safe_sa_call(buf, sm_id, &sa, 0))) {
+ if (srcport) {
+ p = sa_rpc_call (srcport, buf, sm_id, &sa, 0);
+ } else {
+ p = safe_sa_call(buf, sm_id, &sa, 0);
+ }
+ if (!p) {
IBWARN("sa call path_query failed");
return -1;
}
@@ -140,3 +145,8 @@
mad_decode_field(p, IB_SA_PR_DLID_F, &dlid);
return dlid;
}
+int
+ib_path_query(ibmad_gid_t srcgid, ibmad_gid_t destgid, ib_portid_t *sm_id, void *buf)
+{
+ return ib_path_query_via (NULL, srcgid, destgid, sm_id, buf);
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libibmad-1.1.6/src/smp.c new/libibmad-1.2.1/src/smp.c
--- old/libibmad-1.1.6/src/smp.c 2008-02-28 09:58:36.000000000 +0100
+++ new/libibmad-1.2.1/src/smp.c 2008-09-08 13:54:40.000000000 +0200
@@ -49,7 +49,7 @@
#define DEBUG if (ibdebug) IBWARN
uint8_t *
-smp_set(void *data, ib_portid_t *portid, unsigned attrid, unsigned mod, unsigned timeout)
+smp_set_via(void *data, ib_portid_t *portid, unsigned attrid, unsigned mod, unsigned timeout, const void *srcport)
{
ib_rpc_t rpc = {0};
@@ -71,12 +71,22 @@
portid->sl = 0;
portid->qp = 0;
- return madrpc(&rpc, portid, data, data);
+ if (srcport) {
+ return mad_rpc(srcport, &rpc, portid, data, data);
+ } else {
+ return madrpc(&rpc, portid, data, data);
+ }
}
uint8_t *
-smp_query(void *rcvbuf, ib_portid_t *portid, unsigned attrid, unsigned mod,
- unsigned timeout)
+smp_set(void *data, ib_portid_t *portid, unsigned attrid, unsigned mod, unsigned timeout)
+{
+ return smp_set_via(data, portid, attrid, mod, timeout, NULL);
+}
+
+uint8_t *
+smp_query_via(void *rcvbuf, ib_portid_t *portid, unsigned attrid, unsigned mod,
+ unsigned timeout, const void *srcport)
{
ib_rpc_t rpc = {0};
@@ -98,5 +108,16 @@
portid->sl = 0;
portid->qp = 0;
- return madrpc(&rpc, portid, 0, rcvbuf);
+ if (srcport) {
+ return mad_rpc(srcport, &rpc, portid, 0, rcvbuf);
+ } else {
+ return madrpc(&rpc, portid, 0, rcvbuf);
+ }
+}
+
+uint8_t *
+smp_query(void *rcvbuf, ib_portid_t *portid, unsigned attrid, unsigned mod,
+ unsigned timeout)
+{
+ return smp_query_via(rcvbuf, portid, attrid, mod, timeout, NULL);
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org