From 04297a6e8c5702af1819da35bd551ce58ae014c4 Mon Sep 17 00:00:00 2001 From: pschwan Date: Thu, 3 Jul 2003 19:54:47 +0000 Subject: [PATCH] Merge b_devel into b_orphan (20030703 update tag) --- lnet/archdep.m4 | 4 +-- lnet/include/config.h.in | 55 ++++++++++++++++++++++++++++++--- lnet/include/linux/kp30.h | 42 ++++++++++++------------- lnet/klnds/qswlnd/qswlnd.h | 2 +- lnet/klnds/qswlnd/qswlnd_cb.c | 1 + lnet/libcfs/module.c | 1 + lustre/portals/archdep.m4 | 4 +-- lustre/portals/include/config.h.in | 55 ++++++++++++++++++++++++++++++--- lustre/portals/include/linux/kp30.h | 42 ++++++++++++------------- lustre/portals/knals/qswnal/qswnal.h | 2 +- lustre/portals/knals/qswnal/qswnal_cb.c | 1 + lustre/portals/libcfs/module.c | 1 + 12 files changed, 152 insertions(+), 58 deletions(-) diff --git a/lnet/archdep.m4 b/lnet/archdep.m4 index f9ca355..7a4e05c 100644 --- a/lnet/archdep.m4 +++ b/lnet/archdep.m4 @@ -106,7 +106,7 @@ case ${host_cpu} in ia64 ) AC_MSG_RESULT($host_cpu) - KCFLAGS='-gstabs -O2 -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -ffixed-r13 -mfixed-range=f10-f15,f32-f127 -falign-functions=32 -mb-step' + KCFLAGS='-g -O2 -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -ffixed-r13 -mfixed-range=f10-f15,f32-f127 -falign-functions=32 -mb-step' KCPPFLAGS='-D__KERNEL__ -DMODULE' MOD_LINK=elf64_ia64 ;; @@ -219,7 +219,7 @@ else AC_MSG_RESULT(no) fi -AC_ARG_ENABLE(zerocopy, [ --enable-zerocopy enable socknal zerocopy],enable_zerocopy="-DSOCKNAL_ZC=1", enable_zerocopy="") +AC_ARG_ENABLE(zerocopy, [ --enable-zerocopy enable socknal zerocopy],enable_zerocopy=$enable_zerocopy_temp, enable_zerocopy="") AC_ARG_ENABLE(affinity, [ --enable-affinity enable process/irq affinity],enable_affinity="-DCPU_AFFINITY=1", enable_affinity=$enable_affinity_temp) ##################################### diff --git a/lnet/include/config.h.in b/lnet/include/config.h.in index b05d0c4..3aa6909 100644 --- a/lnet/include/config.h.in +++ b/lnet/include/config.h.in @@ -1,11 +1,58 @@ -/* ../include/config.h.in. Generated automatically from configure.in by autoheader. */ +/* portals/include/config.h.in. Generated from configure.in by autoheader. */ -/* Define if you have the readline library (-lreadline). */ -#undef HAVE_LIBREADLINE +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* IOCTL Buffer Size */ +#undef OBD_MAX_IOCTL_BUFFER /* Name of package */ #undef PACKAGE +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* The size of a `unsigned long long', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_LONG_LONG + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + /* Version number of package */ #undef VERSION - diff --git a/lnet/include/linux/kp30.h b/lnet/include/linux/kp30.h index d0f3f09..f607359 100644 --- a/lnet/include/linux/kp30.h +++ b/lnet/include/linux/kp30.h @@ -262,28 +262,27 @@ do { \ #define PORTAL_ALLOC(ptr, size) \ do { \ - long s = size; \ LASSERT (!in_interrupt()); \ - if (s > PORTAL_VMALLOC_SIZE) \ - (ptr) = vmalloc(s); \ + if ((size) > PORTAL_VMALLOC_SIZE) \ + (ptr) = vmalloc(size); \ else \ - (ptr) = kmalloc(s, GFP_NOFS); \ + (ptr) = kmalloc((size), GFP_NOFS); \ if ((ptr) == NULL) \ - CERROR("PORTALS: out of memory at %s:%d (tried to alloc" \ - " '" #ptr "' = %ld)\n", __FILE__, __LINE__, s); \ + CERROR("PORTALS: out of memory at %s:%d (tried to alloc '"\ + #ptr "' = %d)\n", __FILE__, __LINE__, (int)(size));\ else { \ - portal_kmem_inc((ptr), s); \ - memset((ptr), 0, s); \ + portal_kmem_inc((ptr), (size)); \ + memset((ptr), 0, (size)); \ } \ - CDEBUG(D_MALLOC, "kmalloced '" #ptr "': %ld at %p (tot %d).\n", \ - s, (ptr), atomic_read (&portal_kmemory)); \ + CDEBUG(D_MALLOC, "kmalloced '" #ptr "': %d at %p (tot %d).\n", \ + (int)(size), (ptr), atomic_read (&portal_kmemory)); \ } while (0) #define PORTAL_FREE(ptr, size) \ do { \ - long s = (size); \ + int s = (size); \ if ((ptr) == NULL) { \ - CERROR("PORTALS: free NULL '" #ptr "' (%ld bytes) at " \ + CERROR("PORTALS: free NULL '" #ptr "' (%d bytes) at " \ "%s:%d\n", s, __FILE__, __LINE__); \ break; \ } \ @@ -292,39 +291,38 @@ do { \ else \ kfree(ptr); \ portal_kmem_dec((ptr), s); \ - CDEBUG(D_MALLOC, "kfreed '" #ptr "': %ld at %p (tot %d).\n", \ - s, (ptr), atomic_read (&portal_kmemory)); \ + CDEBUG(D_MALLOC, "kfreed '" #ptr "': %d at %p (tot %d).\n", \ + s, (ptr), atomic_read(&portal_kmemory)); \ } while (0) #define PORTAL_SLAB_ALLOC(ptr, slab, size) \ do { \ - long s = (size); \ - LASSERT (!in_interrupt()); \ + LASSERT(!in_interrupt()); \ (ptr) = kmem_cache_alloc((slab), SLAB_KERNEL); \ if ((ptr) == NULL) { \ CERROR("PORTALS: out of memory at %s:%d (tried to alloc" \ " '" #ptr "' from slab '" #slab "')\n", __FILE__, \ __LINE__); \ } else { \ - portal_kmem_inc((ptr), s); \ - memset((ptr), 0, s); \ + portal_kmem_inc((ptr), (size)); \ + memset((ptr), 0, (size)); \ } \ CDEBUG(D_MALLOC, "kmalloced '" #ptr "': %ld at %p (tot %d).\n", \ - s, (ptr), atomic_read (&portal_kmemory)); \ + (int)(size), (ptr), atomic_read(&portal_kmemory)); \ } while (0) #define PORTAL_SLAB_FREE(ptr, slab, size) \ do { \ - long s = (size); \ + int s = (size); \ if ((ptr) == NULL) { \ - CERROR("PORTALS: free NULL '" #ptr "' (%ld bytes) at " \ + CERROR("PORTALS: free NULL '" #ptr "' (%d bytes) at " \ "%s:%d\n", s, __FILE__, __LINE__); \ break; \ } \ memset((ptr), 0x5a, s); \ kmem_cache_free((slab), ptr); \ portal_kmem_dec((ptr), s); \ - CDEBUG(D_MALLOC, "kfreed '" #ptr "': %ld at %p (tot %d).\n", \ + CDEBUG(D_MALLOC, "kfreed '" #ptr "': %d at %p (tot %d).\n", \ s, (ptr), atomic_read (&portal_kmemory)); \ } while (0) diff --git a/lnet/klnds/qswlnd/qswlnd.h b/lnet/klnds/qswlnd/qswlnd.h index 88ab74f..85e585b 100644 --- a/lnet/klnds/qswlnd/qswlnd.h +++ b/lnet/klnds/qswlnd/qswlnd.h @@ -104,7 +104,7 @@ typedef unsigned long kqsw_csum_t; #define KQSW_TX_MAXCONTIG (1<<10) /* largest payload that gets made contiguous on transmit */ #define KQSW_NTXMSGS 8 /* # normal transmit messages */ -#define KQSW_NNBLK_TXMSGS 128 /* # reserved transmit messages if can't block */ +#define KQSW_NNBLK_TXMSGS 256 /* # reserved transmit messages if can't block */ #define KQSW_NRXMSGS_LARGE 64 /* # large receive buffers */ #define KQSW_EP_ENVELOPES_LARGE 128 /* # large ep envelopes */ diff --git a/lnet/klnds/qswlnd/qswlnd_cb.c b/lnet/klnds/qswlnd/qswlnd_cb.c index 3b47a25..c03d592 100644 --- a/lnet/klnds/qswlnd/qswlnd_cb.c +++ b/lnet/klnds/qswlnd/qswlnd_cb.c @@ -617,6 +617,7 @@ kqswnal_sendmsg (nal_cb_t *nal, if (ktx == NULL) { kqswnal_cerror_hdr (hdr); lib_finalize (&kqswnal_lib, private, cookie); + return (-1); } memcpy (ktx->ktx_buffer, hdr, sizeof (*hdr)); /* copy hdr from caller's stack */ diff --git a/lnet/libcfs/module.c b/lnet/libcfs/module.c index 5e3fcb5..14cc325 100644 --- a/lnet/libcfs/module.c +++ b/lnet/libcfs/module.c @@ -429,6 +429,7 @@ static int kportal_ioctl(struct inode *inode, struct file *file, return (-EINVAL); err = PtlFailNid (*nip, data->ioc_nid, data->ioc_count); + kportal_put_ni (data->ioc_nal); break; } diff --git a/lustre/portals/archdep.m4 b/lustre/portals/archdep.m4 index f9ca355..7a4e05c 100644 --- a/lustre/portals/archdep.m4 +++ b/lustre/portals/archdep.m4 @@ -106,7 +106,7 @@ case ${host_cpu} in ia64 ) AC_MSG_RESULT($host_cpu) - KCFLAGS='-gstabs -O2 -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -ffixed-r13 -mfixed-range=f10-f15,f32-f127 -falign-functions=32 -mb-step' + KCFLAGS='-g -O2 -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -ffixed-r13 -mfixed-range=f10-f15,f32-f127 -falign-functions=32 -mb-step' KCPPFLAGS='-D__KERNEL__ -DMODULE' MOD_LINK=elf64_ia64 ;; @@ -219,7 +219,7 @@ else AC_MSG_RESULT(no) fi -AC_ARG_ENABLE(zerocopy, [ --enable-zerocopy enable socknal zerocopy],enable_zerocopy="-DSOCKNAL_ZC=1", enable_zerocopy="") +AC_ARG_ENABLE(zerocopy, [ --enable-zerocopy enable socknal zerocopy],enable_zerocopy=$enable_zerocopy_temp, enable_zerocopy="") AC_ARG_ENABLE(affinity, [ --enable-affinity enable process/irq affinity],enable_affinity="-DCPU_AFFINITY=1", enable_affinity=$enable_affinity_temp) ##################################### diff --git a/lustre/portals/include/config.h.in b/lustre/portals/include/config.h.in index b05d0c4..3aa6909 100644 --- a/lustre/portals/include/config.h.in +++ b/lustre/portals/include/config.h.in @@ -1,11 +1,58 @@ -/* ../include/config.h.in. Generated automatically from configure.in by autoheader. */ +/* portals/include/config.h.in. Generated from configure.in by autoheader. */ -/* Define if you have the readline library (-lreadline). */ -#undef HAVE_LIBREADLINE +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* IOCTL Buffer Size */ +#undef OBD_MAX_IOCTL_BUFFER /* Name of package */ #undef PACKAGE +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* The size of a `unsigned long long', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_LONG_LONG + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + /* Version number of package */ #undef VERSION - diff --git a/lustre/portals/include/linux/kp30.h b/lustre/portals/include/linux/kp30.h index d0f3f09..f607359 100644 --- a/lustre/portals/include/linux/kp30.h +++ b/lustre/portals/include/linux/kp30.h @@ -262,28 +262,27 @@ do { \ #define PORTAL_ALLOC(ptr, size) \ do { \ - long s = size; \ LASSERT (!in_interrupt()); \ - if (s > PORTAL_VMALLOC_SIZE) \ - (ptr) = vmalloc(s); \ + if ((size) > PORTAL_VMALLOC_SIZE) \ + (ptr) = vmalloc(size); \ else \ - (ptr) = kmalloc(s, GFP_NOFS); \ + (ptr) = kmalloc((size), GFP_NOFS); \ if ((ptr) == NULL) \ - CERROR("PORTALS: out of memory at %s:%d (tried to alloc" \ - " '" #ptr "' = %ld)\n", __FILE__, __LINE__, s); \ + CERROR("PORTALS: out of memory at %s:%d (tried to alloc '"\ + #ptr "' = %d)\n", __FILE__, __LINE__, (int)(size));\ else { \ - portal_kmem_inc((ptr), s); \ - memset((ptr), 0, s); \ + portal_kmem_inc((ptr), (size)); \ + memset((ptr), 0, (size)); \ } \ - CDEBUG(D_MALLOC, "kmalloced '" #ptr "': %ld at %p (tot %d).\n", \ - s, (ptr), atomic_read (&portal_kmemory)); \ + CDEBUG(D_MALLOC, "kmalloced '" #ptr "': %d at %p (tot %d).\n", \ + (int)(size), (ptr), atomic_read (&portal_kmemory)); \ } while (0) #define PORTAL_FREE(ptr, size) \ do { \ - long s = (size); \ + int s = (size); \ if ((ptr) == NULL) { \ - CERROR("PORTALS: free NULL '" #ptr "' (%ld bytes) at " \ + CERROR("PORTALS: free NULL '" #ptr "' (%d bytes) at " \ "%s:%d\n", s, __FILE__, __LINE__); \ break; \ } \ @@ -292,39 +291,38 @@ do { \ else \ kfree(ptr); \ portal_kmem_dec((ptr), s); \ - CDEBUG(D_MALLOC, "kfreed '" #ptr "': %ld at %p (tot %d).\n", \ - s, (ptr), atomic_read (&portal_kmemory)); \ + CDEBUG(D_MALLOC, "kfreed '" #ptr "': %d at %p (tot %d).\n", \ + s, (ptr), atomic_read(&portal_kmemory)); \ } while (0) #define PORTAL_SLAB_ALLOC(ptr, slab, size) \ do { \ - long s = (size); \ - LASSERT (!in_interrupt()); \ + LASSERT(!in_interrupt()); \ (ptr) = kmem_cache_alloc((slab), SLAB_KERNEL); \ if ((ptr) == NULL) { \ CERROR("PORTALS: out of memory at %s:%d (tried to alloc" \ " '" #ptr "' from slab '" #slab "')\n", __FILE__, \ __LINE__); \ } else { \ - portal_kmem_inc((ptr), s); \ - memset((ptr), 0, s); \ + portal_kmem_inc((ptr), (size)); \ + memset((ptr), 0, (size)); \ } \ CDEBUG(D_MALLOC, "kmalloced '" #ptr "': %ld at %p (tot %d).\n", \ - s, (ptr), atomic_read (&portal_kmemory)); \ + (int)(size), (ptr), atomic_read(&portal_kmemory)); \ } while (0) #define PORTAL_SLAB_FREE(ptr, slab, size) \ do { \ - long s = (size); \ + int s = (size); \ if ((ptr) == NULL) { \ - CERROR("PORTALS: free NULL '" #ptr "' (%ld bytes) at " \ + CERROR("PORTALS: free NULL '" #ptr "' (%d bytes) at " \ "%s:%d\n", s, __FILE__, __LINE__); \ break; \ } \ memset((ptr), 0x5a, s); \ kmem_cache_free((slab), ptr); \ portal_kmem_dec((ptr), s); \ - CDEBUG(D_MALLOC, "kfreed '" #ptr "': %ld at %p (tot %d).\n", \ + CDEBUG(D_MALLOC, "kfreed '" #ptr "': %d at %p (tot %d).\n", \ s, (ptr), atomic_read (&portal_kmemory)); \ } while (0) diff --git a/lustre/portals/knals/qswnal/qswnal.h b/lustre/portals/knals/qswnal/qswnal.h index 88ab74f..85e585b 100644 --- a/lustre/portals/knals/qswnal/qswnal.h +++ b/lustre/portals/knals/qswnal/qswnal.h @@ -104,7 +104,7 @@ typedef unsigned long kqsw_csum_t; #define KQSW_TX_MAXCONTIG (1<<10) /* largest payload that gets made contiguous on transmit */ #define KQSW_NTXMSGS 8 /* # normal transmit messages */ -#define KQSW_NNBLK_TXMSGS 128 /* # reserved transmit messages if can't block */ +#define KQSW_NNBLK_TXMSGS 256 /* # reserved transmit messages if can't block */ #define KQSW_NRXMSGS_LARGE 64 /* # large receive buffers */ #define KQSW_EP_ENVELOPES_LARGE 128 /* # large ep envelopes */ diff --git a/lustre/portals/knals/qswnal/qswnal_cb.c b/lustre/portals/knals/qswnal/qswnal_cb.c index 3b47a25..c03d592 100644 --- a/lustre/portals/knals/qswnal/qswnal_cb.c +++ b/lustre/portals/knals/qswnal/qswnal_cb.c @@ -617,6 +617,7 @@ kqswnal_sendmsg (nal_cb_t *nal, if (ktx == NULL) { kqswnal_cerror_hdr (hdr); lib_finalize (&kqswnal_lib, private, cookie); + return (-1); } memcpy (ktx->ktx_buffer, hdr, sizeof (*hdr)); /* copy hdr from caller's stack */ diff --git a/lustre/portals/libcfs/module.c b/lustre/portals/libcfs/module.c index 5e3fcb5..14cc325 100644 --- a/lustre/portals/libcfs/module.c +++ b/lustre/portals/libcfs/module.c @@ -429,6 +429,7 @@ static int kportal_ioctl(struct inode *inode, struct file *file, return (-EINVAL); err = PtlFailNid (*nip, data->ioc_nid, data->ioc_count); + kportal_put_ni (data->ioc_nal); break; } -- 1.8.3.1