From: adilger Date: Wed, 28 May 2003 08:50:46 +0000 (+0000) Subject: Merge b_devel->b_orphan: X-Git-Tag: v1_7_110~1^13~195 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=46785603d6f1116d62d6d62bf0d40f2eba27f842;p=fs%2Flustre-release.git Merge b_devel->b_orphan: DEVEL_ORPHAN_UPDATE_PARENT_20030522->DEVEL_ORPHAN_UPDATE_PARENT_20030528 --- diff --git a/lnet/Makefile.am b/lnet/Makefile.am index 3c42103..26293f2 100644 --- a/lnet/Makefile.am +++ b/lnet/Makefile.am @@ -3,6 +3,10 @@ # This code is issued under the GNU General Public License. # See the file COPYING in this distribution -EXTRA_DIST = Rules.linux archdep.m4 MCP +EXTRA_DIST = Rules.linux archdep.m4 DIST_SUBDIRS = libcfs portals knals unals utils tests doc router +if LIBLUSTRE +SUBDIRS = portals unals utils +else SUBDIRS = libcfs portals knals unals utils tests doc router +endif diff --git a/lnet/archdep.m4 b/lnet/archdep.m4 index 0315644..2c7fa59 100644 --- a/lnet/archdep.m4 +++ b/lnet/archdep.m4 @@ -52,6 +52,7 @@ case ${host_cpu} in AC_MSG_RESULT($host_cpu) KCFLAGS='-g -Wall ' KCPPFLAGS='-D__arch_lib__ ' + libdir='${exec_prefix}/lib/lustre' MOD_LINK=elf_i386 ;; um ) @@ -144,7 +145,7 @@ fi # ------------ include paths ------------------ if test $host_cpu != "lib" ; then - KINCFLAGS='-I$(top_srcdir)/include -I$(top_srcdir)/portals/include -I$(LINUX)/include' + KINCFLAGS="-I\$(top_srcdir)/include -I\$(top_srcdir)/portals/include -I$LINUX/include" else KINCFLAGS='-I$(top_srcdir)/include -I$(top_srcdir)/portals/include' fi @@ -189,18 +190,128 @@ if test $host_cpu != "lib" ; then fi fi -# ---------- SMP ------------------- -#AC_MSG_CHECKING(for SMP) -#if egrep -e SMP=y $LINUX/.config >/dev/null 2>&1; then -# SMPFLAG= -# AC_MSG_RESULT(yes) +# ---------- Portals flags -------------------- + +#AC_PREFIX_DEFAULT([]) +#if test "x$prefix" = xNONE || test "x$prefix" = x; then +# usrprefix=/usr #else -# SMPFLAG= -# AC_MSG_RESULT(no) +# usrprefix='${prefix}' #fi +#AC_SUBST(usrprefix) + +AC_MSG_CHECKING(if kernel has CPU affinity support) +if test "$target_cpu" != ia64 ; then + enable_affinity_temp="-DCPU_AFFINITY=1" + AC_MSG_RESULT(yes) +else + enable_affinity_temp="" + AC_MSG_RESULT(no) +fi + +AC_MSG_CHECKING(if kernel has zero-copy TCP support) +ZCCD="`grep -c zccd $LINUX/include/linux/skbuff.h`" +if test "$ZCCD" != 0 ; then + enable_zerocopy_temp="-DSOCKNAL_ZC=1" + AC_MSG_RESULT(yes) +else + enable_zerocopy_temp="" + AC_MSG_RESULT(no) +fi + +AC_ARG_ENABLE(zerocopy, [ --enable-zerocopy enable socknal zerocopy],enable_zerocopy="-DSOCKNAL_ZC=1", enable_zercopy=$enable_zerocopy_temp) + +AC_ARG_ENABLE(affinity, [ --enable-affinity enable process/irq affinity],enable_affinity="-DCPU_AFFINITY=1", enable_affinity=$enable_affinity_temp) +##################################### + +AC_MSG_CHECKING(if quadrics kernel headers are present) +if test -d $LINUX/drivers/net/qsnet ; then + AC_MSG_RESULT(yes) + QSWNAL="qswnal" + with_quadrics="-I$LINUX/drivers/net/qsnet/include" + : +elif test -d $LINUX/drivers/qsnet1 ; then + AC_MSG_RESULT(yes) + QSWNAL="qswnal" + with_quadrics="-I$LINUX/drivers/qsnet1/include -DPROPRIETARY_ELAN" + : +elif test -d $LINUX/drivers/quadrics ; then + AC_MSG_RESULT(yes) + QSWNAL="qswnal" + with_quadrics="-I$LINUX/drivers/quadrics/include -DPROPRIETARY_ELAN" + : +#elif test -d /usr/include/elan3 ; then +# AC_MSG_RESULT(yes) +# QSWNAL="qswnal" +# with_quadrics="" +# : +else + AC_MSG_RESULT(no) + QSWNAL="" + with_quadrics="" + : +fi +AC_SUBST(with_quadrics) +AC_SUBST(QSWNAL) + +# R. Read 5/02 +GMNAL="" +echo "checking with-gm=" ${with_gm} +if test "${with_gm+set}" = set; then + if test "${with_gm}" = yes; then + with_gm="-I/usr/local/gm/include" + else + with_gm=-I"$with_gm/include" + fi + GMNAL="gmnal" +else +# default case - no GM + with_gm="" +fi +AC_SUBST(with_gm) +AC_SUBST(GMNAL) + + +def_scamac=/opt/scali/include +AC_ARG_WITH(scamac, [ --with-scamac=[yes/no/path] Path to ScaMAC includes (default=/opt/scali/include)], with_scamac=$withval, with_scamac=$def_scamac) +AC_MSG_CHECKING(if ScaMAC headers are present) +if test "$with_scamac" = yes; then + with_scamac=$def_scamac +fi +if test "$with_scamac" != no -a -f ${with_scamac}/scamac.h; then + AC_MSG_RESULT(yes) + SCIMACNAL="scimacnal" + with_scamac="-I${with_scamac} -I${with_scamac}/icm" +else + AC_MSG_RESULT(no) + SCIMACNAL="" + with_scamac="" +fi + +AC_SUBST(with_scamac) +AC_SUBST(SCIMACNAL) CFLAGS="$KCFLAGS" -CPPFLAGS="$KINCFLAGS $KCPPFLAGS $MFLAGS " +CPPFLAGS="$KINCFLAGS $KCPPFLAGS $MFLAGS $enable_zerocopy $enable_affinity $with_quadrics $with_gm $with_scamac " AC_SUBST(MOD_LINK) -AC_SUBST(LINUX25) \ No newline at end of file +AC_SUBST(LINUX25) +AM_CONDITIONAL(LIBLUSTRE, test x$host_cpu = xlib) + +# ---------- Red Hat 2.4.20 backports some 2.5 bits -------- +# This needs to run after we've defined the KCPPFLAGS + +AC_MSG_CHECKING(for kernel version) +AC_TRY_LINK([#define __KERNEL__ + #include ], + [struct task_struct p; + p.sighand = NULL;], + [RH_2_4_20=1], + [RH_2_4_20=0]) + +if test $RH_2_4_20 = 1; then + AC_MSG_RESULT(redhat-2.4.20) + CPPFLAGS="$CPPFLAGS -DCONFIG_RH_2_4_20" +else + AC_MSG_RESULT($RELEASE) +fi diff --git a/lnet/build.m4 b/lnet/build.m4 index 4e8dbbb..025f243 100644 --- a/lnet/build.m4 +++ b/lnet/build.m4 @@ -1,5 +1,4 @@ - -# ---------- directories --------- +# ---------- other tests and settings --------- # --------- unsigned long long sane? ------- @@ -94,15 +93,3 @@ fi AC_SUBST(LIBEFENCE) AC_SUBST(HAVE_LIBEFENCE) -AM_CONDITIONAL(LIBLUSTRE, test x$host_cpu = xlib) -AC_MSG_CHECKING(if you are building lib lustre) -if test "$host_cpu" = "lib"; then - AC_MSG_RESULT(yes) - libdir='${exec_prefix}/lib/lustre' -else - AC_MSG_RESULT(no) -fi - -# end -------- Kernel build environment. ----------------- - - diff --git a/lnet/configure.in b/lnet/configure.in index 2ee86b2..31d3492 100644 --- a/lnet/configure.in +++ b/lnet/configure.in @@ -13,7 +13,6 @@ AM_INIT_AUTOMAKE(portals, builtin([esyscmd], [sed -ne '/.*define IVERSION /{ s/. sinclude(build.m4) sinclude(archdep.m4) -sinclude(portalsconf.m4) if test x$enable_inkernel = xyes ; then cp Kernelenv.mk Kernelenv.in @@ -31,6 +30,5 @@ AC_OUTPUT([Makefile Kernelenv libcfs/Makefile portals/Makefile \ unals/Makefile knals/Makefile router/Makefile \ knals/socknal/Makefile knals/gmnal/Makefile knals/qswnal/Makefile \ knals/scimacnal/Makefile knals/toenal/Makefile \ - utils/Makefile tests/Makefile doc/Makefile \ - packaging/Makefile packaging/portals.spec ]) + utils/Makefile tests/Makefile doc/Makefile ]) diff --git a/lnet/include/lnet/lib-lnet.h b/lnet/include/lnet/lib-lnet.h index b70e128..4a61e76 100644 --- a/lnet/include/lnet/lib-lnet.h +++ b/lnet/include/lnet/lib-lnet.h @@ -370,6 +370,7 @@ extern void lib_copy_buf2iov (int niov, struct iovec *iov, char *dest, ptl_size_ extern ptl_size_t lib_kiov_nob (int niov, ptl_kiov_t *iov); extern void lib_copy_kiov2buf (char *dest, int niov, ptl_kiov_t *iov, ptl_size_t len); extern void lib_copy_buf2kiov (int niov, ptl_kiov_t *iov, char *src, ptl_size_t len); +extern void lib_assert_wire_constants (void); extern void lib_recv (nal_cb_t *nal, void *private, lib_msg_t *msg, lib_md_t *md, ptl_size_t offset, ptl_size_t mlen, ptl_size_t rlen); diff --git a/lnet/include/lnet/lib-p30.h b/lnet/include/lnet/lib-p30.h index b70e128..4a61e76 100644 --- a/lnet/include/lnet/lib-p30.h +++ b/lnet/include/lnet/lib-p30.h @@ -370,6 +370,7 @@ extern void lib_copy_buf2iov (int niov, struct iovec *iov, char *dest, ptl_size_ extern ptl_size_t lib_kiov_nob (int niov, ptl_kiov_t *iov); extern void lib_copy_kiov2buf (char *dest, int niov, ptl_kiov_t *iov, ptl_size_t len); extern void lib_copy_buf2kiov (int niov, ptl_kiov_t *iov, char *src, ptl_size_t len); +extern void lib_assert_wire_constants (void); extern void lib_recv (nal_cb_t *nal, void *private, lib_msg_t *msg, lib_md_t *md, ptl_size_t offset, ptl_size_t mlen, ptl_size_t rlen); diff --git a/lnet/include/lnet/lib-types.h b/lnet/include/lnet/lib-types.h index bece0a30..47c0dd2 100644 --- a/lnet/include/lnet/lib-types.h +++ b/lnet/include/lnet/lib-types.h @@ -31,6 +31,8 @@ typedef struct lib_me_t lib_me_t; typedef struct lib_md_t lib_md_t; typedef struct lib_eq_t lib_eq_t; +#define WIRE_ATTR __attribute__((packed)) + /* The wire handle's interface cookie only matches one network interface in * one epoch (i.e. new cookie when the interface restarts or the node * reboots). The object cookie only matches one object on that interface @@ -38,7 +40,7 @@ typedef struct lib_eq_t lib_eq_t; typedef struct { __u64 wh_interface_cookie; __u64 wh_object_cookie; -} ptl_handle_wire_t; +} WIRE_ATTR ptl_handle_wire_t; /* byte-flip insensitive! */ #define PTL_WIRE_HANDLE_NONE \ @@ -63,7 +65,7 @@ typedef struct ptl_ack { ptl_handle_wire_t dst_wmd; ptl_match_bits_t match_bits; ptl_size_t length; /* common length (0 for acks) moving out RSN */ -} ptl_ack_t; +} WIRE_ATTR ptl_ack_t; typedef struct ptl_put { ptl_pt_index_t ptl_index; @@ -72,7 +74,7 @@ typedef struct ptl_put { ptl_size_t length; /* common length moving out RSN */ ptl_size_t offset; ptl_hdr_data_t hdr_data; -} ptl_put_t; +} WIRE_ATTR ptl_put_t; typedef struct ptl_get { ptl_pt_index_t ptl_index; @@ -82,7 +84,7 @@ typedef struct ptl_get { ptl_size_t src_offset; ptl_size_t return_offset; /* unused: going RSN */ ptl_size_t sink_length; -} ptl_get_t; +} WIRE_ATTR ptl_get_t; typedef struct ptl_reply { __u32 unused1; /* unused fields going RSN */ @@ -90,7 +92,7 @@ typedef struct ptl_reply { ptl_size_t dst_offset; /* unused: going RSN */ __u32 unused2; ptl_size_t length; /* common length moving out RSN */ -} ptl_reply_t; +} WIRE_ATTR ptl_reply_t; typedef struct { ptl_nid_t dest_nid; @@ -104,7 +106,7 @@ typedef struct { ptl_get_t get; ptl_reply_t reply; } msg; -} ptl_hdr_t; +} WIRE_ATTR ptl_hdr_t; /* All length fields in individual unions at same offset */ /* LASSERT for same in lib-move.c */ @@ -122,7 +124,7 @@ typedef struct { __u32 magic; /* PORTALS_PROTO_MAGIC */ __u16 version_major; /* increment on incompatible change */ __u16 version_minor; /* increment on compatible change */ -} ptl_magicversion_t; +} WIRE_ATTR ptl_magicversion_t; #define PORTALS_PROTO_MAGIC 0xeebc0ded diff --git a/lnet/klnds/Makefile.am b/lnet/klnds/Makefile.am index 5c6085e..fed2785 100644 --- a/lnet/klnds/Makefile.am +++ b/lnet/klnds/Makefile.am @@ -3,4 +3,5 @@ # This code is issued under the GNU General Public License. # See the file COPYING in this distribution +DIST_SUBDIRS= socknal toenal qswnal gmnal scimacnal SUBDIRS= socknal toenal @QSWNAL@ @GMNAL@ @SCIMACNAL@ diff --git a/lnet/libcfs/module.c b/lnet/libcfs/module.c index 5025856..c4ca2e3 100644 --- a/lnet/libcfs/module.c +++ b/lnet/libcfs/module.c @@ -19,7 +19,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define EXPORT_SYMTAB +#ifndef EXPORT_SYMTAB +# define EXPORT_SYMTAB +#endif #define DEBUG_SUBSYSTEM S_PORTALS #include @@ -45,6 +47,7 @@ #include #include #include +#include #define PORTAL_MINOR 240 @@ -84,10 +87,10 @@ kportal_blockallsigs () { unsigned long flags; - spin_lock_irqsave (¤t->sigmask_lock, flags); - siginitsetinv (¤t->blocked, 0); - recalc_sigpending (current); - spin_unlock_irqrestore (¤t->sigmask_lock, flags); + SIGNAL_MASK_LOCK(current, flags); + sigfillset(¤t->blocked); + RECALC_SIGPENDING; + SIGNAL_MASK_UNLOCK(current, flags); } /* called when opening /dev/device */ diff --git a/lnet/lnet/lib-init.c b/lnet/lnet/lib-init.c index d6315c6..99c4d32 100644 --- a/lnet/lnet/lib-init.c +++ b/lnet/lnet/lib-init.c @@ -357,6 +357,8 @@ lib_init(nal_cb_t * nal, ptl_nid_t nid, ptl_pid_t pid, int gsize, goto out; } + lib_assert_wire_constants (); + /* * Allocate the portal table for this interface * and all per-interface objects. diff --git a/lnet/lnet/lib-move.c b/lnet/lnet/lib-move.c index a04e961..fde4f16 100644 --- a/lnet/lnet/lib-move.c +++ b/lnet/lnet/lib-move.c @@ -1285,3 +1285,95 @@ int do_PtlGet(nal_cb_t * nal, void *private, void *v_args, void *v_ret) return ret->rc = PTL_OK; } + +void lib_assert_wire_constants (void) +{ + /* Wire protocol assertions generated by 'wirecheck' */ + + /* Constants... */ + LASSERT (PORTALS_PROTO_MAGIC == 0xeebc0ded); + LASSERT (PORTALS_PROTO_VERSION_MAJOR == 0); + LASSERT (PORTALS_PROTO_VERSION_MINOR == 1); + LASSERT (PTL_MSG_ACK == 0); + LASSERT (PTL_MSG_PUT == 1); + LASSERT (PTL_MSG_GET == 2); + LASSERT (PTL_MSG_REPLY == 3); + LASSERT (PTL_MSG_HELLO == 4); + + /* Checks for struct ptl_handle_wire_t */ + LASSERT (sizeof (ptl_handle_wire_t) == 16); + LASSERT (offsetof (ptl_handle_wire_t, wh_interface_cookie) == 0); + LASSERT (sizeof (((ptl_handle_wire_t *)0)->wh_interface_cookie) == 8); + LASSERT (offsetof (ptl_handle_wire_t, wh_object_cookie) == 8); + LASSERT (sizeof (((ptl_handle_wire_t *)0)->wh_object_cookie) == 8); + + /* Checks for struct ptl_magicversion_t */ + LASSERT (sizeof (ptl_magicversion_t) == 8); + LASSERT (offsetof (ptl_magicversion_t, magic) == 0); + LASSERT (sizeof (((ptl_magicversion_t *)0)->magic) == 4); + LASSERT (offsetof (ptl_magicversion_t, version_major) == 4); + LASSERT (sizeof (((ptl_magicversion_t *)0)->version_major) == 2); + LASSERT (offsetof (ptl_magicversion_t, version_minor) == 6); + LASSERT (sizeof (((ptl_magicversion_t *)0)->version_minor) == 2); + + /* Checks for struct ptl_hdr_t */ + LASSERT (sizeof (ptl_hdr_t) == 72); + LASSERT (offsetof (ptl_hdr_t, dest_nid) == 0); + LASSERT (sizeof (((ptl_hdr_t *)0)->dest_nid) == 8); + LASSERT (offsetof (ptl_hdr_t, src_nid) == 8); + LASSERT (sizeof (((ptl_hdr_t *)0)->src_nid) == 8); + LASSERT (offsetof (ptl_hdr_t, dest_pid) == 16); + LASSERT (sizeof (((ptl_hdr_t *)0)->dest_pid) == 4); + LASSERT (offsetof (ptl_hdr_t, src_pid) == 20); + LASSERT (sizeof (((ptl_hdr_t *)0)->src_pid) == 4); + LASSERT (offsetof (ptl_hdr_t, type) == 24); + LASSERT (sizeof (((ptl_hdr_t *)0)->type) == 4); + + /* Ack */ + LASSERT (offsetof (ptl_hdr_t, msg.ack.mlength) == 28); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.ack.mlength) == 4); + LASSERT (offsetof (ptl_hdr_t, msg.ack.dst_wmd) == 32); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.ack.dst_wmd) == 16); + LASSERT (offsetof (ptl_hdr_t, msg.ack.match_bits) == 48); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.ack.match_bits) == 8); + LASSERT (offsetof (ptl_hdr_t, msg.ack.length) == 56); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.ack.length) == 4); + + /* Put */ + LASSERT (offsetof (ptl_hdr_t, msg.put.ptl_index) == 28); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.put.ptl_index) == 4); + LASSERT (offsetof (ptl_hdr_t, msg.put.ack_wmd) == 32); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.put.ack_wmd) == 16); + LASSERT (offsetof (ptl_hdr_t, msg.put.match_bits) == 48); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.put.match_bits) == 8); + LASSERT (offsetof (ptl_hdr_t, msg.put.length) == 56); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.put.length) == 4); + LASSERT (offsetof (ptl_hdr_t, msg.put.offset) == 60); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.put.offset) == 4); + LASSERT (offsetof (ptl_hdr_t, msg.put.hdr_data) == 64); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.put.hdr_data) == 8); + + /* Get */ + LASSERT (offsetof (ptl_hdr_t, msg.get.ptl_index) == 28); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.get.ptl_index) == 4); + LASSERT (offsetof (ptl_hdr_t, msg.get.return_wmd) == 32); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.get.return_wmd) == 16); + LASSERT (offsetof (ptl_hdr_t, msg.get.match_bits) == 48); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.get.match_bits) == 8); + LASSERT (offsetof (ptl_hdr_t, msg.get.length) == 56); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.get.length) == 4); + LASSERT (offsetof (ptl_hdr_t, msg.get.src_offset) == 60); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.get.src_offset) == 4); + LASSERT (offsetof (ptl_hdr_t, msg.get.return_offset) == 64); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.get.return_offset) == 4); + LASSERT (offsetof (ptl_hdr_t, msg.get.sink_length) == 68); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.get.sink_length) == 4); + + /* Reply */ + LASSERT (offsetof (ptl_hdr_t, msg.reply.dst_wmd) == 32); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.reply.dst_wmd) == 16); + LASSERT (offsetof (ptl_hdr_t, msg.reply.dst_offset) == 48); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.reply.dst_offset) == 4); + LASSERT (offsetof (ptl_hdr_t, msg.reply.length) == 56); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.reply.length) == 4); +} diff --git a/lnet/portalsconf.m4 b/lnet/portalsconf.m4 deleted file mode 100644 index 7bd3919..0000000 --- a/lnet/portalsconf.m4 +++ /dev/null @@ -1,118 +0,0 @@ -AC_PREFIX_DEFAULT([]) -if test "x$prefix" = xNONE || test "x$prefix" = x; then - usrprefix=/usr -else - usrprefix='${prefix}' -fi -AC_SUBST(usrprefix) - -AC_ARG_ENABLE(rtscts-myrinet, [ --enable-rtscts-myrinet enable rtscts over myrinet support]) -AM_CONDITIONAL(RTSCTS_MYRINET, test "$enable_rtscts_myrinet" = yes) - - -CPLANT_ARCH=${target_cpu} -case ${CPLANT_ARCH} in -alpha*) - RTSCTSLIB_CFLAGS='-O4 -mno-fp-regs' - RTSCTSLIB_DEFS=-Ddec_linux - ;; -i*86) - RTSCTSLIB_CFLAGS=-O4 - RTSCTSLIB_DEFS=-Dintel_linux - ;; -#*) -# AC_MSG_ERROR([Unrecognized architecture '$CPLANT_ARCH' for rtscts]) -# ;; -esac -AC_SUBST(CPLANT_ARCH) -AC_SUBST(RTSCTSLIB_CFLAGS) -AC_SUBST(RTSCTSLIB_DEFS) - -AC_MSG_CHECKING(if kernel has CPU affinity support) -if test "$target_cpu" != ia64 ; then - enable_affinity_temp="-DCPU_AFFINITY=1" - AC_MSG_RESULT(yes) -else - enable_affinity_temp="" - AC_MSG_RESULT(no) -fi -AC_MSG_CHECKING(if kernel has zero-copy TCP support) -ZCCD="`grep -c zccd $LINUX/include/linux/skbuff.h`" -if test "$ZCCD" != 0 ; then - enable_zerocopy_temp="-DSOCKNAL_ZC=1" - AC_MSG_RESULT(yes) -else - enable_zerocopy_temp="" - AC_MSG_RESULT(no) -fi - -AC_ARG_ENABLE(zerocopy, [ --enable-zerocopy enable socknal zerocopy],enable_zerocopy="-DSOCKNAL_ZC=1", enable_zercopy=$enable_zerocopy_temp) - -AC_ARG_ENABLE(affinity, [ --enable-affinity enable process/irq affinity],enable_affinity="-DCPU_AFFINITY=1", enable_affinity=$enable_affinity_temp) -##################################### - -AC_MSG_CHECKING(if quadrics kernel headers are present) -if test -d $LINUX/drivers/net/qsnet ; then - AC_MSG_RESULT(yes) - QSWNAL="qswnal" - with_quadrics="-I$LINUX/drivers/net/qsnet/include" - : -elif test -d $LINUX/drivers/qsnet1 ; then - AC_MSG_RESULT(yes) - QSWNAL="qswnal" - with_quadrics="-I$LINUX/drivers/qsnet1/include -DPROPRIETARY_ELAN" - : -elif test -d $LINUX/drivers/quadrics ; then - AC_MSG_RESULT(yes) - QSWNAL="qswnal" - with_quadrics="-I$LINUX/drivers/quadrics/include -DPROPRIETARY_ELAN" - : -#elif test -d /usr/include/elan3 ; then -# AC_MSG_RESULT(yes) -# QSWNAL="qswnal" -# with_quadrics="" -# : -else - AC_MSG_RESULT(no) - QSWNAL="" - with_quadrics="" - : -fi -AC_SUBST(with_quadrics) -AC_SUBST(QSWNAL) - -# R. Read 5/02 -GMNAL="" -echo "checking with-gm=" ${with_gm} -if test "${with_gm+set}" = set; then - if test "${with_gm}" = yes; then - with_gm="-I/usr/local/gm/include" - else - with_gm=-I"$with_gm/include" - fi - GMNAL="gmnal" -else -# default case - no GM - with_gm="" -fi -AC_SUBST(with_gm) -AC_SUBST(GMNAL) - - -def_scamac=/opt/scali/include -AC_ARG_WITH(scamac, [ --with-scamac=[yes/no/path] Path to ScaMAC includes (default=/opt/scali/include)], with_scamac=$withval, with_scamac=$def_scamac) -AC_MSG_CHECKING(if ScaMAC headers are present) -if test "$with_scamac" = yes; then - with_scamac=$def_scamac -fi -if test "$with_scamac" != no -a -f ${with_scamac}/scamac.h; then - AC_MSG_RESULT(yes) - SCIMACNAL="scimacnal" - with_scamac="-I${with_scamac} -I${with_scamac}/icm" -else - AC_MSG_RESULT(no) - SCIMACNAL="" - with_scamac="" -fi -AC_SUBST(with_scamac) -AC_SUBST(SCIMACNAL) diff --git a/lnet/ulnds/Makefile.am b/lnet/ulnds/Makefile.am index b62b401..dc427b0 100644 --- a/lnet/ulnds/Makefile.am +++ b/lnet/ulnds/Makefile.am @@ -1,5 +1,5 @@ CPPFLAGS= INCLUDES=-I$(top_srcdir)/portals/include -I$(top_srcdir)/include -I$(srcdir) lib_LIBRARIES = libtcpnal.a -pkginclude_HEADERS = pqtimer.h dispatch.h table.h timer.h connection.h +pkginclude_HEADERS = pqtimer.h dispatch.h table.h timer.h connection.h ipmap.h bridge.h procbridge.h libtcpnal_a_SOURCES = debug.c pqtimer.c select.c table.c pqtimer.h dispatch.h table.h timer.h address.c procapi.c proclib.c connection.c tcpnal.c connection.h diff --git a/lnet/ulnds/socklnd/Makefile.am b/lnet/ulnds/socklnd/Makefile.am index b62b401..dc427b0 100644 --- a/lnet/ulnds/socklnd/Makefile.am +++ b/lnet/ulnds/socklnd/Makefile.am @@ -1,5 +1,5 @@ CPPFLAGS= INCLUDES=-I$(top_srcdir)/portals/include -I$(top_srcdir)/include -I$(srcdir) lib_LIBRARIES = libtcpnal.a -pkginclude_HEADERS = pqtimer.h dispatch.h table.h timer.h connection.h +pkginclude_HEADERS = pqtimer.h dispatch.h table.h timer.h connection.h ipmap.h bridge.h procbridge.h libtcpnal_a_SOURCES = debug.c pqtimer.c select.c table.c pqtimer.h dispatch.h table.h timer.h address.c procapi.c proclib.c connection.c tcpnal.c connection.h diff --git a/lnet/utils/.cvsignore b/lnet/utils/.cvsignore index 041cd6b..148310a 100644 --- a/lnet/utils/.cvsignore +++ b/lnet/utils/.cvsignore @@ -5,3 +5,4 @@ debugctl ptlctl .deps routerstat +wirecheck \ No newline at end of file diff --git a/lnet/utils/Makefile.am b/lnet/utils/Makefile.am index 065fcf9..05af598 100644 --- a/lnet/utils/Makefile.am +++ b/lnet/utils/Makefile.am @@ -7,11 +7,13 @@ COMPILE = gcc -Wall -g -I$(srcdir)/../include LINK = gcc -o $@ -sbin_PROGRAMS = acceptor ptlctl debugctl routerstat +sbin_PROGRAMS = acceptor ptlctl debugctl routerstat wirecheck lib_LIBRARIES = libptlctl.a acceptor_SOURCES = acceptor.c # -lefence +wirecheck_SOURCES = wirecheck.c + libptlctl_a_SOURCES = portals.c debug.c l_ioctl.c parser.c parser.h ptlctl_SOURCES = ptlctl.c diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h index fe08646..4275a10 100644 --- a/lustre/include/linux/lustre_compat25.h +++ b/lustre/include/linux/lustre_compat25.h @@ -1,7 +1,7 @@ /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- * vim:expandtab:shiftwidth=8:tabstop=8: * - * Copyright (C) 2002 Cluster File Systems, Inc. + * Copyright (c) 2003 Cluster File Systems, Inc. * * This file is part of Lustre, http://www.lustre.org. * @@ -23,6 +23,7 @@ #ifndef _COMPAT25_H #define _COMPAT25_H +#include #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) #define KDEVT_VAL(dev, val) dev.value = 0 @@ -31,19 +32,6 @@ #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) -# define SIGNAL_MASK_LOCK(task, flags) spin_lock_irqsave( \ - &task->sighand->siglock, flags) -# define SIGNAL_MASK_UNLOCK(task, flags) spin_unlock_irqrestore( \ - &task->sighand->siglock, flags) -#else -# define SIGNAL_MASK_LOCK(task, flags) spin_lock_irqsave( \ - &task->sigmask_lock, flags) -# define SIGNAL_MASK_UNLOCK(task, flags) spin_unlock_irqrestore( \ - &task->sigmask_lock, flags) -#endif - - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) # define PGCACHE_WRLOCK(mapping) write_lock(&mapping->page_lock) # define PGCACHE_WRUNLOCK(mapping) write_unlock(&mapping->page_lock) #else @@ -78,13 +66,6 @@ # define LL_CHECK_DIRTY(sb) ll_check_dirty(sb) #endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) -# define RECALC_SIGPENDING recalc_sigpending() -#else -# define RECALC_SIGPENDING recalc_sigpending(current) -#endif - - #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) #define rb_node_s rb_node #define rb_root_s rb_root diff --git a/lustre/portals/Makefile.am b/lustre/portals/Makefile.am index 3c42103..26293f2 100644 --- a/lustre/portals/Makefile.am +++ b/lustre/portals/Makefile.am @@ -3,6 +3,10 @@ # This code is issued under the GNU General Public License. # See the file COPYING in this distribution -EXTRA_DIST = Rules.linux archdep.m4 MCP +EXTRA_DIST = Rules.linux archdep.m4 DIST_SUBDIRS = libcfs portals knals unals utils tests doc router +if LIBLUSTRE +SUBDIRS = portals unals utils +else SUBDIRS = libcfs portals knals unals utils tests doc router +endif diff --git a/lustre/portals/archdep.m4 b/lustre/portals/archdep.m4 index 0315644..2c7fa59 100644 --- a/lustre/portals/archdep.m4 +++ b/lustre/portals/archdep.m4 @@ -52,6 +52,7 @@ case ${host_cpu} in AC_MSG_RESULT($host_cpu) KCFLAGS='-g -Wall ' KCPPFLAGS='-D__arch_lib__ ' + libdir='${exec_prefix}/lib/lustre' MOD_LINK=elf_i386 ;; um ) @@ -144,7 +145,7 @@ fi # ------------ include paths ------------------ if test $host_cpu != "lib" ; then - KINCFLAGS='-I$(top_srcdir)/include -I$(top_srcdir)/portals/include -I$(LINUX)/include' + KINCFLAGS="-I\$(top_srcdir)/include -I\$(top_srcdir)/portals/include -I$LINUX/include" else KINCFLAGS='-I$(top_srcdir)/include -I$(top_srcdir)/portals/include' fi @@ -189,18 +190,128 @@ if test $host_cpu != "lib" ; then fi fi -# ---------- SMP ------------------- -#AC_MSG_CHECKING(for SMP) -#if egrep -e SMP=y $LINUX/.config >/dev/null 2>&1; then -# SMPFLAG= -# AC_MSG_RESULT(yes) +# ---------- Portals flags -------------------- + +#AC_PREFIX_DEFAULT([]) +#if test "x$prefix" = xNONE || test "x$prefix" = x; then +# usrprefix=/usr #else -# SMPFLAG= -# AC_MSG_RESULT(no) +# usrprefix='${prefix}' #fi +#AC_SUBST(usrprefix) + +AC_MSG_CHECKING(if kernel has CPU affinity support) +if test "$target_cpu" != ia64 ; then + enable_affinity_temp="-DCPU_AFFINITY=1" + AC_MSG_RESULT(yes) +else + enable_affinity_temp="" + AC_MSG_RESULT(no) +fi + +AC_MSG_CHECKING(if kernel has zero-copy TCP support) +ZCCD="`grep -c zccd $LINUX/include/linux/skbuff.h`" +if test "$ZCCD" != 0 ; then + enable_zerocopy_temp="-DSOCKNAL_ZC=1" + AC_MSG_RESULT(yes) +else + enable_zerocopy_temp="" + AC_MSG_RESULT(no) +fi + +AC_ARG_ENABLE(zerocopy, [ --enable-zerocopy enable socknal zerocopy],enable_zerocopy="-DSOCKNAL_ZC=1", enable_zercopy=$enable_zerocopy_temp) + +AC_ARG_ENABLE(affinity, [ --enable-affinity enable process/irq affinity],enable_affinity="-DCPU_AFFINITY=1", enable_affinity=$enable_affinity_temp) +##################################### + +AC_MSG_CHECKING(if quadrics kernel headers are present) +if test -d $LINUX/drivers/net/qsnet ; then + AC_MSG_RESULT(yes) + QSWNAL="qswnal" + with_quadrics="-I$LINUX/drivers/net/qsnet/include" + : +elif test -d $LINUX/drivers/qsnet1 ; then + AC_MSG_RESULT(yes) + QSWNAL="qswnal" + with_quadrics="-I$LINUX/drivers/qsnet1/include -DPROPRIETARY_ELAN" + : +elif test -d $LINUX/drivers/quadrics ; then + AC_MSG_RESULT(yes) + QSWNAL="qswnal" + with_quadrics="-I$LINUX/drivers/quadrics/include -DPROPRIETARY_ELAN" + : +#elif test -d /usr/include/elan3 ; then +# AC_MSG_RESULT(yes) +# QSWNAL="qswnal" +# with_quadrics="" +# : +else + AC_MSG_RESULT(no) + QSWNAL="" + with_quadrics="" + : +fi +AC_SUBST(with_quadrics) +AC_SUBST(QSWNAL) + +# R. Read 5/02 +GMNAL="" +echo "checking with-gm=" ${with_gm} +if test "${with_gm+set}" = set; then + if test "${with_gm}" = yes; then + with_gm="-I/usr/local/gm/include" + else + with_gm=-I"$with_gm/include" + fi + GMNAL="gmnal" +else +# default case - no GM + with_gm="" +fi +AC_SUBST(with_gm) +AC_SUBST(GMNAL) + + +def_scamac=/opt/scali/include +AC_ARG_WITH(scamac, [ --with-scamac=[yes/no/path] Path to ScaMAC includes (default=/opt/scali/include)], with_scamac=$withval, with_scamac=$def_scamac) +AC_MSG_CHECKING(if ScaMAC headers are present) +if test "$with_scamac" = yes; then + with_scamac=$def_scamac +fi +if test "$with_scamac" != no -a -f ${with_scamac}/scamac.h; then + AC_MSG_RESULT(yes) + SCIMACNAL="scimacnal" + with_scamac="-I${with_scamac} -I${with_scamac}/icm" +else + AC_MSG_RESULT(no) + SCIMACNAL="" + with_scamac="" +fi + +AC_SUBST(with_scamac) +AC_SUBST(SCIMACNAL) CFLAGS="$KCFLAGS" -CPPFLAGS="$KINCFLAGS $KCPPFLAGS $MFLAGS " +CPPFLAGS="$KINCFLAGS $KCPPFLAGS $MFLAGS $enable_zerocopy $enable_affinity $with_quadrics $with_gm $with_scamac " AC_SUBST(MOD_LINK) -AC_SUBST(LINUX25) \ No newline at end of file +AC_SUBST(LINUX25) +AM_CONDITIONAL(LIBLUSTRE, test x$host_cpu = xlib) + +# ---------- Red Hat 2.4.20 backports some 2.5 bits -------- +# This needs to run after we've defined the KCPPFLAGS + +AC_MSG_CHECKING(for kernel version) +AC_TRY_LINK([#define __KERNEL__ + #include ], + [struct task_struct p; + p.sighand = NULL;], + [RH_2_4_20=1], + [RH_2_4_20=0]) + +if test $RH_2_4_20 = 1; then + AC_MSG_RESULT(redhat-2.4.20) + CPPFLAGS="$CPPFLAGS -DCONFIG_RH_2_4_20" +else + AC_MSG_RESULT($RELEASE) +fi diff --git a/lustre/portals/build.m4 b/lustre/portals/build.m4 index 4e8dbbb..025f243 100644 --- a/lustre/portals/build.m4 +++ b/lustre/portals/build.m4 @@ -1,5 +1,4 @@ - -# ---------- directories --------- +# ---------- other tests and settings --------- # --------- unsigned long long sane? ------- @@ -94,15 +93,3 @@ fi AC_SUBST(LIBEFENCE) AC_SUBST(HAVE_LIBEFENCE) -AM_CONDITIONAL(LIBLUSTRE, test x$host_cpu = xlib) -AC_MSG_CHECKING(if you are building lib lustre) -if test "$host_cpu" = "lib"; then - AC_MSG_RESULT(yes) - libdir='${exec_prefix}/lib/lustre' -else - AC_MSG_RESULT(no) -fi - -# end -------- Kernel build environment. ----------------- - - diff --git a/lustre/portals/configure.in b/lustre/portals/configure.in index 2ee86b2..31d3492 100644 --- a/lustre/portals/configure.in +++ b/lustre/portals/configure.in @@ -13,7 +13,6 @@ AM_INIT_AUTOMAKE(portals, builtin([esyscmd], [sed -ne '/.*define IVERSION /{ s/. sinclude(build.m4) sinclude(archdep.m4) -sinclude(portalsconf.m4) if test x$enable_inkernel = xyes ; then cp Kernelenv.mk Kernelenv.in @@ -31,6 +30,5 @@ AC_OUTPUT([Makefile Kernelenv libcfs/Makefile portals/Makefile \ unals/Makefile knals/Makefile router/Makefile \ knals/socknal/Makefile knals/gmnal/Makefile knals/qswnal/Makefile \ knals/scimacnal/Makefile knals/toenal/Makefile \ - utils/Makefile tests/Makefile doc/Makefile \ - packaging/Makefile packaging/portals.spec ]) + utils/Makefile tests/Makefile doc/Makefile ]) diff --git a/lustre/portals/include/portals/lib-p30.h b/lustre/portals/include/portals/lib-p30.h index b70e128..4a61e76 100644 --- a/lustre/portals/include/portals/lib-p30.h +++ b/lustre/portals/include/portals/lib-p30.h @@ -370,6 +370,7 @@ extern void lib_copy_buf2iov (int niov, struct iovec *iov, char *dest, ptl_size_ extern ptl_size_t lib_kiov_nob (int niov, ptl_kiov_t *iov); extern void lib_copy_kiov2buf (char *dest, int niov, ptl_kiov_t *iov, ptl_size_t len); extern void lib_copy_buf2kiov (int niov, ptl_kiov_t *iov, char *src, ptl_size_t len); +extern void lib_assert_wire_constants (void); extern void lib_recv (nal_cb_t *nal, void *private, lib_msg_t *msg, lib_md_t *md, ptl_size_t offset, ptl_size_t mlen, ptl_size_t rlen); diff --git a/lustre/portals/include/portals/lib-types.h b/lustre/portals/include/portals/lib-types.h index bece0a30..47c0dd2 100644 --- a/lustre/portals/include/portals/lib-types.h +++ b/lustre/portals/include/portals/lib-types.h @@ -31,6 +31,8 @@ typedef struct lib_me_t lib_me_t; typedef struct lib_md_t lib_md_t; typedef struct lib_eq_t lib_eq_t; +#define WIRE_ATTR __attribute__((packed)) + /* The wire handle's interface cookie only matches one network interface in * one epoch (i.e. new cookie when the interface restarts or the node * reboots). The object cookie only matches one object on that interface @@ -38,7 +40,7 @@ typedef struct lib_eq_t lib_eq_t; typedef struct { __u64 wh_interface_cookie; __u64 wh_object_cookie; -} ptl_handle_wire_t; +} WIRE_ATTR ptl_handle_wire_t; /* byte-flip insensitive! */ #define PTL_WIRE_HANDLE_NONE \ @@ -63,7 +65,7 @@ typedef struct ptl_ack { ptl_handle_wire_t dst_wmd; ptl_match_bits_t match_bits; ptl_size_t length; /* common length (0 for acks) moving out RSN */ -} ptl_ack_t; +} WIRE_ATTR ptl_ack_t; typedef struct ptl_put { ptl_pt_index_t ptl_index; @@ -72,7 +74,7 @@ typedef struct ptl_put { ptl_size_t length; /* common length moving out RSN */ ptl_size_t offset; ptl_hdr_data_t hdr_data; -} ptl_put_t; +} WIRE_ATTR ptl_put_t; typedef struct ptl_get { ptl_pt_index_t ptl_index; @@ -82,7 +84,7 @@ typedef struct ptl_get { ptl_size_t src_offset; ptl_size_t return_offset; /* unused: going RSN */ ptl_size_t sink_length; -} ptl_get_t; +} WIRE_ATTR ptl_get_t; typedef struct ptl_reply { __u32 unused1; /* unused fields going RSN */ @@ -90,7 +92,7 @@ typedef struct ptl_reply { ptl_size_t dst_offset; /* unused: going RSN */ __u32 unused2; ptl_size_t length; /* common length moving out RSN */ -} ptl_reply_t; +} WIRE_ATTR ptl_reply_t; typedef struct { ptl_nid_t dest_nid; @@ -104,7 +106,7 @@ typedef struct { ptl_get_t get; ptl_reply_t reply; } msg; -} ptl_hdr_t; +} WIRE_ATTR ptl_hdr_t; /* All length fields in individual unions at same offset */ /* LASSERT for same in lib-move.c */ @@ -122,7 +124,7 @@ typedef struct { __u32 magic; /* PORTALS_PROTO_MAGIC */ __u16 version_major; /* increment on incompatible change */ __u16 version_minor; /* increment on compatible change */ -} ptl_magicversion_t; +} WIRE_ATTR ptl_magicversion_t; #define PORTALS_PROTO_MAGIC 0xeebc0ded diff --git a/lustre/portals/knals/Makefile.am b/lustre/portals/knals/Makefile.am index 5c6085e..fed2785 100644 --- a/lustre/portals/knals/Makefile.am +++ b/lustre/portals/knals/Makefile.am @@ -3,4 +3,5 @@ # This code is issued under the GNU General Public License. # See the file COPYING in this distribution +DIST_SUBDIRS= socknal toenal qswnal gmnal scimacnal SUBDIRS= socknal toenal @QSWNAL@ @GMNAL@ @SCIMACNAL@ diff --git a/lustre/portals/libcfs/module.c b/lustre/portals/libcfs/module.c index 5025856..c4ca2e3 100644 --- a/lustre/portals/libcfs/module.c +++ b/lustre/portals/libcfs/module.c @@ -19,7 +19,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define EXPORT_SYMTAB +#ifndef EXPORT_SYMTAB +# define EXPORT_SYMTAB +#endif #define DEBUG_SUBSYSTEM S_PORTALS #include @@ -45,6 +47,7 @@ #include #include #include +#include #define PORTAL_MINOR 240 @@ -84,10 +87,10 @@ kportal_blockallsigs () { unsigned long flags; - spin_lock_irqsave (¤t->sigmask_lock, flags); - siginitsetinv (¤t->blocked, 0); - recalc_sigpending (current); - spin_unlock_irqrestore (¤t->sigmask_lock, flags); + SIGNAL_MASK_LOCK(current, flags); + sigfillset(¤t->blocked); + RECALC_SIGPENDING; + SIGNAL_MASK_UNLOCK(current, flags); } /* called when opening /dev/device */ diff --git a/lustre/portals/portals/lib-init.c b/lustre/portals/portals/lib-init.c index d6315c6..99c4d32 100644 --- a/lustre/portals/portals/lib-init.c +++ b/lustre/portals/portals/lib-init.c @@ -357,6 +357,8 @@ lib_init(nal_cb_t * nal, ptl_nid_t nid, ptl_pid_t pid, int gsize, goto out; } + lib_assert_wire_constants (); + /* * Allocate the portal table for this interface * and all per-interface objects. diff --git a/lustre/portals/portals/lib-move.c b/lustre/portals/portals/lib-move.c index a04e961..fde4f16 100644 --- a/lustre/portals/portals/lib-move.c +++ b/lustre/portals/portals/lib-move.c @@ -1285,3 +1285,95 @@ int do_PtlGet(nal_cb_t * nal, void *private, void *v_args, void *v_ret) return ret->rc = PTL_OK; } + +void lib_assert_wire_constants (void) +{ + /* Wire protocol assertions generated by 'wirecheck' */ + + /* Constants... */ + LASSERT (PORTALS_PROTO_MAGIC == 0xeebc0ded); + LASSERT (PORTALS_PROTO_VERSION_MAJOR == 0); + LASSERT (PORTALS_PROTO_VERSION_MINOR == 1); + LASSERT (PTL_MSG_ACK == 0); + LASSERT (PTL_MSG_PUT == 1); + LASSERT (PTL_MSG_GET == 2); + LASSERT (PTL_MSG_REPLY == 3); + LASSERT (PTL_MSG_HELLO == 4); + + /* Checks for struct ptl_handle_wire_t */ + LASSERT (sizeof (ptl_handle_wire_t) == 16); + LASSERT (offsetof (ptl_handle_wire_t, wh_interface_cookie) == 0); + LASSERT (sizeof (((ptl_handle_wire_t *)0)->wh_interface_cookie) == 8); + LASSERT (offsetof (ptl_handle_wire_t, wh_object_cookie) == 8); + LASSERT (sizeof (((ptl_handle_wire_t *)0)->wh_object_cookie) == 8); + + /* Checks for struct ptl_magicversion_t */ + LASSERT (sizeof (ptl_magicversion_t) == 8); + LASSERT (offsetof (ptl_magicversion_t, magic) == 0); + LASSERT (sizeof (((ptl_magicversion_t *)0)->magic) == 4); + LASSERT (offsetof (ptl_magicversion_t, version_major) == 4); + LASSERT (sizeof (((ptl_magicversion_t *)0)->version_major) == 2); + LASSERT (offsetof (ptl_magicversion_t, version_minor) == 6); + LASSERT (sizeof (((ptl_magicversion_t *)0)->version_minor) == 2); + + /* Checks for struct ptl_hdr_t */ + LASSERT (sizeof (ptl_hdr_t) == 72); + LASSERT (offsetof (ptl_hdr_t, dest_nid) == 0); + LASSERT (sizeof (((ptl_hdr_t *)0)->dest_nid) == 8); + LASSERT (offsetof (ptl_hdr_t, src_nid) == 8); + LASSERT (sizeof (((ptl_hdr_t *)0)->src_nid) == 8); + LASSERT (offsetof (ptl_hdr_t, dest_pid) == 16); + LASSERT (sizeof (((ptl_hdr_t *)0)->dest_pid) == 4); + LASSERT (offsetof (ptl_hdr_t, src_pid) == 20); + LASSERT (sizeof (((ptl_hdr_t *)0)->src_pid) == 4); + LASSERT (offsetof (ptl_hdr_t, type) == 24); + LASSERT (sizeof (((ptl_hdr_t *)0)->type) == 4); + + /* Ack */ + LASSERT (offsetof (ptl_hdr_t, msg.ack.mlength) == 28); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.ack.mlength) == 4); + LASSERT (offsetof (ptl_hdr_t, msg.ack.dst_wmd) == 32); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.ack.dst_wmd) == 16); + LASSERT (offsetof (ptl_hdr_t, msg.ack.match_bits) == 48); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.ack.match_bits) == 8); + LASSERT (offsetof (ptl_hdr_t, msg.ack.length) == 56); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.ack.length) == 4); + + /* Put */ + LASSERT (offsetof (ptl_hdr_t, msg.put.ptl_index) == 28); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.put.ptl_index) == 4); + LASSERT (offsetof (ptl_hdr_t, msg.put.ack_wmd) == 32); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.put.ack_wmd) == 16); + LASSERT (offsetof (ptl_hdr_t, msg.put.match_bits) == 48); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.put.match_bits) == 8); + LASSERT (offsetof (ptl_hdr_t, msg.put.length) == 56); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.put.length) == 4); + LASSERT (offsetof (ptl_hdr_t, msg.put.offset) == 60); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.put.offset) == 4); + LASSERT (offsetof (ptl_hdr_t, msg.put.hdr_data) == 64); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.put.hdr_data) == 8); + + /* Get */ + LASSERT (offsetof (ptl_hdr_t, msg.get.ptl_index) == 28); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.get.ptl_index) == 4); + LASSERT (offsetof (ptl_hdr_t, msg.get.return_wmd) == 32); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.get.return_wmd) == 16); + LASSERT (offsetof (ptl_hdr_t, msg.get.match_bits) == 48); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.get.match_bits) == 8); + LASSERT (offsetof (ptl_hdr_t, msg.get.length) == 56); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.get.length) == 4); + LASSERT (offsetof (ptl_hdr_t, msg.get.src_offset) == 60); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.get.src_offset) == 4); + LASSERT (offsetof (ptl_hdr_t, msg.get.return_offset) == 64); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.get.return_offset) == 4); + LASSERT (offsetof (ptl_hdr_t, msg.get.sink_length) == 68); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.get.sink_length) == 4); + + /* Reply */ + LASSERT (offsetof (ptl_hdr_t, msg.reply.dst_wmd) == 32); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.reply.dst_wmd) == 16); + LASSERT (offsetof (ptl_hdr_t, msg.reply.dst_offset) == 48); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.reply.dst_offset) == 4); + LASSERT (offsetof (ptl_hdr_t, msg.reply.length) == 56); + LASSERT (sizeof (((ptl_hdr_t *)0)->msg.reply.length) == 4); +} diff --git a/lustre/portals/portalsconf.m4 b/lustre/portals/portalsconf.m4 deleted file mode 100644 index 7bd3919..0000000 --- a/lustre/portals/portalsconf.m4 +++ /dev/null @@ -1,118 +0,0 @@ -AC_PREFIX_DEFAULT([]) -if test "x$prefix" = xNONE || test "x$prefix" = x; then - usrprefix=/usr -else - usrprefix='${prefix}' -fi -AC_SUBST(usrprefix) - -AC_ARG_ENABLE(rtscts-myrinet, [ --enable-rtscts-myrinet enable rtscts over myrinet support]) -AM_CONDITIONAL(RTSCTS_MYRINET, test "$enable_rtscts_myrinet" = yes) - - -CPLANT_ARCH=${target_cpu} -case ${CPLANT_ARCH} in -alpha*) - RTSCTSLIB_CFLAGS='-O4 -mno-fp-regs' - RTSCTSLIB_DEFS=-Ddec_linux - ;; -i*86) - RTSCTSLIB_CFLAGS=-O4 - RTSCTSLIB_DEFS=-Dintel_linux - ;; -#*) -# AC_MSG_ERROR([Unrecognized architecture '$CPLANT_ARCH' for rtscts]) -# ;; -esac -AC_SUBST(CPLANT_ARCH) -AC_SUBST(RTSCTSLIB_CFLAGS) -AC_SUBST(RTSCTSLIB_DEFS) - -AC_MSG_CHECKING(if kernel has CPU affinity support) -if test "$target_cpu" != ia64 ; then - enable_affinity_temp="-DCPU_AFFINITY=1" - AC_MSG_RESULT(yes) -else - enable_affinity_temp="" - AC_MSG_RESULT(no) -fi -AC_MSG_CHECKING(if kernel has zero-copy TCP support) -ZCCD="`grep -c zccd $LINUX/include/linux/skbuff.h`" -if test "$ZCCD" != 0 ; then - enable_zerocopy_temp="-DSOCKNAL_ZC=1" - AC_MSG_RESULT(yes) -else - enable_zerocopy_temp="" - AC_MSG_RESULT(no) -fi - -AC_ARG_ENABLE(zerocopy, [ --enable-zerocopy enable socknal zerocopy],enable_zerocopy="-DSOCKNAL_ZC=1", enable_zercopy=$enable_zerocopy_temp) - -AC_ARG_ENABLE(affinity, [ --enable-affinity enable process/irq affinity],enable_affinity="-DCPU_AFFINITY=1", enable_affinity=$enable_affinity_temp) -##################################### - -AC_MSG_CHECKING(if quadrics kernel headers are present) -if test -d $LINUX/drivers/net/qsnet ; then - AC_MSG_RESULT(yes) - QSWNAL="qswnal" - with_quadrics="-I$LINUX/drivers/net/qsnet/include" - : -elif test -d $LINUX/drivers/qsnet1 ; then - AC_MSG_RESULT(yes) - QSWNAL="qswnal" - with_quadrics="-I$LINUX/drivers/qsnet1/include -DPROPRIETARY_ELAN" - : -elif test -d $LINUX/drivers/quadrics ; then - AC_MSG_RESULT(yes) - QSWNAL="qswnal" - with_quadrics="-I$LINUX/drivers/quadrics/include -DPROPRIETARY_ELAN" - : -#elif test -d /usr/include/elan3 ; then -# AC_MSG_RESULT(yes) -# QSWNAL="qswnal" -# with_quadrics="" -# : -else - AC_MSG_RESULT(no) - QSWNAL="" - with_quadrics="" - : -fi -AC_SUBST(with_quadrics) -AC_SUBST(QSWNAL) - -# R. Read 5/02 -GMNAL="" -echo "checking with-gm=" ${with_gm} -if test "${with_gm+set}" = set; then - if test "${with_gm}" = yes; then - with_gm="-I/usr/local/gm/include" - else - with_gm=-I"$with_gm/include" - fi - GMNAL="gmnal" -else -# default case - no GM - with_gm="" -fi -AC_SUBST(with_gm) -AC_SUBST(GMNAL) - - -def_scamac=/opt/scali/include -AC_ARG_WITH(scamac, [ --with-scamac=[yes/no/path] Path to ScaMAC includes (default=/opt/scali/include)], with_scamac=$withval, with_scamac=$def_scamac) -AC_MSG_CHECKING(if ScaMAC headers are present) -if test "$with_scamac" = yes; then - with_scamac=$def_scamac -fi -if test "$with_scamac" != no -a -f ${with_scamac}/scamac.h; then - AC_MSG_RESULT(yes) - SCIMACNAL="scimacnal" - with_scamac="-I${with_scamac} -I${with_scamac}/icm" -else - AC_MSG_RESULT(no) - SCIMACNAL="" - with_scamac="" -fi -AC_SUBST(with_scamac) -AC_SUBST(SCIMACNAL) diff --git a/lustre/portals/unals/Makefile.am b/lustre/portals/unals/Makefile.am index b62b401..dc427b0 100644 --- a/lustre/portals/unals/Makefile.am +++ b/lustre/portals/unals/Makefile.am @@ -1,5 +1,5 @@ CPPFLAGS= INCLUDES=-I$(top_srcdir)/portals/include -I$(top_srcdir)/include -I$(srcdir) lib_LIBRARIES = libtcpnal.a -pkginclude_HEADERS = pqtimer.h dispatch.h table.h timer.h connection.h +pkginclude_HEADERS = pqtimer.h dispatch.h table.h timer.h connection.h ipmap.h bridge.h procbridge.h libtcpnal_a_SOURCES = debug.c pqtimer.c select.c table.c pqtimer.h dispatch.h table.h timer.h address.c procapi.c proclib.c connection.c tcpnal.c connection.h diff --git a/lustre/portals/utils/.cvsignore b/lustre/portals/utils/.cvsignore index 041cd6b..148310a 100644 --- a/lustre/portals/utils/.cvsignore +++ b/lustre/portals/utils/.cvsignore @@ -5,3 +5,4 @@ debugctl ptlctl .deps routerstat +wirecheck \ No newline at end of file diff --git a/lustre/portals/utils/Makefile.am b/lustre/portals/utils/Makefile.am index 065fcf9..05af598 100644 --- a/lustre/portals/utils/Makefile.am +++ b/lustre/portals/utils/Makefile.am @@ -7,11 +7,13 @@ COMPILE = gcc -Wall -g -I$(srcdir)/../include LINK = gcc -o $@ -sbin_PROGRAMS = acceptor ptlctl debugctl routerstat +sbin_PROGRAMS = acceptor ptlctl debugctl routerstat wirecheck lib_LIBRARIES = libptlctl.a acceptor_SOURCES = acceptor.c # -lefence +wirecheck_SOURCES = wirecheck.c + libptlctl_a_SOURCES = portals.c debug.c l_ioctl.c parser.c parser.h ptlctl_SOURCES = ptlctl.c